aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2010-05-27 18:52:11 +0000
committerJim Grosbach <grosbach@apple.com>2010-05-27 18:52:11 +0000
commit92eafd90273fe162d82b1927d2c237f6b5e0ce64 (patch)
tree27c54bdc80bc2986f60278f2e216695387ca3c4b
parent41a10c344aa0d0ccec8fac148ebf41c5fbd36450 (diff)
downloadexternal_llvm-92eafd90273fe162d82b1927d2c237f6b5e0ce64.zip
external_llvm-92eafd90273fe162d82b1927d2c237f6b5e0ce64.tar.gz
external_llvm-92eafd90273fe162d82b1927d2c237f6b5e0ce64.tar.bz2
hook ISD::STACKADDR to an intrinsic
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104869 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/Intrinsics.td5
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp4
2 files changed, 7 insertions, 2 deletions
diff --git a/include/llvm/Intrinsics.td b/include/llvm/Intrinsics.td
index 444f514..42c16c3 100644
--- a/include/llvm/Intrinsics.td
+++ b/include/llvm/Intrinsics.td
@@ -197,12 +197,13 @@ def int_gcwrite : Intrinsic<[],
def int_returnaddress : Intrinsic<[llvm_ptr_ty], [llvm_i32_ty], [IntrNoMem]>;
def int_frameaddress : Intrinsic<[llvm_ptr_ty], [llvm_i32_ty], [IntrNoMem]>;
-// Note: we treat stacksave/stackrestore as writemem because we don't otherwise
-// model their dependencies on allocas.
+// Note: we treat stacksave/stackrestore and stackaddr as writemem because we
+// don't otherwise model their dependencies on allocas.
def int_stacksave : Intrinsic<[llvm_ptr_ty]>,
GCCBuiltin<"__builtin_stack_save">;
def int_stackrestore : Intrinsic<[], [llvm_ptr_ty]>,
GCCBuiltin<"__builtin_stack_restore">;
+def int_stackaddress : Intrinsic<[llvm_ptr_ty], []>;
// IntrWriteArgMem is more pessimistic than strictly necessary for prefetch,
// however it does conveniently prevent the prefetch from being reordered
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
index fbe601f..a0cd232 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -3756,6 +3756,10 @@ SelectionDAGBuilder::visitIntrinsicCall(const CallInst &I, unsigned Intrinsic) {
setValue(&I, DAG.getNode(ISD::FRAMEADDR, dl, TLI.getPointerTy(),
getValue(I.getOperand(1))));
return 0;
+ case Intrinsic::stackaddress:
+ setValue(&I, DAG.getNode(ISD::STACKADDR, dl, TLI.getPointerTy(), getRoot(),
+ getValue(I.getOperand(1))));
+ return 0;
case Intrinsic::setjmp:
return "_setjmp"+!TLI.usesUnderscoreSetJmp();
case Intrinsic::longjmp: