Removing the HasBuiltinSetjmp flag and associated bits. Flagging the presence
authorJim Grosbach <grosbach@apple.com>
Wed, 13 May 2009 23:50:53 +0000 (23:50 +0000)
committerJim Grosbach <grosbach@apple.com>
Wed, 13 May 2009 23:50:53 +0000 (23:50 +0000)
of exception handling builtin sjlj targets in functions turns out not to
be necessary. Marking the intrinsic implementation in the .td file as
defining all registers is sufficient to get the context saved properly by
the containing function.

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

include/llvm/CodeGen/MachineFunction.h
lib/CodeGen/MachineFunction.cpp
lib/CodeGen/PrologEpilogInserter.cpp
lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp

index 469ae026f01621df4dbe9b619d8bc703ee445f21..a110e5846ac90b781245e12b986f72c27d250007 100644 (file)
@@ -70,10 +70,6 @@ class MachineFunction : private Annotation {
   const Function *Fn;
   const TargetMachine &Target;
 
-  // HasBuiltinSetjmp - true if the function uses builtin_setjmp. Used to
-  // adjust callee-saved register tracking.
-  bool HasBuiltinSetjmp;
-
   // RegInfo - Information about each register in use in the function.
   MachineRegisterInfo *RegInfo;
 
@@ -127,14 +123,6 @@ public:
   ///
   const TargetMachine &getTarget() const { return Target; }
 
-  /// doesHaveBuiltinSetjmp - Return whether this function uses builtin_setjmp
-  ///
-  bool doesHaveBuiltinSetjmp() const { return HasBuiltinSetjmp; }
-
-  /// setHasBuiltinSetjmp - Mark whether this function uses builtin_setjmp
-  ///
-  void setHasBuiltinSetjmp (bool flag) { HasBuiltinSetjmp = flag; }
-
   /// getRegInfo - Return information about the registers currently in use.
   ///
   MachineRegisterInfo &getRegInfo() { return *RegInfo; }
index cb19bec0896a2bf0a11ce331b879bdd621982c64..5135308e980f8e92959359d7a6d390b5150f2a47 100644 (file)
@@ -121,7 +121,6 @@ MachineFunction::MachineFunction(const Function *F,
                   MachineRegisterInfo(*TM.getRegisterInfo());
   else
     RegInfo = 0;
-  HasBuiltinSetjmp = false;
   MFInfo = 0;
   FrameInfo = new (Allocator.Allocate<MachineFrameInfo>())
                   MachineFrameInfo(*TM.getFrameInfo());
index 2c5c8c913dee5d0ef752fcf25338e492de45a24f..9e7ad6752a73d188388834e6f06c182bc76ef163 100644 (file)
@@ -180,7 +180,7 @@ void PEI::calculateCalleeSavedRegisters(MachineFunction &Fn) {
   std::vector<CalleeSavedInfo> CSI;
   for (unsigned i = 0; CSRegs[i]; ++i) {
     unsigned Reg = CSRegs[i];
-    if (Fn.getRegInfo().isPhysRegUsed(Reg) || Fn.doesHaveBuiltinSetjmp()) {
+    if (Fn.getRegInfo().isPhysRegUsed(Reg)) {
         // If the reg is modified, save it!
       CSI.push_back(CalleeSavedInfo(Reg, CSRegClasses[i]));
     } else {
index cecd529707c562fe218ebdf260b3e0331ef9b973..b340d0c971bc22dfc318989f499c56091c2f8b3c 100644 (file)
@@ -3849,12 +3849,6 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) {
   case Intrinsic::longjmp:
     return "_longjmp"+!TLI.usesUnderscoreLongJmp();
     break;
-  case Intrinsic::builtinsetjmp:
-    // Mark this function has using builtin_setjmp so context gets preserved
-    DAG.getMachineFunction().setHasBuiltinSetjmp(true);
-    // Turn it into a target intrinsic node for the codegen
-    visitTargetIntrinsic(I, Intrinsic);
-    return 0;
   case Intrinsic::memcpy: {
     SDValue Op1 = getValue(I.getOperand(1));
     SDValue Op2 = getValue(I.getOperand(2));