Backport llvm/llvm-project#243287: avoid quadratic deadness cache invalidation #3979
All Vouch review confidence checks passed
Residual risk 0.14 = Change Risk (0.33) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.33 · 139 lines diff across 1 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
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.296
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #3979"
general
weight: 0.35
wsmoses
Fixes #3962 until the upstream fix reaches XLA's LLVM.
Since llvm/llvm-project#231423, the greedy rewriter's
DeadnessListener::notifyOperationModifiedcallsDeadnessCache::invalidate, which walks all IR nested under the modified op.replaceAllUsesWithnotifies each user as modified, so replacing many operands of astablehlo.whilewalks the whole loop body each time: replacements × body size. In a reverse-mode gradient through a checkpointed loop (NumericalEarth/NumericalEarth.jl#855) this spent over an hour inGetSimplify,TransposeWhileand constant deduplication.Upstream fix: llvm/llvm-project#243287, which invalidates only the op and its ancestors (as
notifyOperationInsertedalready does for moves).patches/llvm_greedy_deadness_modified.patch: the one-line changeworkspace.bzl: applies it to XLA's LLVM, like the other LLVM backports; drop once XLA's LLVM includes #243287Checked that the patch applies to the pinned LLVM (
de574ff51d, via JAXfa5ce586→ XLAd15fafb1). Not yet built or timed locally.🤖 Generated with Claude Code