This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU/MemoryModel: Fix monotonic atomic loads
ClosedPublic

Authored by kzhuravl on Jan 18 2018, 11:43 AM.

Details

Summary

Those should have glc bit set for system and agent synchronization scopes

Diff Detail

Event Timeline

kzhuravl created this revision.Jan 18 2018, 11:43 AM
arsenm added inline comments.Jan 18 2018, 11:53 AM
lib/Target/AMDGPU/SIMemoryLegalizer.cpp
401–403

Can this be expressed in terms of one of the isStrongerThan* helpers?

Do we need tests for 64-bit atomic loads? Do we need tests for cases where we get buffer instead of flat instructions?

rampitec accepted this revision.Feb 5 2018, 6:01 PM
This revision is now accepted and ready to land.Feb 5 2018, 6:01 PM

rL324314. I will address review feedback in the follow up change.

t-tye accepted this revision.Feb 5 2018, 9:10 PM

LGTM other than @arsenm suggestion which may apply to some other places too. AtomicOrdering.h does not seem to other useful queries such as isAcquire/isRelease that could be used.

lib/Target/AMDGPU/SIMemoryLegalizer.cpp
401–403

Could probably be:

if (isStrongerThanMonotonic(MOI.getOrdering())) {

A load cannot be a release or acq_rel so returning true for those will not happen.