Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AMDGPU][NFCI] Refactor BUFInstructions.td #65746

Merged
merged 1 commit into from
Sep 11, 2023
Merged

Conversation

piotrAMD
Copy link
Collaborator

@piotrAMD piotrAMD commented Sep 8, 2023

Make the code more consistent:

  • More pattern classes follow the simpler interface with string instead of pseudos.
  • CmpSwap patterns are encapsulated in SIBufferAtomicCmpSwapPat.
  • Pseudo store patterns are separated out, similarly to the load counterparts.
  • MUBUF_Offset_Load_Pat is now GCNPat, as others.

Make the code more consistent:
- More pattern classes follow the simpler interface with string
instead of pseudos.
- CmpSwap patterns are encapsulated in SIBufferAtomicCmpSwapPat.
- Pseudo store patterns are separated out, similarly to the load
counterparts.
- MUBUF_Offset_Load_Pat is now GCNPat, as others.
@piotrAMD piotrAMD requested a review from a team as a code owner September 8, 2023 12:50

def _OFFSET : GCNPat <
(st store_vt:$vdata, (MUBUFOffset v4i32:$srsrc, i32:$soffset, i32:$offset)),
(!cast<MUBUF_Pseudo>(BaseInst # _OFFSET) store_vt:$vdata, v4i32:$srsrc, i32:$soffset, i32:$offset)>;
Copy link
Contributor

Choose a reason for hiding this comment

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

This part of the refactor may be a slight downgrade in sense that you need to explicitly specify the operands of the instruction when the pat is separate rather than part of the instruction definition.

Copy link
Contributor

Choose a reason for hiding this comment

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

This also makes it easier to fix arbitrary types for the mubuf global path

@piotrAMD piotrAMD merged commit 8fdf61a into llvm:main Sep 11, 2023
1 of 2 checks passed
@piotrAMD piotrAMD deleted the refactor branch September 11, 2023 06:04
ZijunZhaoCCK pushed a commit to ZijunZhaoCCK/llvm-project that referenced this pull request Sep 19, 2023
Make the code more consistent:
- More pattern classes follow the simpler interface with string instead
of pseudos.
- CmpSwap patterns are encapsulated in SIBufferAtomicCmpSwapPat.
- Pseudo store patterns are separated out, similarly to the load
counterparts.
- MUBUF_Offset_Load_Pat is now GCNPat, as others.
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.

None yet

3 participants