[llvm] e08ec62 - [SelectOptimize] Emit Fatal Error instead of Asserting on null PSI (#192871)
via llvm-commits
llvm-commits at lists.llvm.org
Sun Apr 19 14:26:18 PDT 2026
Author: Aiden Grossman
Date: 2026-04-19T14:26:14-07:00
New Revision: e08ec62ddc4b1ffa75bf8dd9486620a9f1c9e78c
URL: https://github.com/llvm/llvm-project/commit/e08ec62ddc4b1ffa75bf8dd9486620a9f1c9e78c
DIFF: https://github.com/llvm/llvm-project/commit/e08ec62ddc4b1ffa75bf8dd9486620a9f1c9e78c.diff
LOG: [SelectOptimize] Emit Fatal Error instead of Asserting on null PSI (#192871)
SelectOptimize expects to have PSI available which will normally be
available if the pipeline is set up correctly to require
ProfileSummaryInfo at the beginning. However, we do not want to assert
if someone sets up the pipeline incorrectly, instead reporting a fatal
usage error.
Fixes #192759.
Added:
Modified:
llvm/lib/CodeGen/SelectOptimize.cpp
Removed:
################################################################################
diff --git a/llvm/lib/CodeGen/SelectOptimize.cpp b/llvm/lib/CodeGen/SelectOptimize.cpp
index 4c6a20910f9af..5ac6758624438 100644
--- a/llvm/lib/CodeGen/SelectOptimize.cpp
+++ b/llvm/lib/CodeGen/SelectOptimize.cpp
@@ -369,7 +369,9 @@ PreservedAnalyses SelectOptimizeImpl::run(Function &F,
PSI = FAM.getResult<ModuleAnalysisManagerFunctionProxy>(F)
.getCachedResult<ProfileSummaryAnalysis>(*F.getParent());
- assert(PSI && "This pass requires module analysis pass `profile-summary`!");
+ if (!PSI)
+ reportFatalUsageError("This pass requires the profile-summary module "
+ "analysis to be available.");
BFI = &FAM.getResult<BlockFrequencyAnalysis>(F);
// When optimizing for size, selects are preferable over branches.
More information about the llvm-commits
mailing list