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) {
4983
4983
if (auto *PN = dyn_cast<PHINode>(V)) {
4984
4984
BasicBlock *BB = PN->getParent ();
4985
4985
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);
4990
4988
// We can't move freeze if the start value is the result of a
4991
4989
// terminator (e.g. an invoke).
4992
- if (auto *OpI = dyn_cast<Instruction>(InV )) {
4990
+ if (auto *OpI = dyn_cast<Instruction>(U )) {
4993
4991
if (OpI->isTerminator ())
4994
4992
return false ;
4995
4993
}
@@ -4999,7 +4997,7 @@ InstCombinerImpl::pushFreezeToPreventPoisonFromPropagating(FreezeInst &OrigFI) {
4999
4997
// invalidating the iterator. We simply don't support this case, but it
5000
4998
// could be handled if there's a use case.
5001
4999
if (isBackEdge (InBB, BB) || !VisitedBBs.insert (InBB).second ||
5002
- match (InV , m_Undef ()))
5000
+ match (U. get () , m_Undef ()))
5003
5001
return false ;
5004
5002
VisitedBBs.insert (InBB);
5005
5003
}
You can’t perform that action at this time.
0 commit comments