diff options
author | Bill Wendling <isanbard@gmail.com> | 2013-12-09 08:55:55 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2013-12-09 08:55:55 +0000 |
commit | 571a02f291b051b22d804f90257e2623cbacd7ec (patch) | |
tree | c31b9ba66994f22384edb526bb04de0475593eeb | |
parent | b73a4ab9d63e55afb4cc7300f973f38280343de4 (diff) | |
download | external_llvm-571a02f291b051b22d804f90257e2623cbacd7ec.zip external_llvm-571a02f291b051b22d804f90257e2623cbacd7ec.tar.gz external_llvm-571a02f291b051b22d804f90257e2623cbacd7ec.tar.bz2 |
Merging r196755:
------------------------------------------------------------------------
r196755 | venkatra | 2013-12-08 21:13:25 -0800 (Sun, 08 Dec 2013) | 2 lines
[SPARCV9]: Adjust the resultant pointer of DYNAMIC_STACKALLOC with the stack BIAS on sparcV9.
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_34@196764 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/Sparc/SparcISelLowering.cpp | 8 | ||||
-rw-r--r-- | test/CodeGen/SPARC/2013-05-17-CallFrame.ll | 2 |
2 files changed, 6 insertions, 4 deletions
diff --git a/lib/Target/Sparc/SparcISelLowering.cpp b/lib/Target/Sparc/SparcISelLowering.cpp index 1b56757..c01b00e 100644 --- a/lib/Target/Sparc/SparcISelLowering.cpp +++ b/lib/Target/Sparc/SparcISelLowering.cpp @@ -2298,7 +2298,7 @@ static SDValue LowerVAARG(SDValue Op, SelectionDAG &DAG) { } static SDValue LowerDYNAMIC_STACKALLOC(SDValue Op, SelectionDAG &DAG, - bool is64Bit) { + const SparcSubtarget *Subtarget) { SDValue Chain = Op.getOperand(0); // Legalize the chain. SDValue Size = Op.getOperand(1); // Legalize the size. EVT VT = Size->getValueType(0); @@ -2311,7 +2311,9 @@ static SDValue LowerDYNAMIC_STACKALLOC(SDValue Op, SelectionDAG &DAG, // The resultant pointer is actually 16 words from the bottom of the stack, // to provide a register spill area. - unsigned regSpillArea = (is64Bit) ? 128 : 96; + unsigned regSpillArea = Subtarget->is64Bit() ? 128 : 96; + regSpillArea += Subtarget->getStackPointerBias(); + SDValue NewVal = DAG.getNode(ISD::ADD, dl, VT, NewSP, DAG.getConstant(regSpillArea, VT)); SDValue Ops[2] = { NewVal, Chain }; @@ -2638,7 +2640,7 @@ LowerOperation(SDValue Op, SelectionDAG &DAG) const { case ISD::VASTART: return LowerVASTART(Op, DAG, *this); case ISD::VAARG: return LowerVAARG(Op, DAG); case ISD::DYNAMIC_STACKALLOC: return LowerDYNAMIC_STACKALLOC(Op, DAG, - is64Bit); + Subtarget); case ISD::LOAD: return LowerF128Load(Op, DAG); case ISD::STORE: return LowerF128Store(Op, DAG); diff --git a/test/CodeGen/SPARC/2013-05-17-CallFrame.ll b/test/CodeGen/SPARC/2013-05-17-CallFrame.ll index 9c74aa0..81f586f 100644 --- a/test/CodeGen/SPARC/2013-05-17-CallFrame.ll +++ b/test/CodeGen/SPARC/2013-05-17-CallFrame.ll @@ -10,7 +10,7 @@ ; SPARC64-LABEL: variable_alloca_with_adj_call_stack ; SPARC64: save %sp, -128, %sp -; SPARC64: add {{.+}}, 128, %o0 +; SPARC64: add {{.+}}, 2175, %o0 ; SPARC64: add %sp, -80, %sp ; SPARC64: call foo ; SPARC64: add %sp, 80, %sp |