[stinkytofu] Fix verifier false positive for SGPR source on VOP2/VOPC instructions#7270
Merged
Merged
Conversation
… 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.
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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
promotedFieldsbefore reporting a register type mismatch.v_mul_u32_u24,v_cmp_eq_u32,v_cmp_gt_u32, andv_cmp_ge_u32with SGPR in src1.Test plan
FileCheck.verifier_vop2_sgpr_srcpasses🤖 Generated with Claude Code