[llvm-commits] CVS: llvm/test/Regression/Transforms/Inline/inline_prune.ll

Chris Lattner lattner at cs.uiuc.edu
Thu Jun 1 14:55:29 PDT 2006



Changes in directory llvm/test/Regression/Transforms/Inline:

inline_prune.ll added (r1.1)
---
Log message:

testcase for the recent inliner improvement.



---
Diffs of the changes:  (+40 -0)

 inline_prune.ll |   40 ++++++++++++++++++++++++++++++++++++++++
 1 files changed, 40 insertions(+)


Index: llvm/test/Regression/Transforms/Inline/inline_prune.ll
diff -c /dev/null llvm/test/Regression/Transforms/Inline/inline_prune.ll:1.1
*** /dev/null	Thu Jun  1 16:55:08 2006
--- llvm/test/Regression/Transforms/Inline/inline_prune.ll	Thu Jun  1 16:54:58 2006
***************
*** 0 ****
--- 1,40 ----
+ ; RUN: llvm-as < %s | opt -inline -disable-output &&
+ ; RUN: llvm-as < %s | opt -inline | llvm-dis | not grep 'callee[12](' &&
+ ; RUN: llvm-as < %s | opt -inline | llvm-dis | not grep mul
+ 
+ implementation
+ 
+ internal int %callee1(int %A, int %B) {
+ 	%cond = seteq int %A, 123
+ 	br bool %cond, label %T, label %F
+ T:
+ 	%C = mul int %B, %B
+ 	ret int %C
+ F:
+ 	ret int 0
+ }
+ 
+ internal int %callee2(int %A, int %B) {
+ 	switch int %A, label %T [
+           int 10, label %F
+           int 1234, label %G
+         ]
+ 	%cond = seteq int %A, 123
+ 	br bool %cond, label %T, label %F
+ T:
+ 	%C = mul int %B, %B
+ 	ret int %C
+ F:
+ 	ret int 0
+ G:
+ 	%D = mul int %B, %B
+ 	%E = mul int %D, %B
+ 	ret int %E
+ }
+ 
+ int %test(int %A) {
+ 	%X = call int %callee1(int 10, int %A)
+ 	%Y = call int %callee2(int 10, int %A)
+ 	%Z = add int %X, %Y
+ 	ret int %Z
+ }






More information about the llvm-commits mailing list