[llvm] r244423 - X86: remove a dead store (NFC)

Saleem Abdulrasool via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 9 13:39:09 PDT 2015


Author: compnerd
Date: Sun Aug  9 15:39:09 2015
New Revision: 244423

URL: http://llvm.org/viewvc/llvm-project?rev=244423&view=rev
Log:
X86: remove a dead store (NFC)

The SP was always unconditionally assigned to later, but initialised early.
This delays the initialisation, and avoids the dead store.  Identified by
clang static analysis.  No functional change intended.

Modified:
    llvm/trunk/lib/Target/X86/X86CallFrameOptimization.cpp

Modified: llvm/trunk/lib/Target/X86/X86CallFrameOptimization.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86CallFrameOptimization.cpp?rev=244423&r1=244422&r2=244423&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86CallFrameOptimization.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86CallFrameOptimization.cpp Sun Aug  9 15:39:09 2015
@@ -304,7 +304,6 @@ void X86CallFrameOptimization::collectCa
   // transformation.
   const X86RegisterInfo &RegInfo = *static_cast<const X86RegisterInfo *>(
                                        MF.getSubtarget().getRegisterInfo());
-  unsigned StackPtr = RegInfo.getStackRegister();
   unsigned FrameDestroyOpcode = TII->getCallFrameDestroyOpcode();
 
   // We expect to enter this at the beginning of a call sequence
@@ -334,7 +333,8 @@ void X86CallFrameOptimization::collectCa
   if (!I->isCopy() || !I->getOperand(0).isReg())
     return;
   Context.SPCopy = I++;
-  StackPtr = Context.SPCopy->getOperand(0).getReg();
+
+  unsigned StackPtr = Context.SPCopy->getOperand(0).getReg();
 
   // Scan the call setup sequence for the pattern we're looking for.
   // We only handle a simple case - a sequence of MOV32mi or MOV32mr




More information about the llvm-commits mailing list