[llvm] [NewPM][CodeGen] Port MachineLICM to NPM (PR #107376)

via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 6 04:54:38 PDT 2024


================
@@ -1731,3 +1769,20 @@ bool MachineLICMBase::isTgtHotterThanSrc(MachineBasicBlock *SrcBlock,
   // Compare the block frequency ratio with the threshold
   return Ratio > BlockFrequencyRatioThreshold;
 }
+
+template class llvm::MachineLICMBasePass<EarlyMachineLICMPass, true>;
+template class llvm::MachineLICMBasePass<MachineLICMPass, false>;
+
+template <typename DerivedT, bool PreRegAlloc>
+PreservedAnalyses MachineLICMBasePass<DerivedT, PreRegAlloc>::run(
+    MachineFunction &MF, MachineFunctionAnalysisManager &MFAM) {
+  if (MF.getFunction().hasOptNone())
+    return PreservedAnalyses::all();
----------------
paperchalice wrote:

`OptNoneInstrumentation` should do this, but it doesn't support machine function currently, will support it later...

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


More information about the llvm-commits mailing list