By replacing branches to CommonExitBlock, we remove the node from
CommonExitBlock's predecessors, invalidating the iterator. The problem
is exposed when the common exit block has multiple predecessors and
needs to sink lifetime info. The modification in the test case trigger
the issue.
Details
Details
Diff Detail
Diff Detail
Event Timeline
lib/Transforms/Utils/CodeExtractor.cpp | ||
---|---|---|
312 | I think we have to increment the iterator at the beginning of the loop, as replaceUsesOfWith may remove the element PI references and then the iterator would become invalid and Transforms/CodeExtractor/live_shrink_hoist.ll crashes. |
Move ++ into the for clause?