[llvm] r262143 - AArch64: Use MachineInstr& in guaranteesZeroRegInBlock(), NFC

Duncan P. N. Exon Smith via llvm-commits llvm-commits at lists.llvm.org
Sat Feb 27 11:12:55 PST 2016


Author: dexonsmith
Date: Sat Feb 27 13:12:54 2016
New Revision: 262143

URL: http://llvm.org/viewvc/llvm-project?rev=262143&view=rev
Log:
AArch64: Use MachineInstr& in guaranteesZeroRegInBlock(), NFC

Modified:
    llvm/trunk/lib/Target/AArch64/AArch64RedundantCopyElimination.cpp

Modified: llvm/trunk/lib/Target/AArch64/AArch64RedundantCopyElimination.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64RedundantCopyElimination.cpp?rev=262143&r1=262142&r2=262143&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AArch64/AArch64RedundantCopyElimination.cpp (original)
+++ llvm/trunk/lib/Target/AArch64/AArch64RedundantCopyElimination.cpp Sat Feb 27 13:12:54 2016
@@ -63,15 +63,15 @@ char AArch64RedundantCopyElimination::ID
 INITIALIZE_PASS(AArch64RedundantCopyElimination, "aarch64-copyelim",
                 "AArch64 redundant copy elimination pass", false, false)
 
-static bool guaranteesZeroRegInBlock(MachineInstr *MI, MachineBasicBlock *MBB) {
-  unsigned Opc = MI->getOpcode();
+static bool guaranteesZeroRegInBlock(MachineInstr &MI, MachineBasicBlock *MBB) {
+  unsigned Opc = MI.getOpcode();
   // Check if the current basic block is the target block to which the
   // CBZ/CBNZ instruction jumps when its Wt/Xt is zero.
   if ((Opc == AArch64::CBZW || Opc == AArch64::CBZX) &&
-      MBB == MI->getOperand(1).getMBB())
+      MBB == MI.getOperand(1).getMBB())
     return true;
   else if ((Opc == AArch64::CBNZW || Opc == AArch64::CBNZX) &&
-           MBB != MI->getOperand(1).getMBB())
+           MBB != MI.getOperand(1).getMBB())
     return true;
 
   return false;
@@ -90,12 +90,12 @@ bool AArch64RedundantCopyElimination::op
   ++CompBr;
   do {
     --CompBr;
-    if (guaranteesZeroRegInBlock(CompBr, MBB))
+    if (guaranteesZeroRegInBlock(*CompBr, MBB))
       break;
   } while (CompBr != PredMBB->begin() && CompBr->isTerminator());
 
   // We've not found a CBZ/CBNZ, time to bail out.
-  if (!guaranteesZeroRegInBlock(CompBr, MBB))
+  if (!guaranteesZeroRegInBlock(*CompBr, MBB))
     return false;
 
   unsigned TargetReg = CompBr->getOperand(0).getReg();




More information about the llvm-commits mailing list