File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
llvm/lib/Transforms/InstCombine Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -4985,9 +4985,15 @@ InstCombinerImpl::pushFreezeToPreventPoisonFromPropagating(FreezeInst &OrigFI) {
4985
4985
SmallPtrSet<BasicBlock *, 8 > VisitedBBs;
4986
4986
for (Use &U : PN->incoming_values ()) {
4987
4987
BasicBlock *InBB = PN->getIncomingBlock (U);
4988
+ // We can't move freeze if the start value is the result of a
4989
+ // terminator (e.g. an invoke).
4990
+ if (auto *OpI = dyn_cast<Instruction>(U)) {
4991
+ if (OpI->isTerminator ())
4992
+ return false ;
4993
+ }
4994
+
4988
4995
if (DT.dominates (BB, InBB) || isBackEdge (InBB, BB) ||
4989
- isa<InvokeInst>(U) || VisitedBBs.contains (InBB) ||
4990
- match (U.get (), m_Undef ()))
4996
+ VisitedBBs.contains (InBB) || match (U.get (), m_Undef ()))
4991
4997
return false ;
4992
4998
VisitedBBs.insert (InBB);
4993
4999
}
You can’t perform that action at this time.
0 commit comments