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

Mikael Holmén mikael.holmen at ericsson.com
Thu Aug 28 02:14:03 PDT 2014


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>
>
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-in-InlineSpiller-to-make-the-rematerilization-lo.patch
Type: text/x-patch
Size: 2980 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140828/2d6e8a9a/attachment.bin>


More information about the llvm-commits mailing list