LLVM 22.0.0git
|
A structure that can hold either a Simple Recurrence or a Conditional Recurrence. More...
Public Member Functions | |
RecurrenceInfo (const Loop &L) | |
operator bool () const | |
void | print (raw_ostream &OS, unsigned Indent=0) const |
LLVM_DUMP_METHOD void | dump () const |
bool | matchSimpleRecurrence (const PHINode *P) |
Wraps llvm::matchSimpleRecurrence. | |
bool | matchConditionalRecurrence (const PHINode *P, Instruction::BinaryOps BOWithConstOpToMatch=Instruction::BinaryOpsEnd) |
A Conditional Recurrence is a recurrence of the form: | |
Public Attributes | |
const Loop & | L |
const PHINode * | Phi = nullptr |
BinaryOperator * | BO = nullptr |
Value * | Start = nullptr |
Value * | Step = nullptr |
std::optional< APInt > | ExtraConst |
A structure that can hold either a Simple Recurrence or a Conditional Recurrence.
Note that in the case of a Simple Recurrence, Step is an operand of the BO, while in a Conditional Recurrence, it is a SelectInst.
Definition at line 277 of file HashRecognize.cpp.
Definition at line 285 of file HashRecognize.cpp.
|
inline |
Definition at line 309 of file HashRecognize.cpp.
References llvm::dbgs(), and print().
bool RecurrenceInfo::matchConditionalRecurrence | ( | const PHINode * | P, |
Instruction::BinaryOps | BOWithConstOpToMatch = Instruction::BinaryOpsEnd |
||
) |
A Conditional Recurrence is a recurrence of the form:
loop: rec = phi [start, entry], [step, loop] ... step = select _, tv, fv
where tv and fv ultimately end up using rec via the same BO instruction, after digging through the use-def chain.
ExtraConst is relevant if BOWithConstOpToMatch
is supplied: when digging the use-def chain, a BinOp with opcode BOWithConstOpToMatch
is matched, and ExtraConst is a constant operand of that BinOp. This peculiarity exists, because in a CRC algorithm, the BOWithConstOpToMatch
is an XOR, and the ExtraConst ends up being the generating polynomial.
Definition at line 395 of file HashRecognize.cpp.
References BO, llvm::dbgs(), ExtraConst, llvm::PHINode::getIncomingValue(), llvm::PHINode::getNumIncomingValues(), Idx, LLVM_DEBUG, llvm::PatternMatch::m_Cmp(), llvm::PatternMatch::m_Instruction(), llvm::PatternMatch::m_Select(), llvm::SCEVPatternMatch::match(), P, Phi, Start, and Step.
Referenced by getRecurrences().
Wraps llvm::matchSimpleRecurrence.
Match a simple first order recurrence cycle of the form:
loop: rec = phi [start, entry], [BO, loop] ... BO = binop rec, step
or
loop: rec = phi [start, entry], [BO, loop] ... BO = binop step, rec
Definition at line 338 of file HashRecognize.cpp.
References BO, llvm::matchSimpleRecurrence(), P, Phi, Start, and Step.
Referenced by getRecurrences().
|
inline |
Definition at line 286 of file HashRecognize.cpp.
References BO.
|
inline |
Definition at line 288 of file HashRecognize.cpp.
References BO, ExtraConst, llvm::raw_ostream::indent(), OS, Phi, llvm::Value::print(), Start, and Step.
Referenced by dump().
BinaryOperator* RecurrenceInfo::BO = nullptr |
Definition at line 280 of file HashRecognize.cpp.
Referenced by matchConditionalRecurrence(), matchSimpleRecurrence(), operator bool(), and print().
std::optional<APInt> RecurrenceInfo::ExtraConst |
Definition at line 283 of file HashRecognize.cpp.
Referenced by matchConditionalRecurrence(), and print().
Definition at line 278 of file HashRecognize.cpp.
Definition at line 279 of file HashRecognize.cpp.
Referenced by matchConditionalRecurrence(), matchSimpleRecurrence(), and print().
Value* RecurrenceInfo::Start = nullptr |
Definition at line 281 of file HashRecognize.cpp.
Referenced by matchConditionalRecurrence(), matchSimpleRecurrence(), and print().
Value* RecurrenceInfo::Step = nullptr |
Definition at line 282 of file HashRecognize.cpp.
Referenced by matchConditionalRecurrence(), matchSimpleRecurrence(), and print().