********** JOINING INTERVALS *********** entry: 0 %reg1024 = MOV32rm %NOREG, 1, %NOREG, <ga:X> 4 %reg1025 = MOV32rm <fi#-1>, 1, %NOREG, 0 8 %reg1026 = MOV8rm %reg1024, 1, %NOREG, 0 12 %reg1027 = MOV32rm <fi#-1>, 1, %NOREG, 4 16 %reg1028 = MOV32ri 0 20 %CL = MOV8rr %reg1026 Inspecting %reg1026,0 = [10,46:0) and %reg9,inf = [22,30:0)[34,42:1): Interference! 24 %reg1029 = MOV32rr %reg1025 Inspecting %reg1025,0 = [6,42:0) and %reg1029,0 = [26,30:1)[30,58:0): Interference! 28 SHL32rCL %reg1029<def&use> 32 %CL = MOV8rr %reg1026 Inspecting %reg1026,0 = [10,46:0) and %reg9,inf = [22,30:0)[34,42:1): Interference! 36 %reg1030 = MOV32rr %reg1027 Inspecting %reg1027,0 = [14,38:0) and %reg1030,0 = [38,42:1)[42,50:0): Joined. Result = %reg1030,0 = [14,42:1)[42,50:0) 40 SHLD32rrCL %reg1030<def&use>, %reg1025 It failed to coalesce reg1026 to CL (reg9): Inspecting %reg1026,0 = [10,46:0) and %reg9,inf = [22,30:0)[34,42:1): Interference! The two live ranges are created by copies from the same temp %reg1026.
Created attachment 306 [details] bug.ll
To replicate the bug: llvm-as < bug.ll | llc -march=x86 -enable-x86-dag-isel -print-machineinstrs -o -
Thanks Evan!
not going to happen for 1.7
I'll take a crack at this.
Fixed. Testcase here: CodeGen/X86/shift-coalesce.ll -Chris