[llvm] r200941 - Track register pressure a bit more carefully (weird corner case).

David Blaikie dblaikie at gmail.com
Sun Feb 9 01:55:11 PST 2014


On Sat, Feb 8, 2014 at 6:12 PM, Sean Silva <silvas at purdue.edu> wrote:

> +    }
> +    else {
>
> Someone isn't using clang-format... :}
>

Fixed in r201043


>
>
> On Thu, Feb 6, 2014 at 2:20 PM, Andrew Trick <atrick at apple.com> wrote:
>
>> Author: atrick
>> Date: Thu Feb  6 13:20:41 2014
>> New Revision: 200941
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=200941&view=rev
>> Log:
>> Track register pressure a bit more carefully (weird corner case).
>>
>> This solves a problem where a def machine operand has no uses but has
>> not been marked dead. In this case, the initial RP analysis was being
>> extra precise and determining from LiveIntervals the the register was
>> actually dead. This caused us to omit the register from the RP
>> tracker's block live out. That's all good, but the per-instruction
>> summary still accounted for it as a valid def. This could cause an
>> assertion in the tracker later when we underflow pressure.
>>
>> This is from a bug report on an out-of-tree target. It is not
>> reproducible on well-behaved targets. I'm just making an obvious fix
>> without unit test.
>>
>> Modified:
>>     llvm/trunk/lib/CodeGen/RegisterPressure.cpp
>>
>> Modified: llvm/trunk/lib/CodeGen/RegisterPressure.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegisterPressure.cpp?rev=200941&r1=200940&r2=200941&view=diff
>>
>> ==============================================================================
>> --- llvm/trunk/lib/CodeGen/RegisterPressure.cpp (original)
>> +++ llvm/trunk/lib/CodeGen/RegisterPressure.cpp Thu Feb  6 13:20:41 2014
>> @@ -506,7 +506,14 @@ bool RegPressureTracker::recede(SmallVec
>>          DeadDef = LRQ.isDeadDef();
>>        }
>>      }
>> -    if (!DeadDef) {
>> +    if (DeadDef) {
>> +      // LiveIntervals knows this is a dead even though it's
>> MachineOperand is
>> +      // not flagged as such. Since this register will not be recorded as
>> +      // live-out, increase its PDiff value to avoid underflowing
>> pressure.
>> +      if (PDiff)
>> +        PDiff->addPressureChange(Reg, false, MRI);
>> +    }
>> +    else {
>>        if (LiveRegs.erase(Reg))
>>          decreaseRegPressure(Reg);
>>        else
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>>
>
>
> _______________________________________________
> 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/20140209/145b5ecd/attachment.html>


More information about the llvm-commits mailing list