This is an archive of the discontinued LLVM Phabricator instance.

[llvm][Uniformity] consistently handle uniform instructions
ClosedPublic

Authored by sameerds on Mar 8 2023, 3:40 AM.

Details

Summary

An instruction that is "always uniform" is so even if it occurs in an
irreducible cycle. The output produced by such an instruction may depend on the
implementation defined cycle hierarchy, but that does not affect the uniformity
of the output. In other words, an "always uniform" instruction is uniform even
if it is not m-converged.

Diff Detail

Event Timeline

sameerds created this revision.Mar 8 2023, 3:40 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 8 2023, 3:40 AM
sameerds requested review of this revision.Mar 8 2023, 3:40 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 8 2023, 3:40 AM
ronlieb accepted this revision.Mar 8 2023, 7:18 AM
ronlieb added a subscriber: ronlieb.

LGTM, as this resolves our downstream assertions seen in our CI

This revision is now accepted and ready to land.Mar 8 2023, 7:18 AM

LGTM, as this resolves our downstream assertions seen in our CI

Why would this fix an assertion? The description sounds like this is just an improvement. I think we need a reproducer for the assertion.

LGTM, as this resolves our downstream assertions seen in our CI

Why would this fix an assertion? The description sounds like this is just an improvement. I think we need a reproducer for the assertion.

Please see the comment regarding pushUsers().

llvm/lib/Analysis/UniformityAnalysis.cpp
62

This is the assertion that got fired. Earlier, if an operation X occurred in a cycle C that was assumed to be divergent, would assume that X is also divergent even if it is always uniform. Then when we try to call pushUsers() on X, it would assert. The lit test in this change is an example of exactly that happening.

LGTM, as this resolves our downstream assertions seen in our CI

Why would this fix an assertion? The description sounds like this is just an improvement. I think we need a reproducer for the assertion.

Please see the comment regarding pushUsers().

Thanks for the point. Another question is does this affect a value defined in a divergent loop but used outside the loop case? For that situation, we still have to say the value is divergent.

LGTM, as this resolves our downstream assertions seen in our CI

Why would this fix an assertion? The description sounds like this is just an improvement. I think we need a reproducer for the assertion.

Please see the comment regarding pushUsers().

Thanks for the point. Another question is does this affect a value defined in a divergent loop but used outside the loop case? For that situation, we still have to say the value is divergent.

I am not sure what your question is:

  1. Cycle is assumed to be divergent because it is irreducible. But operations that are always uniform need not be assumed to be divergent. That is this case.
  2. Cycle has divergent exit. Value that is always uniform may still be divergent at its used. That is separately handled by temporal divergence.

I am not sure what your question is:

  1. Cycle is assumed to be divergent because it is irreducible. But operations that are always uniform need not be assumed to be divergent. That is this case.
  2. Cycle has divergent exit. Value that is always uniform may still be divergent at its used. That is separately handled by temporal divergence.

I am asking for the second. thanks for the explanation.

sameerds updated this revision to Diff 503678.Mar 9 2023, 1:04 AM

Updated the docs to clearly describe the new behaviour around m-converged
property and uniformity.

ruiling accepted this revision.Mar 9 2023, 3:41 AM

LGTM

This revision was landed with ongoing or failed builds.Mar 10 2023, 12:54 AM
This revision was automatically updated to reflect the committed changes.