summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-01-13 02:50:02 +0000
committerChris Lattner <sabre@nondot.org>2006-01-13 02:50:02 +0000
commitb32664583ba409c84dccaee30a11cd1ace95e0ff (patch)
tree8b2a2d35536cebf612c3e7559335027d49152933 /llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
parent8e2f52e64509bd4de74b85f72a62dcf44b740236 (diff)
downloadbcm5719-llvm-b32664583ba409c84dccaee30a11cd1ace95e0ff.tar.gz
bcm5719-llvm-b32664583ba409c84dccaee30a11cd1ace95e0ff.zip
Compile llvm.stacksave/restore into STACKSAVE/STACKRESTORE nodes, and allow
targets to custom expand them as they desire. llvm-svn: 25273
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index 4c594bf1faf..061a3ef8a3e 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -1004,11 +1004,21 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) {
getValue(I.getOperand(1)).getValueType(),
getValue(I.getOperand(1))));
return 0;
- case Intrinsic::stacksave:
- setValue(&I, DAG.getNode(ISD::UNDEF, TLI.getValueType(I.getType())));
- return 0; // FIXME: discard stacksave/restore
+ case Intrinsic::stacksave: {
+ std::vector<MVT::ValueType> VTs;
+ VTs.push_back(TLI.getPointerTy());
+ VTs.push_back(MVT::Other);
+ std::vector<SDOperand> Ops;
+ Ops.push_back(getRoot());
+ SDOperand Tmp = DAG.getNode(ISD::STACKSAVE, VTs, Ops);
+ setValue(&I, Tmp);
+ DAG.setRoot(Tmp.getValue(1));
+ return 0;
+ }
case Intrinsic::stackrestore:
- return 0; // FIXME: discard stacksave/restore
+ DAG.setRoot(DAG.getNode(ISD::STACKRESTORE, MVT::Other, DAG.getRoot(),
+ getValue(I.getOperand(1))));
+ return 0;
case Intrinsic::prefetch:
// FIXME: Currently discarding prefetches.
return 0;
OpenPOWER on IntegriCloud