[llvm] [SelectionDAG] Correctly Mark Required Analyses (PR #147649)

Sam Elliott via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 8 21:27:48 PDT 2025


https://github.com/lenary created https://github.com/llvm/llvm-project/pull/147649

llvm/llvm-project#147560 changed when the legacy SelectionDAG pass needs TargetTransformInfoWrapperPass to always require it (rather than only when assertions are enabled). `SelectionDAGISelLegacy::getAnalysisUsage` was not updated in that PR, which was causing crashes on assertions-disabled builds, which are hard to track down.

This makes the required update, which should avoid crashes being seen on some buildbots and by some users.

>From 6073f30e3e247efce33867a27f83200c2f445347 Mon Sep 17 00:00:00 2001
From: Sam Elliott <quic_aelliott at quicinc.com>
Date: Tue, 8 Jul 2025 21:23:33 -0700
Subject: [PATCH] [SelectionDAG] Correctly Mark Required Analyses

llvm/llvm-project#147560 changed when the legacy SelectionDAG pass needs
TargetTransformInfoWrapperPass to always require it (rather than only
when assertions are enabled). `SelectionDAGISelLegacy::getAnalysisUsage`
was not updated in that PR, which was causing crashes on
assertions-disabled builds, which are hard to track down.

This makes the required update, which should avoid crashes being seen on
some buildbots and by some users.
---
 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 2 --
 1 file changed, 2 deletions(-)

diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index 6260ad2f24dea..26071ed70c9db 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -396,9 +396,7 @@ void SelectionDAGISelLegacy::getAnalysisUsage(AnalysisUsage &AU) const {
   AU.addRequired<StackProtector>();
   AU.addPreserved<GCModuleInfo>();
   AU.addRequired<TargetLibraryInfoWrapperPass>();
-#ifndef NDEBUG
   AU.addRequired<TargetTransformInfoWrapperPass>();
-#endif
   AU.addRequired<AssumptionCacheTracker>();
   if (UseMBPI && OptLevel != CodeGenOptLevel::None)
       AU.addRequired<BranchProbabilityInfoWrapperPass>();



More information about the llvm-commits mailing list