[LLVMbugs] [Bug 887] NEW: Argument Promotion should handle recursive functions
bugzilla-daemon at cs.uiuc.edu
bugzilla-daemon at cs.uiuc.edu
Fri Aug 25 15:29:10 PDT 2006
http://llvm.org/bugs/show_bug.cgi?id=887
Summary: Argument Promotion should handle recursive functions
Product: libraries
Version: trunk
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: Interprocedural Optimizations
AssignedTo: unassignedbugs at nondot.org
ReportedBy: alenhar2 at uiuc.edu
in the case below, argument promotion should promote the int* x to be passed by
value.
internal int %foo(int* %x, int %n, int %m) {
entry:
%tmp = setne int %n, 0 ; <bool> [#uses=1]
br bool %tmp, label %cond_true, label %cond_false
cond_true: ; preds = %entry
%tmp2 = load int* %x ; <int> [#uses=1]
br label %return
cond_false: ; preds = %entry
%tmp5 = load int* %x ; <int> [#uses=1]
%tmp7 = sub int %n, 1 ; <int> [#uses=1]
%tmp9 = call int %foo( int* %x, int %tmp7, int %tmp5 ) ; <int>
[#uses=1]
%tmp11 = sub int %n, 2 ; <int> [#uses=1]
%tmp14 = call int %foo( int* %x, int %tmp11, int %m ) ; <int>
[#uses=1]
%tmp15 = add int %tmp9, %tmp14 ; <int> [#uses=1]
br label %return
cond_next: ; No predecessors!
br label %return
return: ; preds = %cond_next, %cond_false, %cond_true
%retval.0 = phi int [ %tmp2, %cond_true ], [ %tmp15, %cond_false ], [
undef, %cond_next ] ; <int> [#uses=1]
ret int %retval.0
}
int %bar(int* %x, int %n, int %m) {
entry:
%tmp3 = call int %foo( int* %x, int %n, int %m ) ; <int>
[#uses=1]
br label %return
return: ; preds = %entry
ret int %tmp3
}
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
More information about the llvm-bugs
mailing list