[LIR] Use the newly `getRecurrenceVar()` helper. NFCI.

llvm-svn: 303704
This commit is contained in:
Davide Italiano 2017-05-23 23:51:54 +00:00
parent aeb4b7d217
commit 7bf95b964f
1 changed files with 4 additions and 4 deletions

View File

@ -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;