[llvm] 43e500d - [AArch64] Minor AArch64MIPeepholeOpt cleanup. NFC

David Green via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 28 11:10:05 PST 2021


Author: David Green
Date: 2021-12-28T19:10:01Z
New Revision: 43e500d79198d761ca76d8587cca76da8de967f8

URL: https://github.com/llvm/llvm-project/commit/43e500d79198d761ca76d8587cca76da8de967f8
DIFF: https://github.com/llvm/llvm-project/commit/43e500d79198d761ca76d8587cca76da8de967f8.diff

LOG: [AArch64] Minor AArch64MIPeepholeOpt cleanup. NFC

We should always be in SSA form when running the pass, so turn a check
into an assert.

Added: 
    

Modified: 
    llvm/lib/Target/AArch64/AArch64MIPeepholeOpt.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/AArch64/AArch64MIPeepholeOpt.cpp b/llvm/lib/Target/AArch64/AArch64MIPeepholeOpt.cpp
index 42db18332f1c..3e1306eb3297 100644
--- a/llvm/lib/Target/AArch64/AArch64MIPeepholeOpt.cpp
+++ b/llvm/lib/Target/AArch64/AArch64MIPeepholeOpt.cpp
@@ -246,7 +246,7 @@ bool AArch64MIPeepholeOpt::visitORR(
   MI.getOperand(0).setReg(DefReg);
   ToBeRemoved.insert(&MI);
 
-  LLVM_DEBUG({ dbgs() << "Removed: " << MI << "\n"; });
+  LLVM_DEBUG(dbgs() << "Removed: " << MI << "\n");
 
   return true;
 }
@@ -259,8 +259,7 @@ bool AArch64MIPeepholeOpt::runOnMachineFunction(MachineFunction &MF) {
   MLI = &getAnalysis<MachineLoopInfo>();
   MRI = &MF.getRegInfo();
 
-  if (!MRI->isSSA())
-    return false;
+  assert (MRI->isSSA() && "Expected to be run on SSA form!");
 
   bool Changed = false;
   SmallSetVector<MachineInstr *, 8> ToBeRemoved;
@@ -278,6 +277,7 @@ bool AArch64MIPeepholeOpt::runOnMachineFunction(MachineFunction &MF) {
         break;
       case AArch64::ORRWrs:
         Changed = visitORR(MI, ToBeRemoved);
+        break;
       }
     }
   }


        


More information about the llvm-commits mailing list