[PATCH] D14244: [AArch64]Enable the narrow ld promotion only on profitable microarchitectures

Chad Rosier via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 2 09:29:17 PST 2015


mcrosier added inline comments.

================
Comment at: lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp:1196
@@ -1191,3 +1195,3 @@
   for (MachineBasicBlock::iterator MBBI = MBB.begin(), E = MBB.end();
-       !IsStrictAlign && MBBI != E;) {
+       enableNarrowLdOpt && MBBI != E;) {
     MachineInstr *MI = MBBI;
----------------
Why not call enableNarrowLdMerge(MBB->getParent()) here?  You would need to change the logic in enableNarrowLdMerge since you're passing in a pointer to the MF, but that should be trivial.

================
Comment at: lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp:1379
@@ -1374,1 +1378,3 @@
 
+bool AArch64LoadStoreOpt::couldNarrowLdMergeEnabled(MachineFunction &Fn) {
+  const AArch64Subtarget *SubTarget =
----------------
How about enableNarrowLdMerge, rather than couldNarrowLdMergeEnabled?

================
Comment at: lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp:1395
@@ -1381,2 +1394,3 @@
   bool Modified = false;
+  bool enableNarrowLdOpt = couldNarrowLdMergeEnabled(Fn);
   for (auto &MBB : Fn)
----------------
I'd still prefer we sink this check into the optimizeBlock() function.


http://reviews.llvm.org/D14244





More information about the llvm-commits mailing list