For PR1028:
authorReid Spencer <rspencer@reidspencer.com>
Wed, 17 Jan 2007 23:33:20 +0000 (23:33 +0000)
committerReid Spencer <rspencer@reidspencer.com>
Wed, 17 Jan 2007 23:33:20 +0000 (23:33 +0000)
Add the llvm.stacksave and llvm.stackrestore intrinsics that correspond
to the GCC builtins __builtin_stack_save and __builtin_stack_restore. This
allows the CBE to execute these builtins, and fixes:

   test/CodeGen/CBackend/2007-01-17-StackSaveNRestore.ll
   External/SPEC/CINT2000/176.gcc (CBE)

Patch by Gordon Henriksen.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33313 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Intrinsics.td

index 6bcbd6895fd7ac0ee1540af0b5c236d36ce3de0d..3fc55f79da6127a0432c2f2834fd31200b39efd2 100644 (file)
@@ -138,8 +138,10 @@ def int_gcwrite : Intrinsic<[llvm_void_ty, llvm_ptr_ty, llvm_ptr_ty,
 //  
 def int_returnaddress : Intrinsic<[llvm_ptr_ty, llvm_i32_ty], [IntrNoMem]>;
 def int_frameaddress  : Intrinsic<[llvm_ptr_ty, llvm_i32_ty], [IntrNoMem]>;
-def int_stacksave     : Intrinsic<[llvm_ptr_ty], [IntrReadMem]>;
-def int_stackrestore  : Intrinsic<[llvm_void_ty, llvm_ptr_ty]>;
+def int_stacksave     : Intrinsic<[llvm_ptr_ty], [IntrReadMem]>,
+                        GCCBuiltin<"__builtin_stack_save">;
+def int_stackrestore  : Intrinsic<[llvm_void_ty, llvm_ptr_ty]>,
+                        GCCBuiltin<"__builtin_stack_restore">;
 def int_prefetch      : Intrinsic<[llvm_void_ty, llvm_ptr_ty, 
                                    llvm_i32_ty, llvm_i32_ty]>;
 def int_pcmarker      : Intrinsic<[llvm_void_ty, llvm_i32_ty]>;