diff options
| author | Sanjoy Das <sanjoy@playingwithpointers.com> | 2016-04-01 02:51:30 +0000 |
|---|---|---|
| committer | Sanjoy Das <sanjoy@playingwithpointers.com> | 2016-04-01 02:51:30 +0000 |
| commit | f83ab6de56eeb651b1ce06ea98ada9175a2beb17 (patch) | |
| tree | 5d3ba00e67c95f3de501064f1a954de7e16e09e2 /llvm/test/Transforms/Inline | |
| parent | 18b92968eabd0c3c79417e29d97e9ab502143ed3 (diff) | |
| download | bcm5719-llvm-f83ab6de56eeb651b1ce06ea98ada9175a2beb17.tar.gz bcm5719-llvm-f83ab6de56eeb651b1ce06ea98ada9175a2beb17.zip | |
Don't insert stackrestore on deoptimizing returns
They're not necessary (since the stack pointer is trivially restored on
return), and the way LLVM inserts the stackrestore calls breaks the
IR (we get a stackrestore between the deoptimize call and the return).
llvm-svn: 265101
Diffstat (limited to 'llvm/test/Transforms/Inline')
| -rw-r--r-- | llvm/test/Transforms/Inline/deoptimize-intrinsic.ll | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/llvm/test/Transforms/Inline/deoptimize-intrinsic.ll b/llvm/test/Transforms/Inline/deoptimize-intrinsic.ll index d9b88985551..800ace49e15 100644 --- a/llvm/test/Transforms/Inline/deoptimize-intrinsic.ll +++ b/llvm/test/Transforms/Inline/deoptimize-intrinsic.ll @@ -104,3 +104,19 @@ entry: call i8 @callee_with_alloca(); ret void } + +define i8 @callee_with_dynamic_alloca(i32 %n) alwaysinline { + %p = alloca i8, i32 %n + %v = call i8(...) @llvm.experimental.deoptimize.i8(i32 1) [ "deopt"(i8* %p) ] + ret i8 %v +} + +define void @caller_with_stacksaverestore(i32 %n) { +; CHECK-LABEL: void @caller_with_stacksaverestore( +; CHECK: call void (...) @llvm.experimental.deoptimize.isVoid(i32 1) [ "deopt"(i8* %p.i) ] +; CHECK-NEXT: ret void + + %p = alloca i32, i32 %n + call i8 @callee_with_dynamic_alloca(i32 %n) + ret void +} |

