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

Quentin Colombet qcolombet at apple.com
Wed Aug 27 10:03:21 PDT 2014


Hi Mikael,

Thanks for fixing this.

LGTM with two nitpicks:
+      if (MI->isDebugValue()) {
+        continue;
+      }
No, curly brackets for one line block.

+      // 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.

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>





More information about the llvm-commits mailing list