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. :)
6 ; RUN: llvm-as < %s | opt -tailcallelim | llvm-dis | not grep call
8 define i32 @mul(i32 %x, i32 %y) {
10 %tmp.1 = icmp eq i32 %y, 0 ; <i1> [#uses=1]
11 br i1 %tmp.1, label %return, label %endif
12 endif: ; preds = %entry
13 %tmp.8 = add i32 %y, -1 ; <i32> [#uses=1]
14 %tmp.5 = call i32 @mul( i32 %x, i32 %tmp.8 ) ; <i32> [#uses=1]
15 %tmp.9 = add i32 %tmp.5, %x ; <i32> [#uses=1]
17 return: ; preds = %entry