diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2023-12-09 13:28:42 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2023-12-09 13:28:42 +0000 |
| commit | b1c73532ee8997fe5dfbeb7d223027bdf99758a0 (patch) | |
| tree | 7d6e51c294ab6719475d660217aa0c0ad0526292 /llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp | |
| parent | 7fa27ce4a07f19b07799a767fc29416f3b625afb (diff) | |
Diffstat (limited to 'llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp b/llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp index 9bbef11067ae..baea773cf528 100644 --- a/llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp +++ b/llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp @@ -58,21 +58,21 @@ INITIALIZE_PASS_END(InstructionSelect, DEBUG_TYPE, "Select target instructions out of generic instructions", false, false) -InstructionSelect::InstructionSelect(CodeGenOpt::Level OL) +InstructionSelect::InstructionSelect(CodeGenOptLevel OL) : MachineFunctionPass(ID), OptLevel(OL) {} // In order not to crash when calling getAnalysis during testing with -run-pass // we use the default opt level here instead of None, so that the addRequired() // calls are made in getAnalysisUsage(). InstructionSelect::InstructionSelect() - : MachineFunctionPass(ID), OptLevel(CodeGenOpt::Default) {} + : MachineFunctionPass(ID), OptLevel(CodeGenOptLevel::Default) {} void InstructionSelect::getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired<TargetPassConfig>(); AU.addRequired<GISelKnownBitsAnalysis>(); AU.addPreserved<GISelKnownBitsAnalysis>(); - if (OptLevel != CodeGenOpt::None) { + if (OptLevel != CodeGenOptLevel::None) { AU.addRequired<ProfileSummaryInfoWrapperPass>(); LazyBlockFrequencyInfoPass::getLazyBFIAnalysisUsage(AU); } @@ -90,14 +90,15 @@ bool InstructionSelect::runOnMachineFunction(MachineFunction &MF) { const TargetPassConfig &TPC = getAnalysis<TargetPassConfig>(); InstructionSelector *ISel = MF.getSubtarget().getInstructionSelector(); + ISel->setTargetPassConfig(&TPC); - CodeGenOpt::Level OldOptLevel = OptLevel; + CodeGenOptLevel OldOptLevel = OptLevel; auto RestoreOptLevel = make_scope_exit([=]() { OptLevel = OldOptLevel; }); - OptLevel = MF.getFunction().hasOptNone() ? CodeGenOpt::None + OptLevel = MF.getFunction().hasOptNone() ? CodeGenOptLevel::None : MF.getTarget().getOptLevel(); GISelKnownBits *KB = &getAnalysis<GISelKnownBitsAnalysis>().get(MF); - if (OptLevel != CodeGenOpt::None) { + if (OptLevel != CodeGenOptLevel::None) { PSI = &getAnalysis<ProfileSummaryInfoWrapperPass>().getPSI(); if (PSI && PSI->hasProfileSummary()) BFI = &getAnalysis<LazyBlockFrequencyInfoPass>().getBFI(); @@ -109,6 +110,7 @@ bool InstructionSelect::runOnMachineFunction(MachineFunction &MF) { // An optimization remark emitter. Used to report failures. MachineOptimizationRemarkEmitter MORE(MF, /*MBFI=*/nullptr); + ISel->setRemarkEmitter(&MORE); // FIXME: There are many other MF/MFI fields we need to initialize. |
