[PATCH] D82557: [MSP430][NFC] Remove redundant condition

Balogh, Ádám via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 26 05:56:58 PDT 2020


baloghadamsoftware updated this revision to Diff 273695.
baloghadamsoftware marked 2 inline comments as done.
baloghadamsoftware added a comment.

Misleading comment deleted together with the last commented-out line.


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

https://reviews.llvm.org/D82557

Files:
  llvm/lib/Target/MSP430/MSP430FrameLowering.cpp


Index: llvm/lib/Target/MSP430/MSP430FrameLowering.cpp
===================================================================
--- llvm/lib/Target/MSP430/MSP430FrameLowering.cpp
+++ llvm/lib/Target/MSP430/MSP430FrameLowering.cpp
@@ -86,20 +86,11 @@
     DL = MBBI->getDebugLoc();
 
   if (NumBytes) { // adjust stack pointer: SP -= numbytes
-    // If there is an SUB16ri of SP immediately before this instruction, merge
-    // the two.
-    //NumBytes -= mergeSPUpdates(MBB, MBBI, true);
-    // If there is an ADD16ri or SUB16ri of SP immediately after this
-    // instruction, merge the two instructions.
-    // mergeSPUpdatesDown(MBB, MBBI, &NumBytes);
-
-    if (NumBytes) {
-      MachineInstr *MI =
-        BuildMI(MBB, MBBI, DL, TII.get(MSP430::SUB16ri), MSP430::SP)
-        .addReg(MSP430::SP).addImm(NumBytes);
-      // The SRW implicit def is dead.
-      MI->getOperand(3).setIsDead();
-    }
+    MachineInstr *MI =
+      BuildMI(MBB, MBBI, DL, TII.get(MSP430::SUB16ri), MSP430::SP)
+      .addReg(MSP430::SP).addImm(NumBytes);
+    // The SRW implicit def is dead.
+    MI->getOperand(3).setIsDead();
   }
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D82557.273695.patch
Type: text/x-patch
Size: 1127 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200626/4b4b86e5/attachment.bin>


More information about the llvm-commits mailing list