Skip to content

Commit 0f0cfcf

Browse files
authored
CodeGen: Avoid some references to MachineFunction's getMMI (#99652)
MachineFunction's probably should not include a backreference to the owning MachineModuleInfo. Most of these references were used just to query the MCContext, which MachineFunction already directly stores. Other contexts are using it to query the LLVMContext, which can already be accessed through the IR function reference.
1 parent 54dab7d commit 0f0cfcf

27 files changed

+39
-65
lines changed

llvm/include/llvm/CodeGen/TailDuplicator.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ class TailDuplicator {
4040
const TargetInstrInfo *TII;
4141
const TargetRegisterInfo *TRI;
4242
const MachineBranchProbabilityInfo *MBPI;
43-
const MachineModuleInfo *MMI;
4443
MachineRegisterInfo *MRI;
4544
MachineFunction *MF;
4645
MBFIWrapper *MBFI;

llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2451,8 +2451,7 @@ bool IRTranslator::translateKnownIntrinsic(const CallInst &CI, Intrinsic::ID ID,
24512451

24522452
int FI = getOrCreateFrameIndex(*cast<AllocaInst>(Arg));
24532453
MCSymbol *FrameAllocSym =
2454-
MF->getMMI().getContext().getOrCreateFrameAllocSymbol(EscapedName,
2455-
Idx);
2454+
MF->getContext().getOrCreateFrameAllocSymbol(EscapedName, Idx);
24562455

24572456
// This should be inserted at the start of the entry block.
24582457
auto LocalEscape =

llvm/lib/CodeGen/MachineInstr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2216,7 +2216,7 @@ void MachineInstr::emitError(StringRef Msg) const {
22162216

22172217
if (const MachineBasicBlock *MBB = getParent())
22182218
if (const MachineFunction *MF = MBB->getParent())
2219-
return MF->getMMI().getModule()->getContext().emitError(LocCookie, Msg);
2219+
return MF->getFunction().getContext().emitError(LocCookie, Msg);
22202220
report_fatal_error(Msg);
22212221
}
22222222

llvm/lib/CodeGen/RegAllocBase.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ void RegAllocBase::allocatePhysRegs() {
130130
MI->emitError("inline assembly requires more registers than available");
131131
} else if (MI) {
132132
LLVMContext &Context =
133-
MI->getParent()->getParent()->getMMI().getModule()->getContext();
133+
MI->getParent()->getParent()->getFunction().getContext();
134134
Context.emitError("ran out of registers during register allocation");
135135
} else {
136136
report_fatal_error("ran out of registers during register allocation");

llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7375,8 +7375,7 @@ void SelectionDAGBuilder::visitIntrinsicCall(const CallInst &I,
73757375
case Intrinsic::codeview_annotation: {
73767376
// Emit a label associated with this metadata.
73777377
MachineFunction &MF = DAG.getMachineFunction();
7378-
MCSymbol *Label =
7379-
MF.getMMI().getContext().createTempSymbol("annotation", true);
7378+
MCSymbol *Label = MF.getContext().createTempSymbol("annotation", true);
73807379
Metadata *MD = cast<MetadataAsValue>(I.getArgOperand(0))->getMetadata();
73817380
MF.addCodeViewAnnotation(Label, cast<MDNode>(MD));
73827381
Res = DAG.getLabelNode(ISD::ANNOTATION_LABEL, sdl, getRoot(), Label);
@@ -7644,9 +7643,8 @@ void SelectionDAGBuilder::visitIntrinsicCall(const CallInst &I,
76447643
assert(FuncInfo.StaticAllocaMap.count(Slot) &&
76457644
"can only escape static allocas");
76467645
int FI = FuncInfo.StaticAllocaMap[Slot];
7647-
MCSymbol *FrameAllocSym =
7648-
MF.getMMI().getContext().getOrCreateFrameAllocSymbol(
7649-
GlobalValue::dropLLVMManglingEscape(MF.getName()), Idx);
7646+
MCSymbol *FrameAllocSym = MF.getContext().getOrCreateFrameAllocSymbol(
7647+
GlobalValue::dropLLVMManglingEscape(MF.getName()), Idx);
76507648
BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, dl,
76517649
TII->get(TargetOpcode::LOCAL_ESCAPE))
76527650
.addSym(FrameAllocSym)
@@ -7665,9 +7663,8 @@ void SelectionDAGBuilder::visitIntrinsicCall(const CallInst &I,
76657663
auto *Idx = cast<ConstantInt>(I.getArgOperand(2));
76667664
unsigned IdxVal =
76677665
unsigned(Idx->getLimitedValue(std::numeric_limits<int>::max()));
7668-
MCSymbol *FrameAllocSym =
7669-
MF.getMMI().getContext().getOrCreateFrameAllocSymbol(
7670-
GlobalValue::dropLLVMManglingEscape(Fn->getName()), IdxVal);
7666+
MCSymbol *FrameAllocSym = MF.getContext().getOrCreateFrameAllocSymbol(
7667+
GlobalValue::dropLLVMManglingEscape(Fn->getName()), IdxVal);
76717668

76727669
Value *FP = I.getArgOperand(1);
76737670
SDValue FPVal = getValue(FP);
@@ -8626,7 +8623,7 @@ SDValue SelectionDAGBuilder::lowerStartEH(SDValue Chain,
86268623

86278624
// Insert a label before the invoke call to mark the try range. This can be
86288625
// used to detect deletion of the invoke via the MachineModuleInfo.
8629-
BeginLabel = MMI.getContext().createTempSymbol();
8626+
BeginLabel = MF.getContext().createTempSymbol();
86308627

86318628
// For SjLj, keep track of which landing pads go with which invokes
86328629
// so as to maintain the ordering of pads in the LSDA.
@@ -8648,11 +8645,10 @@ SDValue SelectionDAGBuilder::lowerEndEH(SDValue Chain, const InvokeInst *II,
86488645
assert(BeginLabel && "BeginLabel should've been set");
86498646

86508647
MachineFunction &MF = DAG.getMachineFunction();
8651-
MachineModuleInfo &MMI = MF.getMMI();
86528648

86538649
// Insert a label at the end of the invoke call to mark the try range. This
86548650
// can be used to detect deletion of the invoke via the MachineModuleInfo.
8655-
MCSymbol *EndLabel = MMI.getContext().createTempSymbol();
8651+
MCSymbol *EndLabel = MF.getContext().createTempSymbol();
86568652
Chain = DAG.getEHLabel(getCurSDLoc(), Chain, EndLabel);
86578653

86588654
// Inform MachineModuleInfo of range.

llvm/lib/CodeGen/TailDuplicator.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ void TailDuplicator::initMF(MachineFunction &MFin, bool PreRegAlloc,
9797
TII = MF->getSubtarget().getInstrInfo();
9898
TRI = MF->getSubtarget().getRegisterInfo();
9999
MRI = &MF->getRegInfo();
100-
MMI = &MF->getMMI();
101100
MBPI = MBPIin;
102101
MBFI = MBFIin;
103102
PSI = PSIin;

llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2323,7 +2323,7 @@ bool TargetLoweringObjectFileXCOFF::ShouldSetSSPCanaryBitInTB(
23232323

23242324
MCSymbol *
23252325
TargetLoweringObjectFileXCOFF::getEHInfoTableSymbol(const MachineFunction *MF) {
2326-
MCSymbol *EHInfoSym = MF->getMMI().getContext().getOrCreateSymbol(
2326+
MCSymbol *EHInfoSym = MF->getContext().getOrCreateSymbol(
23272327
"__ehinfo." + Twine(MF->getFunctionNumber()));
23282328
cast<MCSymbolXCOFF>(EHInfoSym)->setEHInfo();
23292329
return EHInfoSym;

llvm/lib/Target/AArch64/AArch64PointerAuth.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ void AArch64PointerAuth::signLR(MachineFunction &MF,
116116
// PAuthLR authentication instructions need to know the value of PC at the
117117
// point of signing (PACI*).
118118
if (MFnI.branchProtectionPAuthLR()) {
119-
MCSymbol *PACSym = MF.getMMI().getContext().createTempSymbol();
119+
MCSymbol *PACSym = MF.getContext().createTempSymbol();
120120
MFnI.setSigningInstrLabel(PACSym);
121121
}
122122

llvm/lib/Target/ARC/ARCFrameLowering.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,7 @@ void ARCFrameLowering::emitPrologue(MachineFunction &MF,
116116
MachineBasicBlock &MBB) const {
117117
LLVM_DEBUG(dbgs() << "Emit Prologue: " << MF.getName() << "\n");
118118
auto *AFI = MF.getInfo<ARCFunctionInfo>();
119-
MachineModuleInfo &MMI = MF.getMMI();
120-
MCContext &Context = MMI.getContext();
119+
MCContext &Context = MF.getContext();
121120
const MCRegisterInfo *MRI = Context.getRegisterInfo();
122121
const ARCInstrInfo *TII = MF.getSubtarget<ARCSubtarget>().getInstrInfo();
123122
MachineBasicBlock::iterator MBBI = MBB.begin();

llvm/lib/Target/ARM/ARMFrameLowering.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -735,8 +735,7 @@ void ARMFrameLowering::emitPrologue(MachineFunction &MF,
735735
MachineBasicBlock::iterator MBBI = MBB.begin();
736736
MachineFrameInfo &MFI = MF.getFrameInfo();
737737
ARMFunctionInfo *AFI = MF.getInfo<ARMFunctionInfo>();
738-
MachineModuleInfo &MMI = MF.getMMI();
739-
MCContext &Context = MMI.getContext();
738+
MCContext &Context = MF.getContext();
740739
const TargetMachine &TM = MF.getTarget();
741740
const MCRegisterInfo *MRI = Context.getRegisterInfo();
742741
const ARMBaseRegisterInfo *RegInfo = STI.getRegisterInfo();
@@ -2995,8 +2994,7 @@ void ARMFrameLowering::adjustForSegmentedStacks(
29952994
report_fatal_error("Segmented stacks not supported on this platform.");
29962995

29972996
MachineFrameInfo &MFI = MF.getFrameInfo();
2998-
MachineModuleInfo &MMI = MF.getMMI();
2999-
MCContext &Context = MMI.getContext();
2997+
MCContext &Context = MF.getContext();
30002998
const MCRegisterInfo *MRI = Context.getRegisterInfo();
30012999
const ARMBaseInstrInfo &TII =
30023000
*static_cast<const ARMBaseInstrInfo *>(MF.getSubtarget().getInstrInfo());

llvm/lib/Target/ARM/Thumb1FrameLowering.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,7 @@ void Thumb1FrameLowering::emitPrologue(MachineFunction &MF,
149149
MachineBasicBlock::iterator MBBI = MBB.begin();
150150
MachineFrameInfo &MFI = MF.getFrameInfo();
151151
ARMFunctionInfo *AFI = MF.getInfo<ARMFunctionInfo>();
152-
MachineModuleInfo &MMI = MF.getMMI();
153-
const MCRegisterInfo *MRI = MMI.getContext().getRegisterInfo();
152+
const MCRegisterInfo *MRI = MF.getContext().getRegisterInfo();
154153
const ThumbRegisterInfo *RegInfo =
155154
static_cast<const ThumbRegisterInfo *>(STI.getRegisterInfo());
156155
const Thumb1InstrInfo &TII =

llvm/lib/Target/Hexagon/HexagonFrameLowering.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1032,7 +1032,6 @@ void HexagonFrameLowering::insertCFIInstructionsAt(MachineBasicBlock &MBB,
10321032
MachineBasicBlock::iterator At) const {
10331033
MachineFunction &MF = *MBB.getParent();
10341034
MachineFrameInfo &MFI = MF.getFrameInfo();
1035-
MachineModuleInfo &MMI = MF.getMMI();
10361035
auto &HST = MF.getSubtarget<HexagonSubtarget>();
10371036
auto &HII = *HST.getInstrInfo();
10381037
auto &HRI = *HST.getRegisterInfo();
@@ -1043,7 +1042,7 @@ void HexagonFrameLowering::insertCFIInstructionsAt(MachineBasicBlock &MBB,
10431042
DebugLoc DL;
10441043
const MCInstrDesc &CFID = HII.get(TargetOpcode::CFI_INSTRUCTION);
10451044

1046-
MCSymbol *FrameLabel = MMI.getContext().createTempSymbol();
1045+
MCSymbol *FrameLabel = MF.getContext().createTempSymbol();
10471046
bool HasFP = hasFP(MF);
10481047

10491048
if (HasFP) {

llvm/lib/Target/M68k/M68kFrameLowering.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -452,8 +452,7 @@ void M68kFrameLowering::emitPrologueCalleeSavedFrameMoves(
452452
const DebugLoc &DL) const {
453453
MachineFunction &MF = *MBB.getParent();
454454
MachineFrameInfo &MFI = MF.getFrameInfo();
455-
MachineModuleInfo &MMI = MF.getMMI();
456-
const MCRegisterInfo *MRI = MMI.getContext().getRegisterInfo();
455+
const MCRegisterInfo *MRI = MF.getContext().getRegisterInfo();
457456

458457
// Add callee saved registers to move list.
459458
const auto &CSI = MFI.getCalleeSavedInfo();

llvm/lib/Target/MSP430/MSP430FrameLowering.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ void MSP430FrameLowering::emitCalleeSavedFrameMoves(
5959
const DebugLoc &DL, bool IsPrologue) const {
6060
MachineFunction &MF = *MBB.getParent();
6161
MachineFrameInfo &MFI = MF.getFrameInfo();
62-
MachineModuleInfo &MMI = MF.getMMI();
63-
const MCRegisterInfo *MRI = MMI.getContext().getRegisterInfo();
62+
const MCRegisterInfo *MRI = MF.getContext().getRegisterInfo();
6463

6564
// Add callee saved registers to move list.
6665
const std::vector<CalleeSavedInfo> &CSI = MFI.getCalleeSavedInfo();

llvm/lib/Target/Mips/Mips16FrameLowering.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,7 @@ void Mips16FrameLowering::emitPrologue(MachineFunction &MF,
5454
// No need to allocate space on the stack.
5555
if (StackSize == 0 && !MFI.adjustsStack()) return;
5656

57-
MachineModuleInfo &MMI = MF.getMMI();
58-
const MCRegisterInfo *MRI = MMI.getContext().getRegisterInfo();
57+
const MCRegisterInfo *MRI = MF.getContext().getRegisterInfo();
5958

6059
// Adjust stack.
6160
TII.makeFrame(Mips::SP, StackSize, MBB, MBBI);

llvm/lib/Target/Mips/MipsSEFrameLowering.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -427,8 +427,7 @@ void MipsSEFrameLowering::emitPrologue(MachineFunction &MF,
427427
// No need to allocate space on the stack.
428428
if (StackSize == 0 && !MFI.adjustsStack()) return;
429429

430-
MachineModuleInfo &MMI = MF.getMMI();
431-
const MCRegisterInfo *MRI = MMI.getContext().getRegisterInfo();
430+
const MCRegisterInfo *MRI = MF.getContext().getRegisterInfo();
432431

433432
// Adjust stack.
434433
TII.adjustStackPtr(SP, -StackSize, MBB, MBBI);

llvm/lib/Target/PowerPC/PPCFrameLowering.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -613,8 +613,7 @@ void PPCFrameLowering::emitPrologue(MachineFunction &MF,
613613
const PPCRegisterInfo *RegInfo = Subtarget.getRegisterInfo();
614614
const PPCTargetLowering &TLI = *Subtarget.getTargetLowering();
615615

616-
MachineModuleInfo &MMI = MF.getMMI();
617-
const MCRegisterInfo *MRI = MMI.getContext().getRegisterInfo();
616+
const MCRegisterInfo *MRI = MF.getContext().getRegisterInfo();
618617
DebugLoc dl;
619618
// AIX assembler does not support cfi directives.
620619
const bool needsCFI = MF.needsFrameMoves() && !Subtarget.isAIXABI();
@@ -1239,8 +1238,7 @@ void PPCFrameLowering::inlineStackProbe(MachineFunction &MF,
12391238
const PPCTargetLowering &TLI = *Subtarget.getTargetLowering();
12401239
const PPCInstrInfo &TII = *Subtarget.getInstrInfo();
12411240
MachineFrameInfo &MFI = MF.getFrameInfo();
1242-
MachineModuleInfo &MMI = MF.getMMI();
1243-
const MCRegisterInfo *MRI = MMI.getContext().getRegisterInfo();
1241+
const MCRegisterInfo *MRI = MF.getContext().getRegisterInfo();
12441242
// AIX assembler does not support cfi directives.
12451243
const bool needsCFI = MF.needsFrameMoves() && !Subtarget.isAIXABI();
12461244
auto StackAllocMIPos = llvm::find_if(PrologMBB, [](MachineInstr &MI) {

llvm/lib/Target/PowerPC/PPCISelLowering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5559,7 +5559,7 @@ static SDValue transformCallee(const SDValue &Callee, SelectionDAG &DAG,
55595559
// C-linkage name. A Qualname is returned here because an external
55605560
// function entry point is a csect with XTY_ER property.
55615561
const auto getExternalFunctionEntryPointSymbol = [&](StringRef SymName) {
5562-
auto &Context = DAG.getMachineFunction().getMMI().getContext();
5562+
auto &Context = DAG.getMachineFunction().getContext();
55635563
MCSectionXCOFF *Sec = Context.getXCOFFSection(
55645564
(Twine(".") + Twine(SymName)).str(), SectionKind::getMetadata(),
55655565
XCOFF::CsectProperties(XCOFF::XMC_PR, XCOFF::XTY_ER));

llvm/lib/Target/SPIRV/SPIRVISelLowering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ static void validateGroupWaitEventsPtr(const SPIRVSubtarget &STI,
196196
if (!ElemType || ElemType->getOpcode() == SPIRV::OpTypeEvent)
197197
return;
198198
// Insert a bitcast before the instruction to keep SPIR-V code valid.
199-
LLVMContext &Context = MF->getMMI().getModule()->getContext();
199+
LLVMContext &Context = MF->getFunction().getContext();
200200
SPIRVType *NewPtrType =
201201
createNewPtrType(GR, I, OpType, false, true, nullptr,
202202
TargetExtType::get(Context, "spirv.Event"));

llvm/lib/Target/SystemZ/SystemZFrameLowering.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -517,8 +517,7 @@ static void buildDefCFAReg(MachineBasicBlock &MBB,
517517
const DebugLoc &DL, unsigned Reg,
518518
const SystemZInstrInfo *ZII) {
519519
MachineFunction &MF = *MBB.getParent();
520-
MachineModuleInfo &MMI = MF.getMMI();
521-
const MCRegisterInfo *MRI = MMI.getContext().getRegisterInfo();
520+
const MCRegisterInfo *MRI = MF.getContext().getRegisterInfo();
522521
unsigned RegNum = MRI->getDwarfRegNum(Reg, true);
523522
unsigned CFIIndex = MF.addFrameInst(
524523
MCCFIInstruction::createDefCfaRegister(nullptr, RegNum));
@@ -535,8 +534,7 @@ void SystemZELFFrameLowering::emitPrologue(MachineFunction &MF,
535534
auto *ZII = static_cast<const SystemZInstrInfo *>(STI.getInstrInfo());
536535
SystemZMachineFunctionInfo *ZFI = MF.getInfo<SystemZMachineFunctionInfo>();
537536
MachineBasicBlock::iterator MBBI = MBB.begin();
538-
MachineModuleInfo &MMI = MF.getMMI();
539-
const MCRegisterInfo *MRI = MMI.getContext().getRegisterInfo();
537+
const MCRegisterInfo *MRI = MF.getContext().getRegisterInfo();
540538
const std::vector<CalleeSavedInfo> &CSI = MFFrame.getCalleeSavedInfo();
541539
bool HasFP = hasFP(MF);
542540

llvm/lib/Target/WebAssembly/WebAssemblyFastISel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -886,7 +886,7 @@ bool WebAssemblyFastISel::selectCall(const Instruction *I) {
886886
MIB.addImm(0);
887887
// The table into which this call_indirect indexes.
888888
MCSymbolWasm *Table = WebAssembly::getOrCreateFunctionTableSymbol(
889-
MF->getMMI().getContext(), Subtarget);
889+
MF->getContext(), Subtarget);
890890
if (Subtarget->hasReferenceTypes()) {
891891
MIB.addSym(Table);
892892
} else {

llvm/lib/Target/X86/X86FrameLowering.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -466,8 +466,7 @@ void X86FrameLowering::emitCalleeSavedFrameMovesFullCFA(
466466
emitCalleeSavedFrameMoves(MBB, MBBI, DebugLoc{}, true);
467467
return;
468468
}
469-
const MachineModuleInfo &MMI = MF.getMMI();
470-
const MCRegisterInfo *MRI = MMI.getContext().getRegisterInfo();
469+
const MCRegisterInfo *MRI = MF.getContext().getRegisterInfo();
471470
const Register FramePtr = TRI->getFrameRegister(MF);
472471
const Register MachineFramePtr =
473472
STI.isTarget64BitILP32() ? Register(getX86SubSuperRegister(FramePtr, 64))
@@ -485,8 +484,7 @@ void X86FrameLowering::emitCalleeSavedFrameMoves(
485484
const DebugLoc &DL, bool IsPrologue) const {
486485
MachineFunction &MF = *MBB.getParent();
487486
MachineFrameInfo &MFI = MF.getFrameInfo();
488-
MachineModuleInfo &MMI = MF.getMMI();
489-
const MCRegisterInfo *MRI = MMI.getContext().getRegisterInfo();
487+
const MCRegisterInfo *MRI = MF.getContext().getRegisterInfo();
490488
X86MachineFunctionInfo *X86FI = MF.getInfo<X86MachineFunctionInfo>();
491489

492490
// Add callee saved registers to move list.
@@ -3882,8 +3880,7 @@ bool X86FrameLowering::enableShrinkWrapping(const MachineFunction &MF) const {
38823880
// If we may need to emit frameless compact unwind information, give
38833881
// up as this is currently broken: PR25614.
38843882
bool CompactUnwind =
3885-
MF.getMMI().getContext().getObjectFileInfo()->getCompactUnwindSection() !=
3886-
nullptr;
3883+
MF.getContext().getObjectFileInfo()->getCompactUnwindSection() != nullptr;
38873884
return (MF.getFunction().hasFnAttribute(Attribute::NoUnwind) || hasFP(MF) ||
38883885
!CompactUnwind) &&
38893886
// The lowering of segmented stack and HiPE only support entry

llvm/lib/Target/X86/X86ISelLowering.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25446,9 +25446,8 @@ static SDValue recoverFramePointer(SelectionDAG &DAG, const Function *Fn,
2544625446

2544725447
// Get an MCSymbol that will ultimately resolve to the frame offset of the EH
2544825448
// registration, or the .set_setframe offset.
25449-
MCSymbol *OffsetSym =
25450-
MF.getMMI().getContext().getOrCreateParentFrameOffsetSymbol(
25451-
GlobalValue::dropLLVMManglingEscape(Fn->getName()));
25449+
MCSymbol *OffsetSym = MF.getContext().getOrCreateParentFrameOffsetSymbol(
25450+
GlobalValue::dropLLVMManglingEscape(Fn->getName()));
2545225451
SDValue OffsetSymVal = DAG.getMCSymbol(OffsetSym, PtrVT);
2545325452
SDValue ParentFrameOffset =
2545425453
DAG.getNode(ISD::LOCAL_RECOVER, dl, PtrVT, OffsetSymVal);
@@ -26340,7 +26339,7 @@ SDValue X86TargetLowering::LowerINTRINSIC_WO_CHAIN(SDValue Op,
2634026339
MachineFunction &MF = DAG.getMachineFunction();
2634126340
const TargetLowering &TLI = DAG.getTargetLoweringInfo();
2634226341
MVT PtrVT = TLI.getPointerTy(DAG.getDataLayout());
26343-
auto &Context = MF.getMMI().getContext();
26342+
auto &Context = MF.getContext();
2634426343
MCSymbol *S = Context.getOrCreateSymbol(Twine("GCC_except_table") +
2634526344
Twine(MF.getFunctionNumber()));
2634626345
return DAG.getNode(getGlobalWrapperKind(nullptr, /*OpFlags=*/0), dl, VT,
@@ -26352,7 +26351,7 @@ SDValue X86TargetLowering::LowerINTRINSIC_WO_CHAIN(SDValue Op,
2635226351
MachineFunction &MF = DAG.getMachineFunction();
2635326352
SDValue Op1 = Op.getOperand(1);
2635426353
auto *Fn = cast<Function>(cast<GlobalAddressSDNode>(Op1)->getGlobal());
26355-
MCSymbol *LSDASym = MF.getMMI().getContext().getOrCreateLSDASymbol(
26354+
MCSymbol *LSDASym = MF.getContext().getOrCreateLSDASymbol(
2635626355
GlobalValue::dropLLVMManglingEscape(Fn->getName()));
2635726356

2635826357
// Generate a simple absolute symbol reference. This intrinsic is only

llvm/lib/Target/X86/X86ISelLoweringCall.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2016,7 +2016,7 @@ X86TargetLowering::LowerCall(TargetLowering::CallLoweringInfo &CLI,
20162016
bool HasNoCfCheck = (CB && CB->doesNoCfCheck());
20172017
bool IsIndirectCall = (CB && isa<CallInst>(CB) && CB->isIndirectCall());
20182018
bool IsCFICall = IsIndirectCall && CLI.CFIType;
2019-
const Module *M = MF.getMMI().getModule();
2019+
const Module *M = MF.getFunction().getParent();
20202020
Metadata *IsCFProtectionSupported = M->getModuleFlag("cf-protection-branch");
20212021

20222022
MachineFunction::CallSiteInfo CSInfo;

llvm/lib/Target/X86/X86PreTileConfig.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ using namespace llvm;
4545
#define DEBUG_TYPE "tile-pre-config"
4646

4747
static void emitErrorMsg(MachineFunction &MF) {
48-
LLVMContext &Context = MF.getMMI().getModule()->getContext();
48+
LLVMContext &Context = MF.getFunction().getContext();
4949
Context.emitError(
5050
MF.getName() +
5151
": Failed to config tile register, please define the shape earlier");

llvm/lib/Target/XCore/XCoreFrameLowering.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,7 @@ void XCoreFrameLowering::emitPrologue(MachineFunction &MF,
225225
assert(&MF.front() == &MBB && "Shrink-wrapping not yet supported");
226226
MachineBasicBlock::iterator MBBI = MBB.begin();
227227
MachineFrameInfo &MFI = MF.getFrameInfo();
228-
MachineModuleInfo *MMI = &MF.getMMI();
229-
const MCRegisterInfo *MRI = MMI->getContext().getRegisterInfo();
228+
const MCRegisterInfo *MRI = MF.getContext().getRegisterInfo();
230229
const XCoreInstrInfo &TII = *MF.getSubtarget<XCoreSubtarget>().getInstrInfo();
231230
XCoreFunctionInfo *XFI = MF.getInfo<XCoreFunctionInfo>();
232231
// Debug location must be unknown since the first debug location is used

llvm/lib/Target/Xtensa/XtensaFrameLowering.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ void XtensaFrameLowering::emitPrologue(MachineFunction &MF,
4141
DebugLoc DL = MBBI != MBB.end() ? MBBI->getDebugLoc() : DebugLoc();
4242
MCRegister SP = Xtensa::SP;
4343
MCRegister FP = TRI->getFrameRegister(MF);
44-
MachineModuleInfo &MMI = MF.getMMI();
45-
const MCRegisterInfo *MRI = MMI.getContext().getRegisterInfo();
44+
const MCRegisterInfo *MRI = MF.getContext().getRegisterInfo();
4645

4746
// First, compute final stack size.
4847
uint64_t StackSize = MFI.getStackSize();

0 commit comments

Comments
 (0)