diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2014-03-18 19:23:41 +0000 | 
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2014-03-18 19:23:41 +0000 | 
| commit | 4f00c8c645ed203d6be62502f5c477e3aeee720b (patch) | |
| tree | ad1f1a1affa2ca2d4fb6a38d6f7ce0e92b196fd5 /contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | |
| parent | f42ca756b99c73564d3c218a5141d025bda99bc9 (diff) | |
Notes
Diffstat (limited to 'contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp')
| -rw-r--r-- | contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | 14 | 
1 files changed, 10 insertions, 4 deletions
diff --git a/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp index 2b2713d248e5..41662a90469f 100644 --- a/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp +++ b/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp @@ -851,12 +851,20 @@ 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"); -      Ops.push_back(DAG.getRegister(Regs[Reg++], RegisterVT)); +      unsigned TheReg = Regs[Reg++]; +      Ops.push_back(DAG.getRegister(TheReg, RegisterVT)); + +      if (TheReg == SP && Code == InlineAsm::Kind_Clobber) { +        // If we clobbered the stack pointer, MFI should know about it. +        assert(DAG.getMachineFunction().getFrameInfo()-> +            hasInlineAsmWithSPAdjust()); +      }      }    }  } @@ -3370,9 +3378,7 @@ void SelectionDAGBuilder::visitAlloca(const AllocaInst &I) {    setValue(&I, DSA);    DAG.setRoot(DSA.getValue(1)); -  // Inform the Frame Information that we have just allocated a variable-sized -  // object. -  FuncInfo.MF->getFrameInfo()->CreateVariableSizedObject(Align ? Align : 1); +  assert(FuncInfo.MF->getFrameInfo()->hasVarSizedObjects());  }  void SelectionDAGBuilder::visitLoad(const LoadInst &I) {  | 
