15#ifndef LLVM_ANALYSIS_HASHRECOGNIZE_H
16#define LLVM_ANALYSIS_HASHRECOGNIZE_H
33using ErrBits = std::tuple<KnownBits, unsigned, bool>;
36struct CRCTable :
public std::array<APInt, 256> {
39#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
88 std::variant<PolynomialInfo, ErrBits, StringRef>
recognizeCRC()
const;
89 std::optional<PolynomialInfo>
getResult()
const;
97#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
This file implements a class to represent arbitrary precision integral constant values and operations...
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds.
This header defines various interfaces for pass management in LLVM.
This header provides classes for managing per-loop analyses.
Class for arbitrary precision integers.
A container for analyses that lazily runs them and caches their results.
PreservedAnalyses run(Loop &L, LoopAnalysisManager &AM, LoopStandardAnalysisResults &AR, LPMUpdater &)
HashRecognizePrinterPass(raw_ostream &OS)
static CRCTable genSarwateTable(const APInt &GenPoly, bool ByteOrderSwapped)
Generate a lookup table of 256 entries by interleaving the generating polynomial.
std::optional< PolynomialInfo > getResult() const
LLVM_DUMP_METHOD void dump() const
void print(raw_ostream &OS) const
std::variant< PolynomialInfo, ErrBits, StringRef > recognizeCRC() const
The main entry point for analyzing a loop and recognizing the CRC algorithm.
This class provides an interface for updating the loop pass manager based on mutations to the loop ne...
Represents a single loop in the control flow graph.
A set of analyses that are preserved following a run of a transformation pass.
The main scalar evolution driver.
LLVM Value Representation.
This class implements an extremely fast bulk output stream that can only output to a stream.
This is an optimization pass for GlobalISel generic memory operations.
std::tuple< KnownBits, unsigned, bool > ErrBits
A tuple of bits that are expected to be zero, number N of them expected to be zero,...
A custom std::array with 256 entries, that also has a print function.
LLVM_DUMP_METHOD void dump() const
void print(raw_ostream &OS) const
The adaptor from a function pass to a loop pass computes these analyses and makes them available to t...
A CRTP mix-in to automatically provide informational APIs needed for passes.
The structure that is returned when a polynomial algorithm was recognized by the analysis.