LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 687 - Coalescer failed to join two intervals created by copies from the same temp
Summary: Coalescer failed to join two intervals created by copies from the same temp
Status: RESOLVED FIXED
Alias: None
Product: libraries
Classification: Unclassified
Component: Register Allocator (show other bugs)
Version: 1.0
Hardware: All All
: P enhancement
Assignee: Chris Lattner
URL:
Keywords: code-quality
Depends on:
Blocks:
 
Reported: 2006-01-09 14:20 PST by Evan Cheng
Modified: 2010-02-22 12:54 PST (History)
1 user (show)

See Also:
Fixed By Commit(s):


Attachments
bug.ll (423 bytes, text/plain)
2006-01-09 14:21 PST, Evan Cheng
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Evan Cheng 2006-01-09 14:20:55 PST
********** 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.
Comment 1 Evan Cheng 2006-01-09 14:21:27 PST
Created attachment 306 [details]
bug.ll
Comment 2 Evan Cheng 2006-01-09 14:22:45 PST
To replicate the bug:
llvm-as < bug.ll | llc -march=x86 -enable-x86-dag-isel -print-machineinstrs -o -
Comment 3 Chris Lattner 2006-01-09 14:24:03 PST
Thanks Evan!
Comment 4 Chris Lattner 2006-04-11 23:31:20 PDT
not going to happen for 1.7
Comment 5 Evan Cheng 2006-05-09 01:53:34 PDT
I'll take a crack at this.
Comment 6 Chris Lattner 2006-08-29 18:21:37 PDT
Fixed.  Testcase here: CodeGen/X86/shift-coalesce.ll

-Chris