LLVM: RecurrenceInfo Struct Reference (original) (raw)
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 106 of file HashRecognize.cpp.
| RecurrenceInfo::RecurrenceInfo ( const Loop & L) | inline |
|---|
◆ dump()
◆ matchConditionalRecurrence()
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 283 of file HashRecognize.cpp.
References BO, llvm::dbgs(), ExtraConst, 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().
◆ matchSimpleRecurrence()
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 223 of file HashRecognize.cpp.
References BO, llvm::matchSimpleRecurrence(), P, Phi, Start, and Step.
Referenced by getRecurrences().
◆ operator bool()
| RecurrenceInfo::operator bool ( ) const | inline |
|---|
◆ print()
◆ BO
◆ ExtraConst
std::optional<APInt> RecurrenceInfo::ExtraConst
◆ L
◆ Phi
◆ Start
Value* RecurrenceInfo::Start = nullptr
◆ Step
Value* RecurrenceInfo::Step = nullptr
The documentation for this struct was generated from the following file:
- lib/Analysis/HashRecognize.cpp