Skip to content

Commit 8b553c4

Browse files
authored
Revert "[GVN][NFC] Use early return in phiTranslateImpl() (#149268)" (#149270)
This reverts commit 1d398a9.
1 parent bce951c commit 8b553c4

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

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)