[llvm] 815e8b5 - [Hexagon] Remove an extraneous variable (NFC)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Sat Nov 6 13:08:40 PDT 2021


Author: Kazu Hirata
Date: 2021-11-06T13:08:23-07:00
New Revision: 815e8b5a2022ac6b0bfe4ab278a0d0b14dd348c1

URL: https://github.com/llvm/llvm-project/commit/815e8b5a2022ac6b0bfe4ab278a0d0b14dd348c1
DIFF: https://github.com/llvm/llvm-project/commit/815e8b5a2022ac6b0bfe4ab278a0d0b14dd348c1.diff

LOG: [Hexagon] Remove an extraneous variable (NFC)

Added: 
    

Modified: 
    llvm/lib/Target/Hexagon/HexagonFrameLowering.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/Hexagon/HexagonFrameLowering.cpp b/llvm/lib/Target/Hexagon/HexagonFrameLowering.cpp
index c824bac30833..1c40e7d7eefa 100644
--- a/llvm/lib/Target/Hexagon/HexagonFrameLowering.cpp
+++ b/llvm/lib/Target/Hexagon/HexagonFrameLowering.cpp
@@ -281,11 +281,10 @@ static unsigned getMaxCalleeSavedReg(ArrayRef<CalleeSavedInfo> CSI,
 /// frame to be already in place.
 static bool needsStackFrame(const MachineBasicBlock &MBB, const BitVector &CSR,
                             const HexagonRegisterInfo &HRI) {
-    for (auto &I : MBB) {
-      const MachineInstr *MI = &I;
-      if (MI->isCall())
+    for (const MachineInstr &MI : MBB) {
+      if (MI.isCall())
         return true;
-      unsigned Opc = MI->getOpcode();
+      unsigned Opc = MI.getOpcode();
       switch (Opc) {
         case Hexagon::PS_alloca:
         case Hexagon::PS_aligna:
@@ -294,7 +293,7 @@ static bool needsStackFrame(const MachineBasicBlock &MBB, const BitVector &CSR,
           break;
       }
       // Check individual operands.
-      for (const MachineOperand &MO : MI->operands()) {
+      for (const MachineOperand &MO : MI.operands()) {
         // While the presence of a frame index does not prove that a stack
         // frame will be required, all frame indexes should be within alloc-
         // frame/deallocframe. Otherwise, the code that translates a frame


        


More information about the llvm-commits mailing list