File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
llvm/lib/Transforms/InstCombine Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments