This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Reorganize GCN subtarget features for unaligned access
ClosedPublic

Authored by mbrkusanin on Jul 24 2020, 5:58 AM.

Details

Summary

Features UnalignedBufferAccess and UnalignedDSAccess are now used to determine
whether hardware supports such access.
UnalignedAccessMode should be used to enable them.
hasUnalignedBufferAccessEnabled() and hasNoUnalignedDSAccessSupport() can be
now used to quickly check both.

Diff Detail

Event Timeline

mbrkusanin created this revision.Jul 24 2020, 5:58 AM
arsenm accepted this revision.Jul 24 2020, 6:11 AM
This revision is now accepted and ready to land.Jul 24 2020, 6:11 AM
arsenm added inline comments.Aug 10 2020, 12:08 PM
llvm/lib/Target/AMDGPU/AMDGPU.td
90

I think we still need something to indicate the hardware supports the unaligned global/buffer memory vs. the driver set the config register to use it.

93

Hardware support for unaligned global loads and stores

107–108

Maybe change "Support" to "Enable" since this is the "dynamic" control. Also could make it clearer that this doesn't allow these on targets that don't support that specific memory space.

Should also probably move this down to the section under // Subtarget Features (options and debugging)

llvm/lib/Target/AMDGPU/SIISelLowering.cpp
1452

Probably needs to logically be hasUnalignedAccessMode && hardwareSupportsUnalignedGlobal (unless we somehow force off the dynamic mode feature if the hardware doesn't support it). maybe this should follow the model of ECC/XNACK

mbrkusanin retitled this revision from [AMDGPU] Merge UnalignedBufferAccess into UnalignedAccessMode to [AMDGPU] Reorganize GCN subtarget features for unaligned access.
mbrkusanin edited the summary of this revision. (Show Details)
  • Addressed comments.

Reworked features to use ECC/XNACK model but this way FeatureDoesNotSupportUnalignedBufferAccess and FeatureDoesNotSupportUnalignedDSAccess seem kind of redundant (and long). It does make it more clear what each feature is supposed to do.

arsenm accepted this revision.Aug 18 2020, 9:12 AM

LGTM

mbrkusanin requested review of this revision.Aug 18 2020, 9:12 AM
This comment was removed by mbrkusanin.

Sorry, unfortunate timing. I removed your "accept revision".

arsenm accepted this revision.Aug 18 2020, 9:14 AM
This revision is now accepted and ready to land.Aug 18 2020, 9:14 AM
t-tye requested changes to this revision.Aug 18 2020, 3:38 PM

We are about to change the xnack and sramecc subtarget features to remove the "DoesNot" so I would suggest that FeatureDoesNotSupportUnalignedBufferAccess changes to FeatureSupportUnalignedBufferAccess.

This revision now requires changes to proceed.Aug 18 2020, 3:38 PM
  • Removed FeatureDoesNot* ones.
t-tye resigned from this revision.Aug 20 2020, 8:58 AM

Thanks for updating the subtarget features. I defer to @arsenm for the rest of the review.

This revision is now accepted and ready to land.Aug 20 2020, 8:58 AM
arsenm accepted this revision.Aug 20 2020, 9:20 AM
foad added a comment.Nov 11 2020, 6:53 AM

mbrkusanin added a reverting change: rG8b08fa0103c8: Revert "[AMDGPU] Reorganize GCN subtarget features for unaligned access".

Revert "[AMDGPU] Reorganize GCN subtarget features for unaligned access"

This reverts commit f5cd7ec9f3fc969ff5e1feed961996844333de3b.

Certain rocPRIM/rocThrust/hipCUB tests were failing because of this change.

I fixed the underlying problems with D90607 and reapplied this patch in 830ed64ccd28bfa72fe93636e165f4e15a1d3af9.