[llvm] [SPIR-V] Move MIR rewrites out of SPIRVModuleAnalysis (PR #229736)

Marcos Maronas via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 9 13:06:29 PDT 2026


================
@@ -3186,3 +3146,48 @@ SPIRVModuleAnalysis::run(Module &M, ModuleAnalysisManager &MAM) {
       .run(M);
   return MAI;
 }
+
+static void prepareModuleAnalysis(MachineFunction &MF) {
+  const auto &ST = MF.getSubtarget<SPIRVSubtarget>();
+  SPIRVGlobalRegistry *GR = ST.getSPIRVGlobalRegistry();
+  const SPIRVInstrInfo &TII = *ST.getInstrInfo();
+  SPIRV::RequirementHandler Reqs;
+  Reqs.initAvailableCapabilities(ST);
----------------
maarquitos14 wrote:

Do we need this per MF? I think per module should be enough?

https://github.com/llvm/llvm-project/pull/229736


More information about the llvm-commits mailing list