[llvm] [AMDGPU] Implement IR expansion for frem instruction (PR #130988)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 13 00:31:38 PDT 2025


================
@@ -696,13 +1104,19 @@ class ExpandFpLegacyPass : public FunctionPass {
 
 PreservedAnalyses ExpandFpPass::run(Function &F, FunctionAnalysisManager &FAM) {
   const TargetSubtargetInfo *STI = TM->getSubtargetImpl(F);
-  return runImpl(F, *STI->getTargetLowering()) ? PreservedAnalyses::none()
-                                               : PreservedAnalyses::all();
+  auto &TLI = *STI->getTargetLowering();
+  AssumptionCache *AC = nullptr;
+  if (TM->getOptLevel() != CodeGenOptLevel::None)
----------------
arsenm wrote:

The old pass manager stores the opt level, but this is taking it from the TargetMachine. Should consistently use a pass parameter (also looks like this pass should be handling print/parse of this in the new pass manager) 

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


More information about the llvm-commits mailing list