Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions llvm/include/llvm/Analysis/HashRecognize.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,12 @@
#include "llvm/Analysis/ScalarEvolution.h"
#include "llvm/IR/PassManager.h"
#include "llvm/IR/Value.h"
#include "llvm/Support/KnownBits.h"
#include <variant>

namespace llvm {

class LPMUpdater;

/// A tuple of bits that are expected to be zero, number N of them expected to
/// be zero, with a boolean indicating whether it's the top or bottom N bits
/// expected to be zero.
using ErrBits = std::tuple<KnownBits, unsigned, bool>;

/// A custom std::array with 256 entries, that also has a print function.
struct CRCTable : public std::array<APInt, 256> {
void print(raw_ostream &OS) const;
Expand Down Expand Up @@ -85,7 +79,7 @@ class HashRecognize {
HashRecognize(const Loop &L, ScalarEvolution &SE);

// The main analysis entry points.
std::variant<PolynomialInfo, ErrBits, StringRef> recognizeCRC() const;
std::variant<PolynomialInfo, StringRef> recognizeCRC() const;
std::optional<PolynomialInfo> getResult() const;

// Auxilary entry point after analysis to interleave the generating polynomial
Expand Down
8 changes: 8 additions & 0 deletions llvm/include/llvm/IR/PatternMatch.h
Original file line number Diff line number Diff line change
Expand Up @@ -2283,6 +2283,14 @@ m_ZExtOrSExtOrSelf(const OpTy &Op) {
return m_CombineOr(m_ZExtOrSExt(Op), Op);
}

template <typename OpTy>
inline match_combine_or<match_combine_or<CastInst_match<OpTy, ZExtInst>,
CastInst_match<OpTy, TruncInst>>,
OpTy>
m_ZExtOrTruncOrSelf(const OpTy &Op) {
return m_CombineOr(m_CombineOr(m_ZExt(Op), m_Trunc(Op)), Op);
}

template <typename OpTy>
inline CastInst_match<OpTy, UIToFPInst> m_UIToFP(const OpTy &Op) {
return CastInst_match<OpTy, UIToFPInst>(Op);
Expand Down
Loading