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.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
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. |
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:
- 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.
- 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:
- 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.
- 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.
Updated the docs to clearly describe the new behaviour around m-converged
property and uniformity.
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.