This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] ImmArg and SourceOfDivergence for permlane/dpp
ClosedPublic

Authored by rampitec on Jun 12 2019, 9:05 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

rampitec created this revision.Jun 12 2019, 9:05 AM

Needs tests in test/Analysis/DivergenceAnalysis, and test/Verifier/AMDGPU/intrinsic-immarg.ll

lib/Target/AMDGPU/AMDGPUSearchableTables.td
102–104 ↗(On Diff #204305)

I'm not 100% sure on DPP. If it's called with uniform arguments, even though you read from another lane, every lane should read the same value? Is this not the case with some of the source types?

rampitec updated this revision to Diff 204311.Jun 12 2019, 9:37 AM
rampitec marked an inline comment as done.

Added tests.

rampitec added inline comments.Jun 12 2019, 9:39 AM
lib/Target/AMDGPU/AMDGPUSearchableTables.td
102–104 ↗(On Diff #204305)

I think it is divergent even if all arguments are uniform. Another lane may have been updated when exec mask was different. Our DA considers values uniform only across active lanes. I.e. if you have and if..then a value inside a block will deem uniform even if it may be different in the else block.

rampitec marked 2 inline comments as done.
rampitec added inline comments.
lib/Target/AMDGPU/AMDGPUSearchableTables.td
102–104 ↗(On Diff #204305)

This is also likely a reason for RADV failure with Alexander's divergence driven ISel. There was a lot of dpp code there and most of the code around was scalarized.

arsenm accepted this revision.Jun 12 2019, 10:01 AM

LGTM

This revision is now accepted and ready to land.Jun 12 2019, 10:01 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJun 13 2019, 9:29 AM