[PATCH] D130746: RFC: Uniformity Analysis for Irreducible Control Flow

Sameer Sahasrabuddhe via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 29 21:01:31 PST 2022


sameerds added a comment.

In D130746#3957708 <https://reviews.llvm.org/D130746#3957708>, @krzysz00 wrote:

> Ok, so, just to make sure I'm understanding my skim correctly
>
> - The uniformity analysis refines the existing divergence analysis, allowing us to more precisely determine if a particular value is uniform
> - The main contribution is better handling of irreducible control flow by way of a bunch of stuff about cycle headers that's explained in the talk
> - On top of that, this is a refactor of the old analysis to allow it to work on MIR as well

Correct.

> One thing I'm slightly hazy on is how the results of this analysis relate to the old analysis. I //think// that the new code will mark some things convergent that the old analysis marked divergent conservatively, but I'm not sure.

Correct.

> Also, if the uniformity analysis strictly improves the divergence analysis, is there a plan for removing the old analysis after this lands?

UniformityAnalysis depends on CycleInfo, while DivergenceAnalysis depends on LoopInfo. This is an outcome of the "improved" handling of irreducible CFGs. Wherever this distinction is okay, AMDGPU definitely intends to replace DA with the new UA. For example, the CodeGen for AMDGPU still uses LegacyDivergenceAnalysis as a wrapper around DivergenceAnalysis for historic reasons. This new analysis will eliminate that.

An example of where the dependence on CycleInfo will need a closer look is in the loop transforms in the optimizer. They update LoopInfo but not CycleInfo. It's too early to say if it is worthwhile to implement incremental updates to CycleInfo. It's possible that initially, if we want to use UniformityAnalysis, we will simply recompute CycleInfo. This is not too a problem because UniformityAnalysis needs to be recomputed anyway before use. Note that every loop in LoopInfo is a subset of some cycle in CycleInfo: https://llvm.org/docs/CycleTerminology.html


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D130746/new/

https://reviews.llvm.org/D130746



More information about the llvm-commits mailing list