diff options
author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2024-07-26 13:02:12 +0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-26 13:02:12 +0400 |
commit | 6f83a031e452bb33c0ee23b8c5c4dee97ce2bf52 (patch) | |
tree | 8dac962b94f0ba7ccec85d07679f3b1d712d9f08 /llvm/lib/CodeGen | |
parent | 3834523f77c0709ef873a3b1fb878d096687987a (diff) | |
download | llvm-6f83a031e452bb33c0ee23b8c5c4dee97ce2bf52.zip llvm-6f83a031e452bb33c0ee23b8c5c4dee97ce2bf52.tar.gz llvm-6f83a031e452bb33c0ee23b8c5c4dee97ce2bf52.tar.bz2 |
CodeGen: Move current call site out of MachineModuleInfo (#100369)
I do not know understand what this is for, but it's only used in
SelectionDAGBuilder, so move it to FunctionLoweringInfo like other
function scope DAG builder state. The intrinsics are not documented
in the LangRef or Intrinsics.td.
This removes the last piece of codegen state from MachineModuleInfo.
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/MachineFunction.cpp | 5 | ||||
-rw-r--r-- | llvm/lib/CodeGen/MachineModuleInfo.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | 10 |
3 files changed, 9 insertions, 8 deletions
diff --git a/llvm/lib/CodeGen/MachineFunction.cpp b/llvm/lib/CodeGen/MachineFunction.cpp index 7f6a752..6179925 100644 --- a/llvm/lib/CodeGen/MachineFunction.cpp +++ b/llvm/lib/CodeGen/MachineFunction.cpp @@ -654,6 +654,11 @@ void MachineFunction::print(raw_ostream &OS, const SlotIndexes *Indexes) const { /// True if this function needs frame moves for debug or exceptions. bool MachineFunction::needsFrameMoves() const { + // TODO: Ideally, what we'd like is to have a switch that allows emitting + // synchronous (precise at call-sites only) CFA into .eh_frame. However, even + // under this switch, we'd like .debug_frame to be precise when using -g. At + // this moment, there's no way to specify that some CFI directives go into + // .eh_frame only, while others go into .debug_frame only. return getMMI().hasDebugInfo() || getTarget().Options.ForceDwarfFrameSection || F.needsUnwindTableEntry(); diff --git a/llvm/lib/CodeGen/MachineModuleInfo.cpp b/llvm/lib/CodeGen/MachineModuleInfo.cpp index 150ab36..f382df1 100644 --- a/llvm/lib/CodeGen/MachineModuleInfo.cpp +++ b/llvm/lib/CodeGen/MachineModuleInfo.cpp @@ -26,7 +26,6 @@ MachineModuleInfoImpl::~MachineModuleInfoImpl() = default; void MachineModuleInfo::initialize() { ObjFileMMI = nullptr; - CurCallSite = 0; NextFnNum = 0; DbgInfoAvailable = false; } @@ -46,7 +45,6 @@ MachineModuleInfo::MachineModuleInfo(MachineModuleInfo &&MMI) MachineFunctions(std::move(MMI.MachineFunctions)) { Context.setObjectFileInfo(TM.getObjFileLowering()); ObjFileMMI = MMI.ObjFileMMI; - CurCallSite = MMI.CurCallSite; ExternalContext = MMI.ExternalContext; TheModule = MMI.TheModule; } diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp index 1791f1b..c554c0f 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp @@ -6708,10 +6708,9 @@ void SelectionDAGBuilder::visitIntrinsicCall(const CallInst &I, return; case Intrinsic::eh_sjlj_callsite: { ConstantInt *CI = cast<ConstantInt>(I.getArgOperand(0)); - assert(DAG.getMMI()->getCurrentCallSite() == 0 && - "Overlapping call sites!"); + assert(FuncInfo.getCurrentCallSite() == 0 && "Overlapping call sites!"); - DAG.getMMI()->setCurrentCallSite(CI->getZExtValue()); + FuncInfo.setCurrentCallSite(CI->getZExtValue()); return; } case Intrinsic::eh_sjlj_functioncontext: { @@ -8619,7 +8618,6 @@ SDValue SelectionDAGBuilder::lowerStartEH(SDValue Chain, const BasicBlock *EHPadBB, MCSymbol *&BeginLabel) { MachineFunction &MF = DAG.getMachineFunction(); - MachineModuleInfo &MMI = MF.getMMI(); // Insert a label before the invoke call to mark the try range. This can be // used to detect deletion of the invoke via the MachineModuleInfo. @@ -8627,13 +8625,13 @@ SDValue SelectionDAGBuilder::lowerStartEH(SDValue Chain, // For SjLj, keep track of which landing pads go with which invokes // so as to maintain the ordering of pads in the LSDA. - unsigned CallSiteIndex = MMI.getCurrentCallSite(); + unsigned CallSiteIndex = FuncInfo.getCurrentCallSite(); if (CallSiteIndex) { MF.setCallSiteBeginLabel(BeginLabel, CallSiteIndex); LPadToCallSiteMap[FuncInfo.MBBMap[EHPadBB]].push_back(CallSiteIndex); // Now that the call site is handled, stop tracking it. - MMI.setCurrentCallSite(0); + FuncInfo.setCurrentCallSite(0); } return DAG.getEHLabel(getCurSDLoc(), Chain, BeginLabel); |