[llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/stacksaverestore.ll
Chris Lattner
lattner at cs.uiuc.edu
Fri Jan 13 14:01:59 PST 2006
Changes in directory llvm/test/Regression/Transforms/InstCombine:
stacksaverestore.ll added (r1.1)
---
Log message:
new testcases for the stackrestore instcombine optimizations
---
Diffs of the changes: (+20 -0)
stacksaverestore.ll | 20 ++++++++++++++++++++
1 files changed, 20 insertions(+)
Index: llvm/test/Regression/Transforms/InstCombine/stacksaverestore.ll
diff -c /dev/null llvm/test/Regression/Transforms/InstCombine/stacksaverestore.ll:1.1
*** /dev/null Fri Jan 13 16:01:57 2006
--- llvm/test/Regression/Transforms/InstCombine/stacksaverestore.ll Fri Jan 13 16:01:47 2006
***************
*** 0 ****
--- 1,20 ----
+ ; RUN: llvm-as < %s | opt -instcombine -disable-output &&
+ ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep call
+
+ ;; Test that llvm.stackrestore is removed when possible.
+
+ int* %test1(uint %P) {
+ %tmp = call sbyte* %llvm.stacksave()
+ call void %llvm.stackrestore(sbyte* %tmp) ;; not restoring anything
+ %A = alloca int, uint %P
+ ret int* %A
+ }
+
+ void %test2(sbyte* %X) {
+ call void %llvm.stackrestore(sbyte* %X) ;; no allocas before return.
+ ret void
+ }
+
+ declare sbyte* %llvm.stacksave()
+
+ declare void %llvm.stackrestore(sbyte*)
More information about the llvm-commits
mailing list