OSDN Git Service

[CodeExtractor] Fix iterator invalidation in findOrCreateBlockForHoisting.
authorFlorian Hahn <florian.hahn@arm.com>
Wed, 1 Nov 2017 09:48:12 +0000 (09:48 +0000)
committerFlorian Hahn <florian.hahn@arm.com>
Wed, 1 Nov 2017 09:48:12 +0000 (09:48 +0000)
commit81b03a38899a9e94b2a8cbf07dac58473b97cedc
tree6fdf0393e644c6aa2e84b84e5174cb26b55df232
parentbfaa9edde93772113f28b727fd8f1bf7f6667ddb
[CodeExtractor] Fix iterator invalidation in findOrCreateBlockForHoisting.

Summary:
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.

Reviewers: davidxl, davide, wmi

Reviewed By: davidxl

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D39112

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317084 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Utils/CodeExtractor.cpp
test/Transforms/CodeExtractor/live_shrink_hoist.ll