[llvm-commits] CVS: llvm/lib/Target/X86/X86ISelLowering.cpp X86InstrInfo.td
Chris Lattner
lattner at cs.uiuc.edu
Mon Jan 23 21:17:24 PST 2006
Changes in directory llvm/lib/Target/X86:
X86ISelLowering.cpp updated: 1.52 -> 1.53
X86InstrInfo.td updated: 1.216 -> 1.217
---
Log message:
Emit the copies out of call return registers *after* the ISD::CALLSEQ_END
node, fixing fastcc and the case where a function has a frame pointer due
to dynamic allocas.
---
Diffs of the changes: (+23 -7)
X86ISelLowering.cpp | 28 ++++++++++++++++++++++------
X86InstrInfo.td | 2 +-
2 files changed, 23 insertions(+), 7 deletions(-)
Index: llvm/lib/Target/X86/X86ISelLowering.cpp
diff -u llvm/lib/Target/X86/X86ISelLowering.cpp:1.52 llvm/lib/Target/X86/X86ISelLowering.cpp:1.53
--- llvm/lib/Target/X86/X86ISelLowering.cpp:1.52 Fri Jan 20 12:41:25 2006
+++ llvm/lib/Target/X86/X86ISelLowering.cpp Mon Jan 23 23:17:12 2006
@@ -521,6 +521,17 @@
Chain = DAG.getNode(X86ISD::CALL, NodeTys, Ops);
SDOperand InFlag = Chain.getValue(1);
+ NodeTys.clear();
+ NodeTys.push_back(MVT::Other); // Returns a chain
+ NodeTys.push_back(MVT::Flag); // Returns a flag for retval copy to use.
+ Ops.clear();
+ Ops.push_back(Chain);
+ Ops.push_back(DAG.getConstant(NumBytes, getPointerTy()));
+ Ops.push_back(DAG.getConstant(0, getPointerTy()));
+ Ops.push_back(InFlag);
+ Chain = DAG.getNode(ISD::CALLSEQ_END, NodeTys, Ops);
+ InFlag = Chain.getValue(1);
+
SDOperand RetVal;
if (RetTyVT != MVT::isVoid) {
switch (RetTyVT) {
@@ -591,9 +602,6 @@
}
}
- Chain = DAG.getNode(ISD::CALLSEQ_END, MVT::Other, Chain,
- DAG.getConstant(NumBytes, getPointerTy()),
- DAG.getConstant(0, getPointerTy()));
return std::make_pair(RetVal, Chain);
} else {
std::vector<SDOperand> Ops;
@@ -1049,6 +1057,17 @@
Chain = DAG.getNode(X86ISD::CALL, NodeTys, Ops);
InFlag = Chain.getValue(1);
+ NodeTys.clear();
+ NodeTys.push_back(MVT::Other); // Returns a chain
+ NodeTys.push_back(MVT::Flag); // Returns a flag for retval copy to use.
+ Ops.clear();
+ Ops.push_back(Chain);
+ Ops.push_back(DAG.getConstant(ArgOffset, getPointerTy()));
+ Ops.push_back(DAG.getConstant(ArgOffset, getPointerTy()));
+ Ops.push_back(InFlag);
+ Chain = DAG.getNode(ISD::CALLSEQ_END, NodeTys, Ops);
+ InFlag = Chain.getValue(1);
+
SDOperand RetVal;
if (RetTyVT != MVT::isVoid) {
switch (RetTyVT) {
@@ -1119,9 +1138,6 @@
}
}
- Chain = DAG.getNode(ISD::CALLSEQ_END, MVT::Other, Chain,
- DAG.getConstant(ArgOffset, getPointerTy()),
- DAG.getConstant(ArgOffset, getPointerTy()));
return std::make_pair(RetVal, Chain);
} else {
std::vector<SDOperand> Ops;
Index: llvm/lib/Target/X86/X86InstrInfo.td
diff -u llvm/lib/Target/X86/X86InstrInfo.td:1.216 llvm/lib/Target/X86/X86InstrInfo.td:1.217
--- llvm/lib/Target/X86/X86InstrInfo.td:1.216 Fri Jan 20 20:55:41 2006
+++ llvm/lib/Target/X86/X86InstrInfo.td Mon Jan 23 23:17:12 2006
@@ -88,7 +88,7 @@
[SDNPHasChain]>;
def X86callseq_end :
SDNode<"ISD::CALLSEQ_END", SDT_X86CallSeqEnd,
- [SDNPHasChain]>;
+ [SDNPHasChain, SDNPInFlag, SDNPOutFlag]>;
def X86call : SDNode<"X86ISD::CALL", SDT_X86Call,
[SDNPHasChain, SDNPOutFlag, SDNPOptInFlag]>;
More information about the llvm-commits
mailing list