Skip to content

fix(rocjitsu): Add InstDefUse Checks to Handle Partial Defs - #7979

Merged
theSK2005 merged 7 commits into
developfrom
users/skushwah/liveness-partial-def
Jul 14, 2026
Merged

theSK2005 merged 7 commits into
developfrom
users/skushwah/liveness-partial-def

Conversation

@theSK2005

@theSK2005 theSK2005 commented Jun 29, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

Some instructions have dst operands that are under 32 bits wide. These will be a partial write for 32 bit registers and InstDefUse/liveness need to account for this and not have incorrect kills.

Technical Details

Added a check for dst operand size to add as uses if their bit size is less than 32. Remaining logic is handled by current liveness implementation

JIRA ID

Test Plan

Write tests to make sure partial defs don't cause incorrect kills and that full defs continue to cause correct kills. All prior tests pass.

Test Result

New tests pass, prior tests all pass.

Submission Checklist

@theSK2005
theSK2005 requested review from a team and atgutier as code owners June 29, 2026 22:09
@therock-pr-bot

therock-pr-bot Bot commented Jun 29, 2026 •

Copy link
Copy Markdown

❌ PR Check — Action Required

Check Status Details
🌿 Branch Name ✅ Pass —
📝 PR Title/Description ❌ Fail Error: PR description must reference a JIRA ID, ISSUE ID, or a GitHub closing keyword.
Expected: include a JIRA ID / ISSUE ID line (separator : or -, or omitted; value may be a JIRA key, a number with/without #, or a link), OR a closing keyword + issue reference. Accepted examples:
• JIRA ID : TESTAUTO-6039
• JIRA ID - #330
• JIRA ID #330
• ISSUE ID : TESTUTO-3334
• ISSUE ID #3334
• ISSUE ID - TESTAUTO-3433
• ISSUE ID : https://github.com/<org_name>/<repo_name>/issues/1234
• Closes #10
• Fixes octo-org/octo-repo#100
• Resolves: #123
• #123
• https://github.com/<org_name>/<repo_name>/issues/123
Current: no valid JIRA/ISSUE/closing-keyword reference found
⛔ Forbidden Files ✅ Pass —
🧪 Unit Test ✅ Pass —
🔎 pre-commit ✅ Pass —
🚫 Draft PR 🔜 To Be Enabled —
🚩 Feature Flag 🔜 To Be Enabled —
📊 Code Coverage 🔜 To Be Enabled —

⚠️ 1 policy check(s) failed. Please address the issues above before this PR can be Reviewed.

🚫 Please fix the failed policies

  • ❌ PR Title/Description

The Not ready to Review label was added to this PR. Once all policies pass, the label is removed automatically.

📖 Need help? See the Policy FAQ for details on every check and how to fix failures.

@therock-pr-bot

Copy link
Copy Markdown

🚫 Please fix the failed policies before requesting reviews.

The following policy checks failed:

  • ❌ PR Title/Description

The Not ready to Review label has been added to this PR.
Once all policies pass, the label will be removed automatically.

@accauble accauble left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good but consider addressing a couple nits.

@theSK2005
theSK2005 requested review from accauble and newling July 1, 2026 21:21

@newling newling left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@theSK2005
theSK2005 requested a review from kuhar July 7, 2026 19:58
@theSK2005
theSK2005 requested a review from Groverkss July 9, 2026 19:14
@theSK2005
theSK2005 force-pushed the users/skushwah/liveness-partial-def branch from 8550bf4 to 227b377 Compare July 10, 2026 23:05
@theSK2005
theSK2005 merged commit 9e23d57 into develop Jul 14, 2026
25 of 27 checks passed
@theSK2005
theSK2005 deleted the users/skushwah/liveness-partial-def branch July 14, 2026 16:33
theSK2005 added a commit that referenced this pull request Aug 8, 2026
## Motivation
D16 memory loads are 16 bit writes into VGPRs. These operations
currently are seen as full defs by liveness analysis since VDST is only
a dst and not a src and has a 32 bit operand size so PR #7979 won't
cover it.

## Technical Details

Added check in _generator.py's _dst_is_also_source to cover d16 load
operations and have codegen write VDST as both a dst and a src.

Fixed existing semantics.py bug that didn't use _BUFFER_FORMAT_MAP for
derive_mubuf which left many instructions unimplemented and not properly
flagged.

## Test Plan

- Verify InstDefUse on decoded D16 instructions sees VDST as a src and a
dst.
- Verify all other tests pass.

## Test Result
All tests pass

## Submission Checklist
- [ ] Look over the contributing guidelines at
https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

4 participants