summaryrefslogtreecommitdiff
path: root/test/CodeGen
diff options
context:
space:
mode:
authorDan Gohman <dan433584@gmail.com>2016-05-17 21:14:26 +0000
committerDan Gohman <dan433584@gmail.com>2016-05-17 21:14:26 +0000
commite5abbb2bf05b35b03f36af6a047b61a28cc779ae (patch)
tree3b557f3a4aae3f20469bf9826066cc30ecb24f32 /test/CodeGen
parent888bd0bf87ab5b7a2efd2fd3525fdd24bce399e2 (diff)
[WebAssembly] Don't stackify calls past stack pointer modifications.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269843 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen')
-rw-r--r--test/CodeGen/WebAssembly/reg-stackify.ll16
1 files changed, 15 insertions, 1 deletions
diff --git a/test/CodeGen/WebAssembly/reg-stackify.ll b/test/CodeGen/WebAssembly/reg-stackify.ll
index bc36357c0b9..0287efe40d4 100644
--- a/test/CodeGen/WebAssembly/reg-stackify.ll
+++ b/test/CodeGen/WebAssembly/reg-stackify.ll
@@ -402,7 +402,7 @@ define i32 @no_stackify_past_epilogue() {
; Stackify a loop induction variable into a loop comparison.
-; CHECK_LABEL: stackify_indvar:
+; CHECK-LABEL: stackify_indvar:
; CHECK: i32.const $push[[L5:.+]]=, 1{{$}}
; CHECK-NEXT: i32.add $push[[L4:.+]]=, $[[R0:.+]], $pop[[L5]]{{$}}
; CHECK-NEXT: tee_local $push[[L3:.+]]=, $[[R0]]=, $pop[[L4]]{{$}}
@@ -424,6 +424,20 @@ bb10: ; preds = %bb9, %bb
ret void
}
+; Don't stackify a call past a __stack_pointer store.
+
+; CHECK-LABEL: stackpointer_dependency:
+; CHECK: call {{.+}}, stackpointer_callee@FUNCTION,
+; CHECK: i32.const $push[[L0:.+]]=, __stack_pointer
+; CHECK-NEXT: i32.store $discard=, 0($pop[[L0]]),
+declare i32 @stackpointer_callee(i8* readnone, i8* readnone)
+declare i8* @llvm.frameaddress(i32)
+define i32 @stackpointer_dependency(i8* readnone) {
+ %2 = tail call i8* @llvm.frameaddress(i32 0)
+ %3 = tail call i32 @stackpointer_callee(i8* %0, i8* %2)
+ ret i32 %3
+}
+
!llvm.module.flags = !{!0}
!llvm.dbg.cu = !{!1}