Skip to content

[stinkytofu] Fix verifier false positive for SGPR source on VOP2/VOPC instructions#7270

Merged
KKyang merged 1 commit into
developfrom
yanghuan/fix-verifier-vop3-sgpr-src
May 11, 2026
Merged

[stinkytofu] Fix verifier false positive for SGPR source on VOP2/VOPC instructions#7270
KKyang merged 1 commit into
developfrom
yanghuan/fix-verifier-vop3-sgpr-src

Conversation

@KKyang
Copy link
Copy Markdown
Contributor

@KKyang KKyang commented May 11, 2026

Summary

  • The IR verifier's register type check only consulted the base VOP2 encoding, which restricts src1 to VGPR. VALU instructions with an SGPR in src1 are valid because the assembler promotes to VOP3 encoding, where src1 accepts both VGPR and SGPR.
  • The verifier now falls back to promotedFields before reporting a register type mismatch.
  • Adds FileCheck test covering v_mul_u32_u24, v_cmp_eq_u32, v_cmp_gt_u32, and v_cmp_ge_u32 with SGPR in src1.

Test plan

  • All 562 ctest pass (unit tests + FileCheck)
  • New test FileCheck.verifier_vop2_sgpr_src passes

🤖 Generated with Claude Code

… instructions

The register type checker only consulted the base encoding's operand
fields.  VOP2/VOP2_COMMUTATIVE formats define src1 as vgpr, but the
assembler promotes to VOP3 encoding when an SGPR appears, where src1
accepts both VGPR and SGPR.  The verifier now falls back to
promotedFields before reporting a type mismatch.

Adds FileCheck test verifier_vop2_sgpr_src.stir covering v_mul_u32_u24,
v_cmp_eq_u32, v_cmp_gt_u32, and v_cmp_ge_u32 with SGPR in src1.
Copy link
Copy Markdown
Contributor

@hcman2 hcman2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ya

@KKyang KKyang merged commit 88d2185 into develop May 11, 2026
33 of 34 checks passed
@KKyang KKyang deleted the yanghuan/fix-verifier-vop3-sgpr-src branch May 11, 2026 11:06
amontoison pushed a commit to amontoison/rocm-libraries that referenced this pull request May 13, 2026
… instructions (ROCm#7270)

## Summary
- The IR verifier's register type check only consulted the base VOP2
encoding, which restricts src1 to VGPR. VALU instructions with an SGPR
in src1 are valid because the assembler promotes to VOP3 encoding, where
src1 accepts both VGPR and SGPR.
- The verifier now falls back to `promotedFields` before reporting a
register type mismatch.
- Adds FileCheck test covering `v_mul_u32_u24`, `v_cmp_eq_u32`,
`v_cmp_gt_u32`, and `v_cmp_ge_u32` with SGPR in src1.

## Test plan
- [x] All 562 ctest pass (unit tests + FileCheck)
- [x] New test `FileCheck.verifier_vop2_sgpr_src` passes

🤖 Generated with [Claude Code](https://claude.ai/claude-code)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants