[PATCH] Make the rematerialization loop find the same uses as the spill loop in InlineSpiller.cpp

Quentin Colombet qcolombet at apple.com
Thu Aug 28 09:32:53 PDT 2014


LGTM.

Thanks Mikael!

-Quentin

> On Aug 28, 2014, at 2:14 AM, Mikael Holmén <mikael.holmen at ericsson.com> wrote:
> 
> Hi,
> 
> On 08/27/14 19:03, Quentin Colombet wrote:
>> Hi Mikael,
>> 
>> Thanks for fixing this.
>> 
>> LGTM with two nitpicks:
>> +      if (MI->isDebugValue()) {
>> +        continue;
>> +      }
>> No, curly brackets for one line block.
> 
> Sure.
> 
>> 
>> +      // Analyze instruction.
>> +      SmallVector<std::pair<MachineInstr*, unsigned>, 8> Ops;
>> +      MIBundleOperands::VirtRegInfo RI =
>> +        MIBundleOperands(MI).analyzeVirtReg(Reg, &Ops);
>> +
>> +      if (RI.Reads)
>> +        anyRemat |= reMaterializeFor(LI, MI);
>> 
>> Unless I am mistaken, reMaterializeFor also calls analyzeVirtReg. I would either:
>> - Remove the call from reMaterializeFor and pass RI and Ops to reMaterializeFor, or
>> - Hide the test ‘RI.reads’ at the beginning of reMaterializeFor and remove the test form the caller.
> 
> You're right. I changed to your second suggestion.
> 
> New patch attached.
> 
> Thanks,
> Mikael
> 
> 
>> 
>> Cheers,
>> -Quentin
>> 
>> On Aug 27, 2014, at 3:25 AM, Mikael Holmén <mikael.holmen at ericsson.com> wrote:
>> 
>>> Hi,
>>> 
>>> The attached patch makes the rematerialization loop in InlineSpiller.cpp find uses of a register in the same way as the spill loop does.
>>> 
>>> This solves the problem discussed in the thread
>>> 
>>> http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-August/075825.html
>>> 
>>> as agreed upon in
>>> 
>>> http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-August/076167.html
>>> 
>>> Regards,
>>> Mikael
>>> 
>>> 
>>> <0001-Fix-in-InlineSpiller-to-make-the-rematerilization-lo.patch>
>> 
>> 
>> 
> <0001-Fix-in-InlineSpiller-to-make-the-rematerilization-lo.patch>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140828/534a9ba2/attachment.html>


More information about the llvm-commits mailing list