[PATCH] D47943: Sample code for porting MachinePipeliner to AArch64+SVE

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 11 04:04:25 PDT 2018


fhahn added a comment.

Thanks for updating the patch. I think it would be slightly easier to review this patch if you could provide a brief high-level description of the modelling and some test cases.



================
Comment at: lib/CodeGen/MachinePipeliner.cpp:1394
+  unsigned size = 0;
+  for (MachineBasicBlock::iterator I = MBB->getFirstNonPHI(),
+                                   E = MBB->getFirstTerminator();
----------------
could use range based for loop here?


================
Comment at: lib/CodeGen/MachinePipeliner.cpp:1397
+       I != E; ++I) {
+    size++;
+  }
----------------
We need to ignore debug info here I think.


================
Comment at: lib/Target/AArch64/AArch64InstrInfo.cpp:5106
+unsigned
+AArch64InstrInfo::reduceLoopCount(MachineBasicBlock &MBB, MachineInstr *IndVar,
+                                  MachineInstr &Cmp,
----------------
Does this implementation satisfy the interface? According to TargetInstrInfo::reduceLoopCount, it should generate code to reduce the loop iteration by one.


================
Comment at: lib/Target/AArch64/AArch64InstrInfo.cpp:5114
+    if (I->getOpcode() == AArch64::SUBSXrr) {
+      CompMI = &*I;
+    }
----------------
Couldn't we stop after we found the SUBSXrr closest to the terminator?


https://reviews.llvm.org/D47943





More information about the llvm-commits mailing list