This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Consider loads from flat addrspace to be potentially divergent
ClosedPublic

Authored by scott.linder on Aug 20 2018, 12:54 PM.

Details

Summary

Loads through flat addrspace to non-uniform values were being marked uniform. In general we can't assume flat loads are uniform, and cases where we can prove they are should be handled through infer-address-spaces.

Diff Detail

Event Timeline

scott.linder created this revision.Aug 20 2018, 12:54 PM
arsenm added inline comments.Aug 20 2018, 1:06 PM
lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
556
on pervious line
test/CodeGen/AMDGPU/divergent-flat.ll
1–2

Test can be a lot simpler and put in test/Analysis/DivergenceAnalysis/AMDGPU with the rest

Run through clang-format; simplify and move test case.

arsenm added inline comments.Aug 21 2018, 7:36 AM
test/Analysis/DivergenceAnalysis/AMDGPU/divergent-flat.ll
5–12 ↗(On Diff #161552)

You don't need the addrspacecast, and it would be better to just have the argument be flat in the first place. This theoretically could be smarter and say yes in this case

5–12 ↗(On Diff #161552)

Also it looks like we are missing a test for the private case anyway. Can you just rename the test to loads and add a test for private as well?

Simplify test further and add a test for load from scratch.

arsenm accepted this revision.Aug 21 2018, 8:25 AM

LGTM

This revision is now accepted and ready to land.Aug 21 2018, 8:25 AM
This revision was automatically updated to reflect the committed changes.