[PATCH] D26521: [X86] Allow folding of reloads from stack slots when loading a subreg of the spilled reg

Michael Kuperstein via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 11 09:51:23 PST 2016


mkuper added inline comments.


================
Comment at: lib/CodeGen/TargetInstrInfo.cpp:547
+        unsigned SubRegSize = TRI->getSubRegIdxSize(SubReg);
+        if (SubRegSize > 0 && !(SubRegSize % 8))
+          OpSize = SubRegSize / 8;
----------------
wmi wrote:
> In which case we will have (SubRegSize % 8) != 0?
It will never happen for x86, but it's possible in theory, and this is target-independent code.


================
Comment at: lib/Target/X86/X86InstrInfo.cpp:6281
+                                    MachineInstr *LoadMI) const {
+  // We only support folding into loads from stack-slots.
+  if (LoadMI || MO.isDef())
----------------
wmi wrote:
> Why only folding from stack-slot is supported but folding from load is not?
Because it's the simple case. :-)
I need to make sure the other case makes sense (and find a test-case), and assuming it does, I'll send a follow-up patch.

I'll add a TODO.


https://reviews.llvm.org/D26521





More information about the llvm-commits mailing list