[llvm-commits] [llvm] r57257 - /llvm/trunk/lib/Target/X86/X86InstrInfo.td
Evan Cheng
evan.cheng at apple.com
Tue Oct 7 14:01:19 PDT 2008
On Oct 7, 2008, at 1:44 PM, Dale Johannesen wrote:
>
> On Oct 7, 2008, at 1:34 PMPDT, Evan Cheng wrote:
>
>> Hi Dale,
>>
>> I think we ought to fix the bug in the local register allocator
>> instead. Is it not checking for aliases or sub-registers somewhere?
>>
>> Thanks,
>>
>> Evan
>
> Surely not "instead", the code I changed was clearly wrong.
>
> Here are before-and-after dumps. I have not tracked it through the
> code, but it looks like it's assuming imp-use physregs are supposed
> to match in type with the definition of that reg. That seems like a
> reasonable assumption to me since the code generator has complete
> control of those types.
This is a local liveness bug. AX == AL + AH. The def of AX by MOV16rr
should not be dead. I assume this is a bug that's exposed by fastisel?
Owen, can you work with Dale on this?
Thanks,
Evan
>
> Before
>
>> Starting RegAlloc of: %AX<def,dead> = MOV16rr %reg1029<kill>
>> Regs have values: [AL,%reg1026] [CX,%reg1029]
>> Last use of CX[%reg1029], removing it from live set
>> Last use of CL[%reg1029], removing it from live set
>> Last use of CH[%reg1029], removing it from live set
>> Spilling register AL containing %reg1026 to stack slot #4
>> Register AX [%reg3] is never used, removing it frame live list
>> Register AL [%reg2] is never used, removing it frame live list
>> Register AH [%reg1] is never used, removing it frame live list
>> Register EAX [%reg17] is never used, removing it frame live list
>>
>> Starting RegAlloc of: DIV8r %reg1026<kill>, %AX<imp-def,dead>,
>> %EFLAGS<imp-def,dead>, %AL<imp-use>, %AH<imp-use,kill>
>> Regs have values:
>> Reloading %reg1026 into AL <<<<<<<<< wrong
>> Last use of AL[%reg1026], removing it from live set
>> Last use of AH[%reg1], removing it from live set
>> Register AX [%reg3] is never used, removing it frame live list
>> Register AL [%reg2] is never used, removing it frame live list
>> Register AH [%reg1] is never used, removing it frame live list
>> Register EAX [%reg17] is never used, removing it frame live list
>> Register EFLAGS [%reg23] is never used, removing it frame live list
>
>
> After
>
>> Starting RegAlloc of: %AX<def> = MOV16rr %reg1029<kill>
>> Regs have values: [AL,%reg1026] [CX,%reg1029]
>> Last use of CX[%reg1029], removing it from live set
>> Last use of CL[%reg1029], removing it from live set
>> Last use of CH[%reg1029], removing it from live set
>> Spilling register AL containing %reg1026 to stack slot #4
>>
>> Starting RegAlloc of: DIV8r %reg1026<kill>, %AL<imp-def>, %AH<imp-
>> def,dead>, %EFLAGS<imp-def,dead>, %AX<imp-use,kill>
>> Regs have values: [AH,%reg0] [AL,%reg0] [AX,%reg0]
>> Reloading %reg1026 into CL
>> Last use of CL[%reg1026], removing it from live set
>> Last use of AX[%reg3], removing it from live set
>> Last use of AL[%reg3], removing it from live set
>> Last use of AH[%reg3], removing it from live set
>> Register AH [%reg1] is never used, removing it frame live list
>> Register AX [%reg3] is never used, removing it frame live list
>> Register EAX [%reg17] is never used, removing it frame live list
>> Register EFLAGS [%reg23] is never used, removing it frame live list
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20081007/0edda733/attachment.html>
More information about the llvm-commits
mailing list