[llvm-commits] CVS: llvm/lib/Target/PowerPC/PPC32ISelPattern.cpp
Chris Lattner
lattner at cs.uiuc.edu
Tue Jul 5 12:59:06 PDT 2005
Changes in directory llvm/lib/Target/PowerPC:
PPC32ISelPattern.cpp updated: 1.96 -> 1.97
---
Log message:
Make several cleanups to Andrews varargs change:
1. Pass Value*'s into lowering methods so that the proper pointers can be
added to load/stores from the valist
2. Intrinsics that return void should only return a token chain, not a token
chain/retval pair.
3. Rename LowerVAArgNext -> LowerVAArg, because VANext is long gone.
4. Now that we have Value*'s available in the lowering methods, pass them
into any load/stores from the valist that are emitted
---
Diffs of the changes: (+17 -19)
PPC32ISelPattern.cpp | 36 +++++++++++++++++-------------------
1 files changed, 17 insertions(+), 19 deletions(-)
Index: llvm/lib/Target/PowerPC/PPC32ISelPattern.cpp
diff -u llvm/lib/Target/PowerPC/PPC32ISelPattern.cpp:1.96 llvm/lib/Target/PowerPC/PPC32ISelPattern.cpp:1.97
--- llvm/lib/Target/PowerPC/PPC32ISelPattern.cpp:1.96 Tue Jul 5 12:48:31 2005
+++ llvm/lib/Target/PowerPC/PPC32ISelPattern.cpp Tue Jul 5 14:58:53 2005
@@ -97,13 +97,13 @@
bool isTailCall, SDOperand Callee, ArgListTy &Args,
SelectionDAG &DAG);
- virtual std::pair<SDOperand, SDOperand>
- LowerVAStart(SDOperand Chain, SelectionDAG &DAG, SDOperand Dest);
-
+ virtual SDOperand LowerVAStart(SDOperand Chain, SDOperand VAListP,
+ Value *VAListV, SelectionDAG &DAG);
+
virtual std::pair<SDOperand,SDOperand>
- LowerVAArgNext(SDOperand Chain, SDOperand VAList,
- const Type *ArgTy, SelectionDAG &DAG);
-
+ LowerVAArg(SDOperand Chain, SDOperand VAListP, Value *VAListV,
+ const Type *ArgTy, SelectionDAG &DAG);
+
virtual std::pair<SDOperand, SDOperand>
LowerFrameReturnAddress(bool isFrameAddr, SDOperand Chain, unsigned Depth,
SelectionDAG &DAG);
@@ -463,26 +463,24 @@
return std::make_pair(TheCall, Chain);
}
-std::pair<SDOperand, SDOperand>
-PPC32TargetLowering::LowerVAStart(SDOperand Chain, SelectionDAG &DAG,
- SDOperand Dest) {
+SDOperand PPC32TargetLowering::LowerVAStart(SDOperand Chain, SDOperand VAListP,
+ Value *VAListV, SelectionDAG &DAG) {
// vastart just stores the address of the VarArgsFrameIndex slot into the
// memory location argument.
SDOperand FR = DAG.getFrameIndex(VarArgsFrameIndex, MVT::i32);
- SDOperand Result = DAG.getNode(ISD::STORE, MVT::Other, Chain, FR, Dest,
- DAG.getSrcValue(NULL));
- return std::make_pair(Result, Result);
+ return DAG.getNode(ISD::STORE, MVT::Other, Chain, FR, VAListP,
+ DAG.getSrcValue(VAListV));
}
-std::pair<SDOperand,SDOperand> PPC32TargetLowering::
-LowerVAArgNext(SDOperand Chain, SDOperand VAArgOp,
- const Type *ArgTy, SelectionDAG &DAG) {
+std::pair<SDOperand,SDOperand>
+PPC32TargetLowering::LowerVAArg(SDOperand Chain,
+ SDOperand VAListP, Value *VAListV,
+ const Type *ArgTy, SelectionDAG &DAG) {
MVT::ValueType ArgVT = getValueType(ArgTy);
SDOperand VAList =
- DAG.getLoad(MVT::i32, Chain, VAArgOp, DAG.getSrcValue(NULL));
- SDOperand Result = DAG.getLoad(ArgVT, VAList.getValue(1), VAList,
- DAG.getSrcValue(NULL));
+ DAG.getLoad(MVT::i32, Chain, VAListP, DAG.getSrcValue(VAListV));
+ SDOperand Result = DAG.getLoad(ArgVT, Chain, VAList, DAG.getSrcValue(NULL));
unsigned Amt;
if (ArgVT == MVT::i32 || ArgVT == MVT::f32)
Amt = 4;
@@ -494,7 +492,7 @@
VAList = DAG.getNode(ISD::ADD, VAList.getValueType(), VAList,
DAG.getConstant(Amt, VAList.getValueType()));
Chain = DAG.getNode(ISD::STORE, MVT::Other, Chain,
- VAList, VAArgOp, DAG.getSrcValue(NULL));
+ VAList, VAListP, DAG.getSrcValue(VAListV));
return std::make_pair(Result, Chain);
}
More information about the llvm-commits
mailing list