diff options
author | Reid Kleckner <reid@kleckner.net> | 2013-12-10 05:31:27 +0000 |
---|---|---|
committer | Reid Kleckner <reid@kleckner.net> | 2013-12-10 05:31:27 +0000 |
commit | 0a9509f0806b803be1693fef246b3a825d3721c7 (patch) | |
tree | ee0249862532b9fed79ce55dc5be61b1ee431e1c /llvm/lib/CodeGen/SelectionDAG | |
parent | 2f47acfd6a3a17c7d0d0c5b5007bdac5a55e31e8 (diff) | |
download | bcm5719-llvm-0a9509f0806b803be1693fef246b3a825d3721c7.tar.gz bcm5719-llvm-0a9509f0806b803be1693fef246b3a825d3721c7.zip |
Revert "Fix miscompile of MS inline assembly with stack realignment"
This reverts commit r196876. Its tests failed on the bots, so I'll
figure it out tomorrow.
llvm-svn: 196879
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | 10 | ||||
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 10 |
2 files changed, 5 insertions, 15 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp index b3cbd918386..34b7df59acd 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp @@ -851,20 +851,12 @@ void RegsForValue::AddInlineAsmOperands(unsigned Code, bool HasMatching, SDValue Res = DAG.getTargetConstant(Flag, MVT::i32); Ops.push_back(Res); - unsigned SP = TLI.getStackPointerRegisterToSaveRestore(); for (unsigned Value = 0, Reg = 0, e = ValueVTs.size(); Value != e; ++Value) { unsigned NumRegs = TLI.getNumRegisters(*DAG.getContext(), ValueVTs[Value]); MVT RegisterVT = RegVTs[Value]; for (unsigned i = 0; i != NumRegs; ++i) { assert(Reg < Regs.size() && "Mismatch in # registers expected"); - unsigned TheReg = Regs[Reg++]; - Ops.push_back(DAG.getRegister(TheReg, RegisterVT)); - - // Notice if we clobbered the stack pointer. Yes, inline asm can do this. - if (TheReg == SP && Code == InlineAsm::Kind_Clobber) { - MachineFrameInfo *MFI = DAG.getMachineFunction().getFrameInfo(); - MFI->setHasInlineAsmWithSPAdjust(true); - } + Ops.push_back(DAG.getRegister(Regs[Reg++], RegisterVT)); } } } diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index 506b7380515..6c335d96c73 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -428,9 +428,7 @@ bool SelectionDAGISel::runOnMachineFunction(MachineFunction &mf) { SDB->init(GFI, *AA, LibInfo); - MF->setHasInlineAsm(false); - MF->getFrameInfo()->setHasInlineAsmWithSPAdjust(false); - + MF->setHasMSInlineAsm(false); SelectAllBasicBlocks(Fn); // If the first basic block in the function has live ins that need to be @@ -514,7 +512,7 @@ bool SelectionDAGISel::runOnMachineFunction(MachineFunction &mf) { for (MachineFunction::const_iterator I = MF->begin(), E = MF->end(); I != E; ++I) { - if (MFI->hasCalls() && MF->hasInlineAsm()) + if (MFI->hasCalls() && MF->hasMSInlineAsm()) break; const MachineBasicBlock *MBB = I; @@ -525,8 +523,8 @@ bool SelectionDAGISel::runOnMachineFunction(MachineFunction &mf) { II->isStackAligningInlineAsm()) { MFI->setHasCalls(true); } - if (II->isInlineAsm()) { - MF->setHasInlineAsm(true); + if (II->isMSInlineAsm()) { + MF->setHasMSInlineAsm(true); } } } |