[PATCH] D13239: [ARM] Modify codegen for memcpy intrinsic to prefer LDM/STM.
Tim Northover via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 5 07:23:48 PDT 2015
t.p.northover added a comment.
Looks good to me now, with 1+epsilon nits:
================
Comment at: lib/Target/ARM/ARMBaseInstrInfo.cpp:1252
@@ +1251,3 @@
+
+ LDM.addOperand(MI->getOperand(3)).addImm(ARMCC::AL).addReg(0);
+ STM.addOperand(MI->getOperand(2)).addImm(ARMCC::AL).addReg(0);
----------------
This is idiomatically:
AddDefaultPred(LDM.addOperand(MI->getOperand(3)));
================
Comment at: lib/Target/ARM/ARMBaseInstrInfo.cpp:1259-1263
@@ +1258,7 @@
+ llvm::SmallVector<unsigned, 6> ScratchRegs(NumScratch);
+ std::transform(MI->operands_begin() + 5, MI->operands_end(),
+ ScratchRegs.begin(),
+ [] (const MachineOperand &Op) {
+ return Op.getReg();
+ });
+ std::sort(ScratchRegs.begin(), ScratchRegs.end(),
----------------
I'm not entirely convinced this is clearer than
for(unsigned I = 5; I < MI->getNumOperands(); ++I)
ScratchRegs.push_back(MI->getOperand(I).getReg());
but that's just bike-shedding and probably personal biases, feel free to leave it if you disagree.
http://reviews.llvm.org/D13239
More information about the llvm-commits
mailing list