From 4f915313edb04fc4544cb6cc5bcf10476a787707 Mon Sep 17 00:00:00 2001 From: Jim Grosbach Date: Wed, 13 May 2009 23:50:53 +0000 Subject: [PATCH] Removing the HasBuiltinSetjmp flag and associated bits. Flagging the presence 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. llvm-svn: 71743 --- llvm/include/llvm/CodeGen/MachineFunction.h | 12 ------------ llvm/lib/CodeGen/MachineFunction.cpp | 1 - llvm/lib/CodeGen/PrologEpilogInserter.cpp | 2 +- llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp | 6 ------ 4 files changed, 1 insertion(+), 20 deletions(-) diff --git a/llvm/include/llvm/CodeGen/MachineFunction.h b/llvm/include/llvm/CodeGen/MachineFunction.h index 469ae026f016..a110e5846ac9 100644 --- a/llvm/include/llvm/CodeGen/MachineFunction.h +++ b/llvm/include/llvm/CodeGen/MachineFunction.h @@ -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; } diff --git a/llvm/lib/CodeGen/MachineFunction.cpp b/llvm/lib/CodeGen/MachineFunction.cpp index cb19bec0896a..5135308e980f 100644 --- a/llvm/lib/CodeGen/MachineFunction.cpp +++ b/llvm/lib/CodeGen/MachineFunction.cpp @@ -121,7 +121,6 @@ MachineFunction::MachineFunction(const Function *F, MachineRegisterInfo(*TM.getRegisterInfo()); else RegInfo = 0; - HasBuiltinSetjmp = false; MFInfo = 0; FrameInfo = new (Allocator.Allocate()) MachineFrameInfo(*TM.getFrameInfo()); diff --git a/llvm/lib/CodeGen/PrologEpilogInserter.cpp b/llvm/lib/CodeGen/PrologEpilogInserter.cpp index 2c5c8c913dee..9e7ad6752a73 100644 --- a/llvm/lib/CodeGen/PrologEpilogInserter.cpp +++ b/llvm/lib/CodeGen/PrologEpilogInserter.cpp @@ -180,7 +180,7 @@ void PEI::calculateCalleeSavedRegisters(MachineFunction &Fn) { std::vector 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 { diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp index cecd529707c5..b340d0c971bc 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp @@ -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));