Page MenuHomePhabricator

[AMDGPU] Add some missing always-uniform values.
ClosedPublic

Authored by sheredom on Jan 17 2019, 4:09 AM.

Details

Summary

This commit adds some missing intrinsics into the isAlwaysUniform list for the AMDGPU backend.

Diff Detail

Repository
rL LLVM

Event Timeline

sheredom created this revision.Jan 17 2019, 4:09 AM

Needs tests

@arsenm agreed - not quite sure how to do tests for this? I started to look at how we test alias analysis, and they have a cl::opt to force print the debug info for that pass, and that is how our amdgpu-alias-analysis.ll tests the aliasing rules. How exactly to test that divergence analysis did something here?

@arsenm agreed - not quite sure how to do tests for this? I started to look at how we test alias analysis, and they have a cl::opt to force print the debug info for that pass, and that is how our amdgpu-alias-analysis.ll tests the aliasing rules. How exactly to test that divergence analysis did something here?

Add more cases to test/Analysis/DivergenceAnalysis/AMDGPU/always_uniform.ll?

sheredom updated this revision to Diff 182296.Jan 17 2019, 8:18 AM

Also tag s.getpc as scalar, and add tests in the Analysis folder like suggested.

arsenm added inline comments.Jan 17 2019, 8:24 AM
lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
584–585 ↗(On Diff #182296)

I think the presence of these two is questionable. getpc in particular should already behave correctly since it has no source operands. If s_buffer_load has divergent arguments, the program is broken anyway

test/Analysis/DivergenceAnalysis/AMDGPU/always_uniform.ll
3–4 ↗(On Diff #182296)

This should probably be renamed, it's really testing readfirstlane, not work item.id.x

sheredom updated this revision to Diff 182324.Jan 17 2019, 9:52 AM

Review comments.

arsenm accepted this revision.Jan 17 2019, 2:40 PM

LGTM with name fix

test/Analysis/DivergenceAnalysis/AMDGPU/always_uniform.ll
3–4 ↗(On Diff #182296)

You changed this but didn't change the name?

This revision is now accepted and ready to land.Jan 17 2019, 2:40 PM
sheredom updated this revision to Diff 182529.Jan 18 2019, 8:42 AM

Fix review comments.

sheredom marked 3 inline comments as done.Jan 18 2019, 8:42 AM
This revision was automatically updated to reflect the committed changes.