Page MenuHomePhabricator

[AMDGPU] Resolve issues when picking between ds_read/write and ds_read2/write2

Authored by mbrkusanin on Dec 7 2020, 7:50 AM.



Both ds_read_b128 and ds_read2_b64 are valid for 128bit 16-byte aligned
loads but the one that will be selected is determined either by the order in
tablegen or by the AddedComplexity attribute. Currently ds_read_b128 has

While ds_read2_b64 has lower alignment requirements, we cannot always
restrict ds_read_b128 to 16-byte alignment because of unaligned-access-mode
option. This was causing ds_read_b128 to be selected for 8-byte aligned
loads regardles of chosen access mode.

To resolve this we use two patterns for selecting ds_read_b128. One
requires alignment of 16-byte and the other requires
unaligned-access-mode option.

Same goes for ds_write2_b64 and ds_write_b128.

Diff Detail

Event Timeline

mbrkusanin created this revision.Dec 7 2020, 7:50 AM
mbrkusanin requested review of this revision.Dec 7 2020, 7:50 AM
foad added inline comments.Dec 7 2020, 8:00 AM

Can't we relax this predicate to "isGFX7Plus" instead of duplicating the patterns?

mbrkusanin updated this revision to Diff 310111.Dec 8 2020, 1:55 AM
mbrkusanin marked an inline comment as done.
mbrkusanin added inline comments.

Right. That way we do not increase number of patterns.

foad accepted this revision.Dec 10 2020, 3:34 AM

Looks good, thanks!

This revision is now accepted and ready to land.Dec 10 2020, 3:34 AM