This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU/MemOpsCluster] Compute `width` for `MIMG` instruction class.
ClosedPublic

Authored by hsmhsm on Jun 11 2020, 5:59 AM.

Details

Summary

width computation is missing for newly added MIMG
instruction class. Add it.

Diff Detail

Event Timeline

hsmhsm created this revision.Jun 11 2020, 5:59 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 11 2020, 5:59 AM
hsmhsm updated this revision to Diff 272646.Jun 23 2020, 2:14 AM

Added test.

foad added inline comments.Jun 23 2020, 2:32 AM
llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
400–401

Do you need this bit? Does it work if you just use "vdata" for all MIMG instructions?

foad added inline comments.Jun 23 2020, 2:34 AM
llvm/test/CodeGen/AMDGPU/cluster_stores.ll
8–10

I don't think this really adds any value to the test, unless you're going to check for specific numbers like "Width: 4" or similar?

hsmhsm marked 2 inline comments as done.Jun 23 2020, 2:53 AM
hsmhsm added inline comments.
llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
400–401

I do not know much about MIMG instructions, I added it based on my experience of dealing with other instructions. If you confirm only "vdata" is needed, then, I will update it.

llvm/test/CodeGen/AMDGPU/cluster_stores.ll
8–10

I can do that by extracting width by dbg dump, and updating the same in the test.

hsmhsm marked an inline comment as done.Jun 23 2020, 2:58 AM
hsmhsm added inline comments.
llvm/test/CodeGen/AMDGPU/cluster_stores.ll
8–10

Morever, to clarify, my intension here was to test that Width is greather than 0 (should not be 0)

hsmhsm updated this revision to Diff 272662.Jun 23 2020, 3:17 AM

Taken care of review comments by Jay.

hsmhsm marked 2 inline comments as done.Jun 23 2020, 3:19 AM
hsmhsm added inline comments.
llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
400–401

Done

llvm/test/CodeGen/AMDGPU/cluster_stores.ll
8–10

Done

foad accepted this revision.Jun 23 2020, 3:44 AM
This revision is now accepted and ready to land.Jun 23 2020, 3:44 AM
This revision was automatically updated to reflect the committed changes.