Skip to content

Commit 8b9e1ec

Browse files
committed
Revert "address comments"
This reverts commit 790e7ede98c32b4a8c2f0fa69a2817edfc63e475.
1 parent df6755d commit 8b9e1ec

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

llvm/lib/Transforms/InstCombine/InstructionCombining.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4983,13 +4983,11 @@ InstCombinerImpl::pushFreezeToPreventPoisonFromPropagating(FreezeInst &OrigFI) {
49834983
if (auto *PN = dyn_cast<PHINode>(V)) {
49844984
BasicBlock *BB = PN->getParent();
49854985
SmallPtrSet<BasicBlock *, 8> VisitedBBs;
4986-
for (unsigned I = 0; I < PN->getNumIncomingValues(); ++I) {
4987-
Value *InV = PN->getIncomingValue(I);
4988-
BasicBlock *InBB = PN->getIncomingBlock(I);
4989-
4986+
for (Use &U : PN->incoming_values()) {
4987+
BasicBlock *InBB = PN->getIncomingBlock(U);
49904988
// We can't move freeze if the start value is the result of a
49914989
// terminator (e.g. an invoke).
4992-
if (auto *OpI = dyn_cast<Instruction>(InV)) {
4990+
if (auto *OpI = dyn_cast<Instruction>(U)) {
49934991
if (OpI->isTerminator())
49944992
return false;
49954993
}
@@ -4999,7 +4997,7 @@ InstCombinerImpl::pushFreezeToPreventPoisonFromPropagating(FreezeInst &OrigFI) {
49994997
// invalidating the iterator. We simply don't support this case, but it
50004998
// could be handled if there's a use case.
50014999
if (isBackEdge(InBB, BB) || !VisitedBBs.insert(InBB).second ||
5002-
match(InV, m_Undef()))
5000+
match(U.get(), m_Undef()))
50035001
return false;
50045002
VisitedBBs.insert(InBB);
50055003
}

0 commit comments

Comments
 (0)