This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU/SI: Consolidate FLAT patterns
ClosedPublic

Authored by tstellarAMD on Dec 23 2015, 5:52 PM.

Details

Reviewers
cfang
arsenm
Summary

We had to sets of identical FLAT patterns one inside the
HasFlatAddressSpace predicate and one inside the useFlatForGloabl
predicate. This patch merges these sets into a single pattern
under the isCIVI predicate.

The reason we can remove the predicates is that when MUBUF instructions
are legal, the instruction selector will prefer selecting those over
FLAT instructions because MUBUF patterns have a higher complexity score.
So, in this case having patterns for FLAT instructions will have no effect.

This change also simplifies the process for forcing global address space
loads to use FLAT instructions, since we no only have to disable the
MUBUF patterns instead of having to disable the MUBUF patterns and
enable the FLAT patterns.

Diff Detail

Event Timeline

tstellarAMD retitled this revision from to AMDGPU/SI: Consolidate FLAT patterns.
tstellarAMD updated this object.
tstellarAMD added reviewers: arsenm, cfang.
tstellarAMD added a subscriber: llvm-commits.
arsenm accepted this revision.Dec 23 2015, 8:51 PM
arsenm edited edge metadata.

Typo in message: useFlatForGloabl

LGTM

lib/Target/AMDGPU/SIInstrInfo.td
147

Maybe needs a comment for why constant isn't included

This revision is now accepted and ready to land.Dec 23 2015, 8:51 PM
cfang added inline comments.Dec 24 2015, 10:52 AM
lib/Target/AMDGPU/CIInstructions.td
205

Should this be [isCI] ?

tstellarAMD added inline comments.Jan 4 2016, 7:17 AM
lib/Target/AMDGPU/CIInstructions.td
205

isCI selects when subtarget is >= CI, isCIVI selects when subtarget == CI || subtarget == VI. I think we could use isCI, but I wanted to use isCIVI, in case the flat instructions change in a future chip.

lib/Target/AMDGPU/SIInstrInfo.td
147

Constant will be added in the next commit.