This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: mark llvm.amdgcn.image.atomic.* as a source of divergence
ClosedPublic

Authored by nhaehnle on Mar 11 2016, 2:47 PM.

Details

Summary

When multiple threads perform an atomic op with the same arguments, they
will usually see different return values.

Diff Detail

Event Timeline

nhaehnle updated this revision to Diff 50479.Mar 11 2016, 2:47 PM
nhaehnle retitled this revision from to AMDGPU: mark llvm.amdgcn.image.atomic.* as a source of divergence.
nhaehnle updated this object.
nhaehnle added reviewers: arsenm, tstellarAMD.
nhaehnle added a subscriber: llvm-commits.
arsenm accepted this revision.Mar 11 2016, 9:40 PM
arsenm edited edge metadata.

LGTM, although your test would be greatly simplified by just running the divergence analysis like is done in test/Analysis/DivergenceAnalysis/AMDGPU

Are the standard atomic instructions also reported as divergent?

This revision is now accepted and ready to land.Mar 11 2016, 9:40 PM
This revision was automatically updated to reflect the committed changes.

r263440 - committed with a simplified test.

From a brief check it looks like atomic instructions aren't marked as divergent.