[LLVMdev] Possible missed optimization?
Borja Ferrer
borja.ferav at gmail.com
Sat Sep 4 17:28:04 PDT 2010
I've compiled the program with -debug-only=regcoalescing and looked at the
output which i've attached in this email. It's pretty advanced so I
understand part of it, but i get lost with all the register live ranges. The
instructions are:
44 %R15<def> = XORRdRr %R15, %R13<kill>
52 %reg1029<def> = MOVRdRr %R14<kill>
60 %reg1029<def> = XORRdRr %reg1029, %R12<kill>
68 %R14<def> = MOVIRdK 18
76 %R14<def> = XORRdRr %R14, %reg1029<kill>
i guess 68 should be assigned a virtual reg instead of 52 leaving reg1029
for later allocation.
If there is anymore debug info i can attach please let me know.
Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100905/5f2964de/attachment.html>
-------------- next part --------------
********** SIMPLE REGISTER COALESCING **********
********** Function: foo
********** JOINING INTERVALS ***********
entry:
4 %reg1027<def> = MOVRdRr %R12<kill>
Inspecting R12,inf = [0,6:0) 0 at 0*-(6) and %reg1027,0.000000e+00 = [6,62:0) 0 at 6-(62):
Joined. Result = R12,inf = [0,62:0) 0 at 0*-(62)
12 %reg1026<def> = MOVRdRr %R13<kill>
Inspecting R13,inf = [0,14:0) 0 at 0*-(14) and %reg1026,0.000000e+00 = [14,46:0) 0 at 14-(46):
Joined. Result = R13,inf = [0,46:0) 0 at 0*-(46)
20 %reg1025<def> = MOVRdRr %R14<kill>
Inspecting R14,inf = [0,22:0)[94,106:1) 0 at 0*-(22) 1 at 94-(106) and %reg1025,0.000000e+00 = [22,54:0) 0 at 22-(54):
Joined. Result = R14,inf = [0,54:0)[94,106:1) 0 at 0*-(54) 1 at 94-(106)
28 %reg1024<def> = MOVRdRr %R15<kill>
Inspecting R15,inf = [0,30:0)[86,106:1) 0 at 0*-(30) 1 at 86-(106) and %reg1024,0.000000e+00 = [30,38:0) 0 at 30-(38):
Joined. Result = R15,inf = [0,38:0)[86,106:1) 0 at 0*-(38) 1 at 86-(106)
84 %R15<def> = MOVRdRr %reg1028<kill>
Inspecting %reg1028,0.000000e+00 = [38,46:1)[46,86:0) 0 at 46-(86) 1 at 38-(46) and R15,inf = [0,38:0)[86,106:1) 0 at 0*-(38) 1 at 86-(106):
Joined. Result = R15,inf = [0,46:0)[46,106:1) 0 at 0*-(46) 1 at 46-(106)
92 %R14<def> = MOVRdRr %reg1031<kill>
Inspecting %reg1031,0.000000e+00 = [70,78:1)[78,94:0) 0 at 78-(94) 1 at 70-(78) and R14,inf = [0,54:0)[94,106:1) 0 at 0*-(54) 1 at 94-(106):
Joined. Result = R14,inf = [0,54:0)[70,78:2)[78,106:1) 0 at 0*-(54) 1 at 78-(106) 2 at 70-(78)
36 %R15<def> = MOVRdRr %R15<kill>
Copy already coalesced.
52 %reg1029<def> = MOVRdRr %R14<kill>
Inspecting R14,inf = [0,54:0)[70,78:2)[78,106:1) 0 at 0*-(54) 1 at 78-(106) 2 at 70-(78) and %reg1029,0.000000e+00 = [54,62:1)[62,78:0) 0 at 62-(78) 1 at 54-(62): Interference!
52 %reg1029<def> = MOVRdRr %R14<kill>
Inspecting R14,inf = [0,54:0)[70,78:2)[78,106:1) 0 at 0*-(54) 1 at 78-(106) 2 at 70-(78) and %reg1029,0.000000e+00 = [54,62:1)[62,78:0) 0 at 62-(78) 1 at 54-(62): Interference!
********** INTERVALS POST JOINING **********
R14,inf = [0,54:0)[70,78:2)[78,106:1) 0 at 0*-(54) 1 at 78-(106) 2 at 70-(78)
R12,inf = [0,62:0) 0 at 0*-(62)
R15,inf = [0,46:0)[46,106:1) 0 at 0*-(46) 1 at 46-(106)
R13,inf = [0,46:0) 0 at 0*-(46)
%reg1029,0.000000e+00 = [54,62:1)[62,78:0) 0 at 62-(78) 1 at 54-(62)
********** INTERVALS **********
R14,inf = [0,54:0)[70,78:2)[78,106:1) 0 at 0*-(54) 1 at 78-(106) 2 at 70-(78)
R12,inf = [0,62:0) 0 at 0*-(62)
R15,inf = [0,46:0)[46,106:1) 0 at 0*-(46) 1 at 46-(106)
R13,inf = [0,46:0) 0 at 0*-(46)
%reg1029,0.000000e+00 = [54,62:1)[62,78:0) 0 at 62-(78) 1 at 54-(62)
********** MACHINEINSTRS **********
BB#0: # derived from entry
44 %R15<def> = XORRdRr %R15, %R13<kill>
52 %reg1029<def> = MOVRdRr %R14<kill>
60 %reg1029<def> = XORRdRr %reg1029, %R12<kill>
68 %R14<def> = MOVIRdK 18
76 %R14<def> = XORRdRr %R14, %reg1029<kill>
104 RET %R15<imp-use,kill>, %R14<imp-use,kill>
More information about the llvm-dev
mailing list