Displaying 1 result from an estimated 1 matches for "bb10_crit_edge".
2008 Jun 11
4
[LLVMdev] Query on optimization and tail call.
...ied this code:
int sum(int n)
{
if (n == 0)
return 0;
else
return n + sum(n-1);
}
and this is what "llvm-gcc -O2" gave me:
define i32 @sum(i32 %n) nounwind {
entry:
%tmp215 = icmp eq i32 %n, 0 ; <i1> [#uses=1]
br i1 %tmp215, label %bb10, label %tailrecurse.bb10_crit_edge
tailrecurse.bb10_crit_edge: ; preds = %entry
%tmp = add i32 %n, -1 ; <i32> [#uses=3]
%tmp17 = mul i32 %tmp, %tmp ; <i32> [#uses=1]
%tmp18 = add i32 %tmp17, %n ; <i32> [#uses=1]
%tmp. = zext i32 %tmp to i64 ; <i64> [#uses=2]
%tmp19 = add i64 %tmp., -1 ; <i64>...