← Back to Pull requests

Pass the LLVMContext when querying inline params on LLVM 24 #3800

Merged
ftynse merged 5 files (27 lines) on Nov 12, 2026 15:23 UTC
View on GitHub
ftynse ftynse commented on Nov 12, 2026 12:17 UTC
Author

llvm/llvm-project#239650 moved the inliner threshold options into AnalysisOptions, so llvm::getInlineParams and llvm::getInlineParamsFromOptLevel now take the LLVMContext the options are read from. Without this, Enzyme.cpp fails to compile against current LLVM main:

Enzyme/Enzyme.cpp:2629:21: error: no matching function for call to 'getInlineParams'
Enzyme/Enzyme.cpp:3127:10: error: no matching function for call to 'getInlineParamsFromOptLevel'

Pass F.getContext() in the post-optimization inlining and thread the PassBuilder into the LTO pipeline helper to use PB.getContext().

Needed by EnzymeAD/Enzyme-JAX#3901, which moves LLVM to llvm/llvm-project@df0a91f644ef. Verified there by building and testing Enzyme-JAX against this branch.

Note: the guard is LLVM_VERSION_MAJOR >= 24, so LLVM 24 snapshots that predate llvm/llvm-project#239650 will no longer build.

Diff: 27 lines (+18 / -9) across 5 files Reviewer: vchuravy Review duration: 185m
All Vouch review confidence checks passed
Residual risk 0.04 = Change Risk (0.29) × (1 − Review Confidence (0.87)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.29 · 27 lines diff across 5 files
0.29
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.84 · 4 substantive comment(s)
0.84
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 50%
87%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.199
Real PR Conversation Timeline
6 items
vchuravy vchuravy approved these changes on Nov 12, 2026 12:50 UTC
Approved Reviewer

Approved these changes.

wsmoses wsmoses commented on code on Nov 12, 2026 15:09 UTC
Code Review
enzyme/CMakeLists.txt:1
@@ -20,7 +20,7 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON)
 
 if(NOT DEFINED ENZYME_CONFIGURED_WITH_PRESETS)
   set(CMAKE_CXX_FLAGS
-      "-Wall -fno-rtti ${CMAKE_CXX_FLAGS} -Werror=implicit-fallthrough -Werror=unused-variable -Werror=dangling-else -Werror=unused-but-set-variable -Werror=return-type -Werror=nonnull -Werror=unused-result -Werror=reorder -Werror=switch")

why remove -Werror=unused-variable ?

ftynse ftynse commented on code on Nov 12, 2026 15:14 UTC
Code Review
enzyme/CMakeLists.txt:1
@@ -20,7 +20,7 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON)
 
 if(NOT DEFINED ENZYME_CONFIGURED_WITH_PRESETS)
   set(CMAKE_CXX_FLAGS
-      "-Wall -fno-rtti ${CMAKE_CXX_FLAGS} -Werror=implicit-fallthrough -Werror=unused-variable -Werror=dangling-else -Werror=unused-but-set-variable -Werror=return-type -Werror=nonnull -Werror=unused-result -Werror=reorder -Werror=switch")

Because I needed 3 hour-long iterations on CI to hit yet another one breakage due to this warning-promoted-error.

ftynse ftynse commented on code on Nov 12, 2026 15:19 UTC
Code Review
enzyme/CMakeLists.txt:1
@@ -20,7 +20,7 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON)
 
 if(NOT DEFINED ENZYME_CONFIGURED_WITH_PRESETS)
   set(CMAKE_CXX_FLAGS
-      "-Wall -fno-rtti ${CMAKE_CXX_FLAGS} -Werror=implicit-fallthrough -Werror=unused-variable -Werror=dangling-else -Werror=unused-but-set-variable -Werror=return-type -Werror=nonnull -Werror=unused-result -Werror=reorder -Werror=switch")

it can be re-enabled, but right now we need to merge this so we can update the cascade dependecy in e-jax and reactant, so we can solve a bug elsewhere

ftynse ftynse commented on Nov 12, 2026 15:23 UTC
Author

Not waiting for macos, it's broken

Reviewers
Assignees
ftynse ftynse
Labels
risk: low confidence: 87.4% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 28.8% (LOW) · Higher = larger blast radius
28.8%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 87.4% · Lower = rushed or shallow review
87.4%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 3.6% · Safe to merge
3.6%