[PATCH] D15459: [WebAssembly] Fix ADJCALLSTACKDOWN/UP use/defs
Derek Schuff via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 11 10:58:39 PST 2015
This revision was automatically updated to reflect the committed changes.
Closed by commit rL255356: [WebAssembly] Fix ADJCALLSTACKDOWN/UP use/defs (authored by dschuff).
Changed prior to commit:
http://reviews.llvm.org/D15459?vs=42545&id=42546#toc
Repository:
rL LLVM
http://reviews.llvm.org/D15459
Files:
llvm/trunk/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
llvm/trunk/lib/Target/WebAssembly/WebAssemblyInstrCall.td
Index: llvm/trunk/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
===================================================================
--- llvm/trunk/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
+++ llvm/trunk/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
@@ -359,8 +359,11 @@
unsigned NumBytes = CCInfo.getAlignedCallFrameSize();
- auto NB = DAG.getConstant(NumBytes, DL, PtrVT, true);
- Chain = DAG.getCALLSEQ_START(Chain, NB, DL);
+ SDValue NB;
+ if (NumBytes) {
+ NB = DAG.getConstant(NumBytes, DL, PtrVT, true);
+ Chain = DAG.getCALLSEQ_START(Chain, NB, DL);
+ }
if (IsVarArg) {
// For non-fixed arguments, next emit stores to store the argument values
@@ -420,8 +423,10 @@
Chain = Res.getValue(1);
}
- SDValue Unused = DAG.getUNDEF(PtrVT);
- Chain = DAG.getCALLSEQ_END(Chain, NB, Unused, SDValue(), DL);
+ if (NumBytes) {
+ SDValue Unused = DAG.getUNDEF(PtrVT);
+ Chain = DAG.getCALLSEQ_END(Chain, NB, Unused, SDValue(), DL);
+ }
return Chain;
}
Index: llvm/trunk/lib/Target/WebAssembly/WebAssemblyInstrCall.td
===================================================================
--- llvm/trunk/lib/Target/WebAssembly/WebAssemblyInstrCall.td
+++ llvm/trunk/lib/Target/WebAssembly/WebAssemblyInstrCall.td
@@ -18,7 +18,7 @@
// Call sequence markers. These have an immediate which represents the amount of
// stack space to allocate or free, which is used for varargs lowering.
-let isCodeGenOnly = 1 in {
+let Uses = [SP32, SP64], Defs = [SP32, SP64], isCodeGenOnly = 1 in {
def ADJCALLSTACKDOWN : I<(outs), (ins i32imm:$amt),
[(WebAssemblycallseq_start timm:$amt)]>;
def ADJCALLSTACKUP : I<(outs), (ins i32imm:$amt),
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D15459.42546.patch
Type: text/x-patch
Size: 1720 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151211/46c443be/attachment.bin>
More information about the llvm-commits
mailing list