diff options
author | Florian Hahn <florian.hahn@arm.com> | 2017-11-01 09:48:12 +0000 |
---|---|---|
committer | Florian Hahn <florian.hahn@arm.com> | 2017-11-01 09:48:12 +0000 |
commit | b93c06331ea77953e80bbd5ffb30167eade466f0 (patch) | |
tree | 9f812759eb8229719ce671c88ef55b1f5a538fc0 /llvm/test/Transforms/CodeExtractor | |
parent | 948c0bcbd6a1fb520db8dbc0c7644a0597de9c16 (diff) | |
download | bcm5719-llvm-b93c06331ea77953e80bbd5ffb30167eade466f0.tar.gz bcm5719-llvm-b93c06331ea77953e80bbd5ffb30167eade466f0.zip |
[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
llvm-svn: 317084
Diffstat (limited to 'llvm/test/Transforms/CodeExtractor')
-rw-r--r-- | llvm/test/Transforms/CodeExtractor/live_shrink_hoist.ll | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/test/Transforms/CodeExtractor/live_shrink_hoist.ll b/llvm/test/Transforms/CodeExtractor/live_shrink_hoist.ll index d1b310f0176..1f57146c941 100644 --- a/llvm/test/Transforms/CodeExtractor/live_shrink_hoist.ll +++ b/llvm/test/Transforms/CodeExtractor/live_shrink_hoist.ll @@ -1,4 +1,4 @@ -; RUN: opt -S -partial-inliner -max-num-inline-blocks=2 -skip-partial-inlining-cost-analysis < %s | FileCheck %s +; RUN: opt -S -partial-inliner -max-num-inline-blocks=3 -skip-partial-inlining-cost-analysis < %s | FileCheck %s ; RUN: opt -S -passes=partial-inliner -max-num-inline-blocks=2 -skip-partial-inlining-cost-analysis < %s | FileCheck %s %class.A = type { i32 } @@ -16,6 +16,10 @@ bb: br i1 %tmp3, label %bb4, label %bb9 bb4: ; preds = %bb + %foo = icmp eq i32 %tmp2, 0 + br i1 %foo, label %bb5, label %bb9 + +bb5: ; preds = %bb4 call void @_ZN1A7memfuncEv(%class.A* nonnull %tmp) %tmp5 = getelementptr inbounds %class.A, %class.A* %tmp, i64 0, i32 0 %tmp6 = load i32, i32* %tmp5, align 4, !tbaa !6 |