LLVM 22.0.0git
|
The analysis. More...
#include "llvm/Analysis/HashRecognize.h"
Public Member Functions | |
HashRecognize (const Loop &L, ScalarEvolution &SE) | |
std::variant< PolynomialInfo, ErrBits, StringRef > | recognizeCRC () const |
The main entry point for analyzing a loop and recognizing the CRC algorithm. | |
std::optional< PolynomialInfo > | getResult () const |
void | print (raw_ostream &OS) const |
LLVM_DUMP_METHOD void | dump () const |
Static Public Member Functions | |
static CRCTable | genSarwateTable (const APInt &GenPoly, bool ByteOrderSwapped) |
Generate a lookup table of 256 entries by interleaving the generating polynomial. | |
The analysis.
Definition at line 80 of file HashRecognize.h.
HashRecognize::HashRecognize | ( | const Loop & | L, |
ScalarEvolution & | SE | ||
) |
Definition at line 739 of file HashRecognize.cpp.
void HashRecognize::dump | ( | ) | const |
Definition at line 729 of file HashRecognize.cpp.
References llvm::dbgs(), and print().
Generate a lookup table of 256 entries by interleaving the generating polynomial.
The optimization technique of table-lookup for CRC is also called the Sarwate algorithm.
Definition at line 485 of file HashRecognize.cpp.
References llvm::APInt::getBitWidth(), llvm::APInt::getSignedMinValue(), llvm::APInt::getZero(), I, llvm::APInt::isSignBitSet(), llvm::APInt::lshr(), and llvm::APInt::shl().
Referenced by print().
std::optional< PolynomialInfo > HashRecognize::getResult | ( | ) | const |
Definition at line 732 of file HashRecognize.cpp.
References recognizeCRC().
void HashRecognize::print | ( | raw_ostream & | OS | ) | const |
Definition at line 685 of file HashRecognize.cpp.
References genSarwateTable(), llvm::raw_ostream::indent(), Info, OS, llvm::CRCTable::print(), and recognizeCRC().
Referenced by dump(), and llvm::HashRecognizePrinterPass::run().
std::variant< PolynomialInfo, ErrBits, StringRef > HashRecognize::recognizeCRC | ( | ) | const |
The main entry point for analyzing a loop and recognizing the CRC algorithm.
Returns a PolynomialInfo on success, and either an ErrBits or a StringRef on failure.
Definition at line 576 of file HashRecognize.cpp.
References assert(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::at(), llvm::BasicBlock::begin(), checkExtractBits(), ValueEvolution::computeEvolutions(), llvm::SmallVectorImpl< T >::emplace_back(), llvm::BasicBlock::end(), llvm::KnownBits::getBitWidth(), ValueEvolution::getError(), llvm::PHINode::getIncomingValueForBlock(), llvm::Type::getIntegerBitWidth(), getRecurrences(), llvm::ScalarEvolution::getSmallConstantTripCount(), llvm::BasicBlock::getTerminator(), llvm::Value::getType(), llvm::SmallPtrSetImpl< PtrType >::insert_range(), isBigEndianBitShift(), isConditionalOnXorOfPHIs(), ValueEvolution::KnownPhis, LHS, N, llvm::none_of(), llvm::SmallPtrSetImplBase::size(), and ValueEvolution::Visited.
Referenced by getResult(), and print().