[llvm-branch-commits] [llvm] 331c28f - [ARM] Declare Op within an if statement (NFC)

Kazu Hirata via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Dec 30 17:50:37 PST 2020


Author: Kazu Hirata
Date: 2020-12-30T17:45:36-08:00
New Revision: 331c28f60dbbb09136c2e86e8a4ed8d066f2d271

URL: https://github.com/llvm/llvm-project/commit/331c28f60dbbb09136c2e86e8a4ed8d066f2d271
DIFF: https://github.com/llvm/llvm-project/commit/331c28f60dbbb09136c2e86e8a4ed8d066f2d271.diff

LOG: [ARM] Declare Op within an if statement (NFC)

Added: 
    

Modified: 
    llvm/lib/Target/ARM/MVEGatherScatterLowering.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/ARM/MVEGatherScatterLowering.cpp b/llvm/lib/Target/ARM/MVEGatherScatterLowering.cpp
index f36b34115703..b33e98e8f1ca 100644
--- a/llvm/lib/Target/ARM/MVEGatherScatterLowering.cpp
+++ b/llvm/lib/Target/ARM/MVEGatherScatterLowering.cpp
@@ -939,11 +939,10 @@ bool MVEGatherScatterLowering::optimiseOffsets(Value *Offsets, BasicBlock *BB,
     return false;
 
   // The phi must be an induction variable
-  Instruction *Op;
   int IncrementingBlock = -1;
 
   for (int i = 0; i < 2; i++)
-    if ((Op = dyn_cast<Instruction>(Phi->getIncomingValue(i))) != nullptr)
+    if (auto *Op = dyn_cast<Instruction>(Phi->getIncomingValue(i)))
       if (Op->getOpcode() == Instruction::Add &&
           (Op->getOperand(0) == Phi || Op->getOperand(1) == Phi))
         IncrementingBlock = i;


        


More information about the llvm-branch-commits mailing list