[llvm-branch-commits] [llvm] ExpandFp: Require RuntimeLibcallsInfo analysis (PR #165197)

Frederik Harwath via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Oct 28 06:43:05 PDT 2025


================
@@ -1126,13 +1130,23 @@ PreservedAnalyses ExpandFpPass::run(Function &F, FunctionAnalysisManager &FAM) {
   AssumptionCache *AC = nullptr;
   if (OptLevel != CodeGenOptLevel::None)
     AC = &FAM.getResult<AssumptionAnalysis>(F);
+
+  auto &MAMProxy = FAM.getResult<ModuleAnalysisManagerFunctionProxy>(F);
+  const RTLIB::RuntimeLibcallsInfo *Libcalls =
+      MAMProxy.getCachedResult<RuntimeLibraryAnalysis>(*F.getParent());
+  if (!Libcalls) {
+    F.getContext().emitError("'runtime-libcall-info' analysis required");
----------------
frederik-h wrote:

You cannot assert `Libcalls` here. If nothing runs the analysis before this point, the result will be null. That's why the explicit `require` in the pass pipeline in the tests is necessary.

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


More information about the llvm-branch-commits mailing list