This is a reboot of the original design and implementation by
Nicolai Haehnle <nicolai.haehnle@amd.com>:
https://reviews.llvm.org/D85603
This change also obsoletes an earlier attempt at restarting the work on
convergence tokens:
https://reviews.llvm.org/D104504
Changes relative to D85603:
- Clean up the definition of a "convergent operation", a convergent call and convergent function.
- Clean up the relationship between dynamic instances, sets of threads and convergence tokens.
- Redistribute the formal rules into the definitions of the convergence intrinsics.
- Expand on the semantics of entering a function from outside LLVM, and the environment-defined outcome of the entry intrinsic.
- Replace the term "cycle" with "closed path". The static rules are defined in terms of closed paths, and then a relation is established with cycles.
- Specify that if a function contains a controlled convergent operation, then all convergent operations in that function must be controlled.
- Describe an optional procedure to infer tokens for uncontrolled convergent operations.
- Introduce controlled maximal convergence-before and controlled m-converged property as an update to the original properties in UniformityAnalysis.
- Additional constraint that a cycle heart can only occur in the header of a reducible cycle (natural loop).
Block is missing a terminator. Also should have a token use?