Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b49192f

Browse files
committed
Revert "[GVN][NFC] Use early return in phiTranslateImpl() (llvm#149268)"
This reverts commit 1d398a9.
1 parent ace6e20 commit b49192f

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

llvm/lib/Transforms/Scalar/GVN.cpp

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2367,15 +2367,12 @@ uint32_t GVNPass::ValueTable::phiTranslateImpl(const BasicBlock *Pred,
23672367
// See if we can refine the value number by looking at the PN incoming value
23682368
// for the given predecessor.
23692369
if (PHINode *PN = NumberingPhi[Num]) {
2370-
if (PN->getParent() != PhiBlock)
2371-
return Num;
2372-
2373-
for (unsigned I = 0; I != PN->getNumIncomingValues(); ++I) {
2374-
if (PN->getIncomingBlock(I) != Pred)
2375-
continue;
2376-
if (uint32_t TransVal = lookup(PN->getIncomingValue(I), false))
2377-
return TransVal;
2378-
}
2370+
if (PN->getParent() == PhiBlock)
2371+
for (unsigned I = 0; I != PN->getNumIncomingValues(); ++I)
2372+
if (PN->getIncomingBlock(I) == Pred)
2373+
if (uint32_t TransVal = lookup(PN->getIncomingValue(I), false))
2374+
return TransVal;
2375+
return Num;
23792376
}
23802377

23812378
if (BasicBlock *BB = NumberingBB[Num]) {

0 commit comments

Comments
 (0)