Prune dead affine.if results in affine-cfg #3984
All Vouch review confidence checks passed
Residual risk 0.14 = Change Risk (0.36) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.36 · 206 lines diff across 2 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.319
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #3984"
general
weight: 0.35
wsmoses
Fixes raising to scatter/gather regression in https://numericalearth.github.io/BreezeBenchmarks/
---
affine-cfgcan leave anaffine.ifresult with no users: once it sinks the loads that read through a selected index into the branches, the index result is dead but still yielded.On a kernel over a flattened 16x16 thread index with a periodic halo read (
i == 1 ? Nx : i - 1), that dead index kept the non-affineiv - (iv / 16) * 16alive. This stoppedSplitParallelInductionsfrom splitting the index into its two dimensions, so every access stayed in terms ofj floordiv 16/j mod 16and the kernel raised to gathers and a scatter:llvm-to-affine-accessalready has a pattern for this (AffineIfDeadResults, #2932), but there the result is still in use. This PR exposes it aspopulateAffineIfDeadResultsPatternsand runs it inaffine-cfgtoo. The kernel now raises to slices, a concatenate for the wrap-around, and adynamic_update_slice.Test updates:
affinecfg_if_dead_result.mlir: new, a cut-down version of the kernel.liftintoif,northsouth{,2,3}: the dead index result and the constants feeding it are gone.affinecfg_select_hoist_capture: the whole if-nest was unused and is now removed, along with the hoisting the test covers. I added a store of its value to keep it in use.🤖 Generated with Claude Code