[llvm-commits] [llvm] r77904 - in /llvm/trunk: include/llvm/CodeGen/RegisterScavenging.h lib/CodeGen/RegisterScavenging.cpp test/CodeGen/Blackfin/load-intr.ll

Evan Cheng evan.cheng at apple.com
Sun Aug 2 22:42:26 PDT 2009


On Aug 2, 2009, at 10:28 PM, Jakob Stoklund Olesen wrote:

>
> On 03/08/2009, at 04.03, Evan Cheng wrote:
>
>>
>> On Aug 2, 2009, at 11:28 AM, Jakob Stoklund Olesen wrote:
>>
>>>
>>> /// setUsed - Set the register and its sub-registers as being used.
>>> void RegScavenger::setUsed(unsigned Reg) {
>>> RegsAvailable.reset(Reg);
>>> @@ -218,7 +226,7 @@
>>>   const MachineOperand MO = *UseMOs[i].first;
>>>   unsigned Reg = MO.getReg();
>>>
>>> -    assert(isUsed(Reg) && "Using an undefined register!");
>>> +    assert((MO.isImplicit() || isUsed(Reg)) && "Using an undefined
>>> register!");
>>
>> Hi Jakob,
>>
>> I don't understand why this is necessary. It's seems like it will end
>> up letting a lot of real errors go through.
>
> Clearly I was too quick to commit this part. Sorry about that.

It's ok. It didn't break anything. I am just concerned of it not  
catching some potential bugs.

>
> I will try to make it work with the stricter rule. Then I can back out
> this part.

Ok. Thanks.

>
>>> @@ -269,7 +277,8 @@
>>>
>>>   // Implicit def is allowed to "re-define" any register. Similarly,
>>>   // implicitly defined registers can be clobbered.
>>> -    assert((isReserved(Reg) || isUnused(Reg) ||
>>> +    assert((MO.isImplicit() || isReserved(Reg) || isUnused(Reg) ||
>>> +            isSuperRegUsed(Reg) ||
>>>           isLiveInButUnusedBefore(Reg, MI, MBB, TRI, MRI)) &&
>>>          "Re-defining a live register!");
>>>   setUsed(Reg);
>
> But this part is OK, right? <imp-def> can redefine a live register.

It shouldn't. Are you talking about re-defining part of a larger  
register? In that case, it should first kill the larger register and  
then redefine it. At least that's what livevariable does. It's unclear  
if it's realistic to enforce this in register scavenger. This might be  
too difficult to maintain. I need to see an example.

Evan

>
> /jakob
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list