[PATCH] D71007: [ARM][LowOverheadLoops] Remove dead loop update instructions

Sam Parker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 9 02:39:40 PST 2019


samparker added inline comments.


================
Comment at: llvm/lib/Target/ARM/ARMLowOverheadLoops.cpp:678
+  // 4. And also analyse the uses before this Def in this loop block.
+  if (auto *Use = RDA->getInstWithUseBefore(Def, ElemCount)) {
+    LLVM_DEBUG(dbgs() << "ARM Loops: Found a use: "; Use->dump());
----------------
I'm not sure this is doing what you want.. wouldn't the vctp likely be a use before def..? We should also be checking that the Def isn't defining cpsr, and if it is, that the def is dead.


================
Comment at: llvm/lib/Target/ARM/ARMLowOverheadLoops.cpp:757
   } else {
+    assert(LoLoop.ML->getNumBlocks() == 1 && "Single block loop expected");
     LoLoop.Start = ExpandLoopStart(LoLoop);
----------------
This should be in your new function, I don't think there's anything stopping us from generating a normal low-overhead loop with multiple blocks.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D71007/new/

https://reviews.llvm.org/D71007





More information about the llvm-commits mailing list