[PATCH] D102269: [ARM] Expand predecessor search to multiple blocks when reverting WhileLoopStarts

Sjoerd Meijer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 13 01:27:38 PDT 2021


SjoerdMeijer added inline comments.


================
Comment at: llvm/lib/Target/ARM/MVETPAndVPTOptimisationsPass.cpp:269
+MachineInstr *
+MVETPAndVPTOptimisations::CheckForLRUseInPreheader(MachineBasicBlock *PreHeader,
+                                                   MachineInstr *LoopStart) {
----------------
Bikeshedding names: `CheckForLRUseInPreheader`.  I thought the clue was that we not only search the Preheader. So perhaps this should be something like `CheckForLRUseInPredecessors`?


================
Comment at: llvm/lib/Target/ARM/MVETPAndVPTOptimisationsPass.cpp:282
+    for (MachineInstr &MI : *MBB) {
+      if (IsInvalidTPInstruction(MI)) {
+        LLVM_DEBUG(dbgs() << "Found LR use in preheader, reverting: " << MI);
----------------
Nit, instead of the big if, an early exit/continue?

  if (!IsInvalidTPInstruction(MI))
    continue;


================
Comment at: llvm/test/CodeGen/Thumb2/LowOverheadLoops/memcall.ll:279
 
+define void @test_memset_preheader(i8* %x, i8* %y, i32 %n) {
+; CHECK-LABEL: test_memset_preheader:
----------------
would it be good to have a MIR test for this too?


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

https://reviews.llvm.org/D102269



More information about the llvm-commits mailing list