[llvm] [MLGO] Model selection for models lowered through EmitC (PR #212650)
Paul Kirth via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 30 08:50:41 PDT 2026
================
@@ -368,14 +405,23 @@ class ReleaseModeEvictionAdvisorProvider final
getAdvisor(const MachineFunction &MF, const RAGreedy &RA,
MachineBlockFrequencyInfo *MBFI, MachineLoopInfo *Loops) override {
if (!Runner) {
- if (InteractiveChannelBaseName.empty())
- Runner = std::make_unique<ReleaseModeModelRunner<CompiledModelType>>(
- MF.getFunction().getContext(), InputFeatures, DecisionName);
- else
+ if (InteractiveChannelBaseName.empty()) {
+#if defined(LLVM_HAVE_EMITC_COMPILE_REGALLOC)
+ if (SelectedMLGORegAllocModel != MLGORegAllocModelChoice::Default) {
+ Runner = createMLGORegAllocModelRunner(MF.getFunction().getContext(),
----------------
ilovepi wrote:
@beamandala do you think the `constexpr` bits we used in the inliner would make this a bit more natural? This also seems like an almost identical patternl, so perhaps there's a common helper you can use to select the runner?
https://github.com/llvm/llvm-project/pull/212650
More information about the llvm-commits
mailing list