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

Sam Parker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 10 05:53:07 PST 2019


samparker added inline comments.


================
Comment at: llvm/lib/CodeGen/ReachingDefAnalysis.cpp:282
+
+  while (It-- != MI->getParent()->front()) {
+    for (auto &MO : It->operands())
----------------
How about using reverse iterators? Probably would have saved you from the the off-by-one?


================
Comment at: llvm/lib/Target/ARM/ARMLowOverheadLoops.cpp:695
+  // And also analyse the uses before this Def in this loop block.
+  while ((Use = RDA->getInstWithUseBefore(Pos, ElemCount))) {
+    // Ignore the VCTP instruction, this is allowed to use the elem count
----------------
Looks like it would be better to modify the RDA method to provide all the uses. Then we'll have similar functionality to getReachingLocalUses.


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

https://reviews.llvm.org/D71007





More information about the llvm-commits mailing list