Use the llvm-upgrade program to upgrade llvm assembly.
[oota-llvm.git] / test / Transforms / TailCallElim / accum_recursion_constant_arg.ll
1 ; This is a more aggressive form of accumulator recursion insertion, which 
2 ; requires noticing that X doesn't change as we perform the tailcall.  Thanks
3 ; go out to the anonymous users of the demo script for "suggesting" 
4 ; optimizations that should be done.  :)
5
6 ; RUN: llvm-upgrade < %s | llvm-as | opt -tailcallelim | llvm-dis | not grep call
7
8 int %mul(int %x, int %y) {
9 entry:
10         %tmp.1 = seteq int %y, 0
11         br bool %tmp.1, label %return, label %endif
12
13 endif:
14         %tmp.8 = add int %y, -1
15         %tmp.5 = call int %mul( int %x, int %tmp.8 )
16         %tmp.9 = add int %tmp.5, %x
17         ret int %tmp.9
18
19 return:
20         ret int %x
21 }
22