From: Saleem Abdulrasool Date: Sun, 9 Aug 2015 20:39:09 +0000 (+0000) Subject: X86: remove a dead store (NFC) X-Git-Tag: studio-1.4~499 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6bc5ed3e7a0912a68001decafb8bc47b598b7c0c;p=platform%2Fupstream%2Fllvm.git 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. llvm-svn: 244423 --- diff --git a/llvm/lib/Target/X86/X86CallFrameOptimization.cpp b/llvm/lib/Target/X86/X86CallFrameOptimization.cpp index a7e4ad9..4fdb896 100644 --- a/llvm/lib/Target/X86/X86CallFrameOptimization.cpp +++ b/llvm/lib/Target/X86/X86CallFrameOptimization.cpp @@ -304,7 +304,6 @@ void X86CallFrameOptimization::collectCallInfo(MachineFunction &MF, // transformation. const X86RegisterInfo &RegInfo = *static_cast( 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::collectCallInfo(MachineFunction &MF, 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