forked from OSchip/llvm-project
[LIR] Use the newly `getRecurrenceVar()` helper. NFCI.
llvm-svn: 303704
This commit is contained in:
parent
aeb4b7d217
commit
7bf95b964f
|
@ -1139,8 +1139,8 @@ static bool detectPopcountIdiom(Loop *CurLoop, BasicBlock *PreCondBB,
|
|||
if (!Inc || !Inc->isOne())
|
||||
continue;
|
||||
|
||||
PHINode *Phi = dyn_cast<PHINode>(Inst->getOperand(0));
|
||||
if (!Phi || Phi->getParent() != LoopEntry)
|
||||
PHINode *Phi = getRecurrenceVar(Inst->getOperand(0), Inst, LoopEntry);
|
||||
if (!Phi)
|
||||
continue;
|
||||
|
||||
// Check if the result of the instruction is live of the loop.
|
||||
|
@ -1255,8 +1255,8 @@ static bool detectCTLZIdiom(Loop *CurLoop, PHINode *&PhiX,
|
|||
if (!Inc || !Inc->isOne())
|
||||
continue;
|
||||
|
||||
PHINode *Phi = dyn_cast<PHINode>(Inst->getOperand(0));
|
||||
if (!Phi || Phi->getParent() != LoopEntry)
|
||||
PHINode *Phi = getRecurrenceVar(Inst->getOperand(0), Inst, LoopEntry);
|
||||
if (!Phi)
|
||||
continue;
|
||||
|
||||
CntInst = Inst;
|
||||
|
|
Loading…
Reference in New Issue