File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
llvm/lib/Transforms/InstCombine Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -4983,11 +4983,13 @@ InstCombinerImpl::pushFreezeToPreventPoisonFromPropagating(FreezeInst &OrigFI) {
4983
4983
if (auto *PN = dyn_cast<PHINode>(V)) {
4984
4984
BasicBlock *BB = PN->getParent ();
4985
4985
SmallPtrSet<BasicBlock *, 8 > VisitedBBs;
4986
- for (Use &U : PN->incoming_values ()) {
4987
- BasicBlock *InBB = PN->getIncomingBlock (U);
4986
+ for (unsigned I = 0 ; I < PN->getNumIncomingValues (); ++I) {
4987
+ Value *InV = PN->getIncomingValue (I);
4988
+ BasicBlock *InBB = PN->getIncomingBlock (I);
4989
+
4988
4990
// We can't move freeze if the start value is the result of a
4989
4991
// terminator (e.g. an invoke).
4990
- if (auto *OpI = dyn_cast<Instruction>(U )) {
4992
+ if (auto *OpI = dyn_cast<Instruction>(InV )) {
4991
4993
if (OpI->isTerminator ())
4992
4994
return false ;
4993
4995
}
@@ -4997,7 +4999,7 @@ InstCombinerImpl::pushFreezeToPreventPoisonFromPropagating(FreezeInst &OrigFI) {
4997
4999
// invalidating the iterator. We simply don't support this case, but it
4998
5000
// could be handled if there's a use case.
4999
5001
if (isBackEdge (InBB, BB) || !VisitedBBs.insert (InBB).second ||
5000
- match (U. get () , m_Undef ()))
5002
+ match (InV , m_Undef ()))
5001
5003
return false ;
5002
5004
VisitedBBs.insert (InBB);
5003
5005
}
You can’t perform that action at this time.
0 commit comments