diff options
| author | Eli Friedman <eli.friedman@gmail.com> | 2016-06-12 02:11:20 +0000 |
|---|---|---|
| committer | Eli Friedman <eli.friedman@gmail.com> | 2016-06-12 02:11:20 +0000 |
| commit | 9f8031c2daa00fdc8a2085f0d111c4afc3bf8938 (patch) | |
| tree | 6f07d79e8e7fd18ad38488cc46a90889f405f31b /llvm/test/Transforms/InstMerge/exceptions.ll | |
| parent | b7713e413b447f33a332a4d777ba5dbe430e65d0 (diff) | |
| download | bcm5719-llvm-9f8031c2daa00fdc8a2085f0d111c4afc3bf8938.tar.gz bcm5719-llvm-9f8031c2daa00fdc8a2085f0d111c4afc3bf8938.zip | |
[MergedLoadStoreMotion] Use correct helper for load hoist safety.
It isn't legal to hoist a load past a call which might not return;
even if it doesn't throw, it could, for example, call exit().
Fixes http://llvm.org/PR27953.
llvm-svn: 272495
Diffstat (limited to 'llvm/test/Transforms/InstMerge/exceptions.ll')
| -rw-r--r-- | llvm/test/Transforms/InstMerge/exceptions.ll | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/test/Transforms/InstMerge/exceptions.ll b/llvm/test/Transforms/InstMerge/exceptions.ll index 8564215e72a..06b79664d7d 100644 --- a/llvm/test/Transforms/InstMerge/exceptions.ll +++ b/llvm/test/Transforms/InstMerge/exceptions.ll @@ -11,12 +11,12 @@ entry: br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %entry - call void @may_throw() + call void @may_exit() nounwind %arrayidx = getelementptr inbounds i32, i32* %p, i64 1 %0 = load i32, i32* %arrayidx, align 4 store i32 %0, i32* @r, align 4 br label %if.end -; CHECK: call void @may_throw() +; CHECK: call void @may_exit() ; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds i32, i32* %p, i64 1 ; CHECK-NEXT: %[[load:.*]] = load i32, i32* %[[gep]], align 4 ; CHECK-NEXT: store i32 %[[load]], i32* @r, align 4 @@ -55,3 +55,4 @@ if.end: ; preds = %if.else, %if.then } declare void @may_throw() +declare void @may_exit() nounwind |

