This fixes the issue encountered in D71164. Instead of using a range-based for, manually iterate over the users and advance the iterator beforehand, so we do not skip any users due to iterator invalidation.
Details
Details
Diff Detail
Diff Detail
Paths
| Differential D72657
[InstCombine] Fix user iterator invalidation in bitcast of phi transform ClosedPublic Authored by nikic on Jan 13 2020, 2:57 PM.
Details Summary This fixes the issue encountered in D71164. Instead of using a range-based for, manually iterate over the users and advance the iterator beforehand, so we do not skip any users due to iterator invalidation.
Diff Detail Event TimelineThis revision is now accepted and ready to land.Jan 13 2020, 3:04 PM nikic added a child revision: D71164: [InstCombine] Fix infinite loop due to bitcast <-> phi transforms.Jan 14 2020, 12:55 AM Closed by commit rG652cd7c1007a: [InstCombine] Fix user iterator invalidation in bitcast of phi transform (authored by nikic). · Explain WhyJan 14 2020, 11:43 AM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 237790 llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
llvm/test/Transforms/InstCombine/bitcast-phi-uselistorder.ll
|