feat(riscv): lower `x.with.overflow` intrinsics #2212
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.35) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.35 · 98 lines diff across 1 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 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
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.275
Ai Authored
ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #2212"
general
weight: 0.35
regehr
Lower
llvm.intr.{s,u}{add,sub,mul}.with.overflowto gMIR as LLVM's IRTranslator does: each intrinsic becomes one two-resultg_*o, and everyllvm.extractvalueof its struct is replaced by the matching result, so no operation is emitted for it. Any other use of the struct is rejected.Add
g_umuloandg_smulowith their semantics, and portLegalizerHelper::widenScalarMuloand theG_SMULO/G_UMULOlowering, with the RISC-V ruleminScalar(0, 64).lower(). The lowering is proved at every width (umulo_lowering,smulo_lowering).The intrinsics still have no semantics in the
llvmdialect, so the translation step itself is not proved.Adding these semantics require a bit more work in juggling the struct, I think we can split the PR for now.
Assisted by Claude.