Add a comment to the commit r165187.

llvm-svn: 165238
This commit is contained in:
Jakub Staszak 2012-10-04 19:08:30 +00:00
parent 4a67f2e2a7
commit e076cac097
1 changed files with 3 additions and 1 deletions

View File

@ -1261,10 +1261,12 @@ static bool needsLFTR(Loop *L, DominatorTree *DT) {
if (!Phi)
return true;
// Do LFTR if the exit condition's IV is *not* a simple counter.
// Do LFTR if PHI node is defined in the loop, but is *not* a counter.
int Idx = Phi->getBasicBlockIndex(L->getLoopLatch());
if (Idx < 0)
return true;
// Do LFTR if the exit condition's IV is *not* a simple counter.
Value *IncV = Phi->getIncomingValue(Idx);
return Phi != getLoopPhiForCounter(IncV, L, DT);
}