[PATCH] D13239: [ARM] Modify codegen for memcpy intrinsic to prefer LDM/STM.

scott douglass via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 2 00:46:45 PDT 2015


scott-0 added a comment.

Thanks for the review. I'll put up a new version after the weekend.


================
Comment at: lib/Target/ARM/ARMISelLowering.cpp:8097-8098
@@ +8096,4 @@
+
+  // The MEMCPY both defines and kills the scratch registers.  We have
+  // to do the kills in a second MI.
+  const ARMBaseInstrInfo *TII = Subtarget->getInstrInfo();
----------------
t.p.northover wrote:
> Why's the second MI needed? Does regalloc not bother to allocate <def,dead> operands or something?
I tried it with <def,kill> and BuildMI refused; I'll investigate using <def,dead>.

================
Comment at: lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp:753-754
@@ +752,4 @@
+  std::vector<MCOperand> RegOps(MI->begin() + OpNum, MI->end());
+  std::stable_sort(RegOps.begin(), RegOps.end(),
+                   [this](const MCOperand &O1, const MCOperand &O2) -> bool {
+                     return MRI.getEncodingValue(O1.getReg()) <
----------------
t.p.northover wrote:
> I think it'd be better to do the sorting when the instruction is expanded, it seems like a useful property to have if anyone wants to analyse an LDM/STM.
I'll investigate moving it.  


http://reviews.llvm.org/D13239





More information about the llvm-commits mailing list