This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: test for uniformity of branch instruction, not its condition
ClosedPublic

Authored by pendingchaos on Jan 4 2019, 1:06 PM.

Details

Summary

If a divergent branch instruction is marked as divergent by propagation
rule 2 in DivergencePropagator::exploreSyncDependency() and its condition
is uniform, that branch would incorrectly be assumed to be uniform.

Diff Detail

Repository
rL LLVM

Event Timeline

pendingchaos created this revision.Jan 4 2019, 1:06 PM

Not yet sure why the condition was not marked as divergent, but I think it was intentional.
Also not sure why the code was like this in the first place, but the new code seems to work fine.

arsenm added a comment.Jan 4 2019, 8:36 PM

Needs a test

pendingchaos updated this revision to Diff 180477.EditedJan 7 2019, 6:01 AM

Adds a test.

arsenm added inline comments.Jan 7 2019, 6:13 AM
test/CodeGen/AMDGPU/divergent-branch-uniform-condition.ll
8 ↗(On Diff #180477)

Wrong check prefix

9–11 ↗(On Diff #180477)

The checks are too thin. Maybe for this you should just use update_llc_test_checks?

Makes use of assertions generated by update_llc_test_checks.

arsenm accepted this revision.Jan 7 2019, 7:27 AM

LGTM

This revision is now accepted and ready to land.Jan 7 2019, 7:27 AM
This revision was automatically updated to reflect the committed changes.