LLVM 22.0.0git
Public Member Functions | Static Public Member Functions | List of all members
llvm::HashRecognize Class Reference

The analysis. More...

#include "llvm/Analysis/HashRecognize.h"

Public Member Functions

 HashRecognize (const Loop &L, ScalarEvolution &SE)
 
std::variant< PolynomialInfo, ErrBits, StringRefrecognizeCRC () const
 The main entry point for analyzing a loop and recognizing the CRC algorithm.
 
std::optional< PolynomialInfogetResult () 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.
 

Detailed Description

The analysis.

Definition at line 80 of file HashRecognize.h.

Constructor & Destructor Documentation

◆ HashRecognize()

HashRecognize::HashRecognize ( const Loop L,
ScalarEvolution SE 
)

Definition at line 739 of file HashRecognize.cpp.

Member Function Documentation

◆ dump()

void HashRecognize::dump ( ) const

Definition at line 729 of file HashRecognize.cpp.

References llvm::dbgs(), and print().

◆ genSarwateTable()

CRCTable HashRecognize::genSarwateTable ( const APInt GenPoly,
bool  ByteOrderSwapped 
)
static

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().

◆ getResult()

std::optional< PolynomialInfo > HashRecognize::getResult ( ) const

Definition at line 732 of file HashRecognize.cpp.

References recognizeCRC().

◆ print()

void HashRecognize::print ( raw_ostream OS) const

◆ recognizeCRC()

std::variant< PolynomialInfo, ErrBits, StringRef > HashRecognize::recognizeCRC ( ) const

The documentation for this class was generated from the following files: