Skip to content

Commit c0d7cde

Browse files
committed
address comments
1 parent 73e6bc6 commit c0d7cde

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

llvm/lib/Transforms/InstCombine/InstructionCombining.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4992,8 +4992,12 @@ InstCombinerImpl::pushFreezeToPreventPoisonFromPropagating(FreezeInst &OrigFI) {
49924992
return false;
49934993
}
49944994

4995-
if (DT.dominates(BB, InBB) || isBackEdge(InBB, BB) ||
4996-
VisitedBBs.contains(InBB) || match(U.get(), m_Undef()))
4995+
// If there's multiple incoming edges from the same predecessor we must
4996+
// ensure the freeze isn't pushed to a single one of the uses,
4997+
// invalidating the iterator. We simply don't support this case, but it
4998+
// could be handled if there's a use case.
4999+
if (isBackEdge(InBB, BB) || !VisitedBBs.insert(InBB).second ||
5000+
match(U.get(), m_Undef()))
49975001
return false;
49985002
VisitedBBs.insert(InBB);
49995003
}

0 commit comments

Comments
 (0)