From aa82b562b7b4b36f4a3d04e80e5743028bddd577 Mon Sep 17 00:00:00 2001 From: Christudasan Devadasan Date: Mon, 3 Jul 2023 21:29:34 +0530 Subject: [CodeGen] MRI call back in TargetMachine It is needed for target specific initializatons. Reviewed By: qcolombet Differential Revision: https://reviews.llvm.org/D143758 --- llvm/lib/CodeGen/MachineModuleInfo.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'llvm/lib/CodeGen/MachineModuleInfo.cpp') diff --git a/llvm/lib/CodeGen/MachineModuleInfo.cpp b/llvm/lib/CodeGen/MachineModuleInfo.cpp index b9bf0a0..921feb2 100644 --- a/llvm/lib/CodeGen/MachineModuleInfo.cpp +++ b/llvm/lib/CodeGen/MachineModuleInfo.cpp @@ -106,6 +106,10 @@ MachineFunction &MachineModuleInfo::getOrCreateMachineFunction(Function &F) { const TargetSubtargetInfo &STI = *TM.getSubtargetImpl(F); MF = new MachineFunction(F, TM, STI, NextFnNum++, *this); MF->initTargetMachineFunctionInfo(STI); + + // MRI callback for target specific initializations. + TM.registerMachineRegisterInfoCallback(*MF); + // Update the set entry. I.first->second.reset(MF); } else { -- cgit v1.1