[llvm-commits] CVS: llvm/test/Regression/Transforms/TailCallElim/accum_recursion.ll

Chris Lattner lattner at cs.uiuc.edu
Mon Dec 8 17:17:06 PST 2003


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

accum_recursion.ll added (r1.1)

---
Log message:

New testcase for automatic insertion of accumulator variables to eliminate
tail recursion


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

Index: llvm/test/Regression/Transforms/TailCallElim/accum_recursion.ll
diff -c /dev/null llvm/test/Regression/Transforms/TailCallElim/accum_recursion.ll:1.1
*** /dev/null	Mon Dec  8 17:16:35 2003
--- llvm/test/Regression/Transforms/TailCallElim/accum_recursion.ll	Mon Dec  8 17:16:25 2003
***************
*** 0 ****
--- 1,17 ----
+ ; RUN: llvm-as < %s | opt -tailcallelim | llvm-dis | not grep call
+ 
+ int %factorial(int %x) {
+ entry:
+         %tmp.1 = setgt int %x, 0
+         br bool %tmp.1, label %then, label %else
+ 
+ then:
+         %tmp.6 = add int %x, -1
+         %tmp.4 = call int %factorial( int %tmp.6 )
+         %tmp.7 = mul int %tmp.4, %x
+         ret int %tmp.7
+ 
+ else:
+         ret int 1
+ }
+ 





More information about the llvm-commits mailing list