[Mlir-commits] [mlir] [mlir][gpu] Add `gpu.subgroup_uniform` op (PR #157743)
Alessandro Potenza
llvmlistbot at llvm.org
Wed Sep 2 06:54:24 PDT 2026
alepot55 wrote:
Following up on Fabian's point that whether a value is uniform is for an analysis to
decide: I have a prototype of that analysis on a branch,
https://github.com/alepot55/llvm-project/tree/uniformity-analysis. It is a sparse forward
dataflow analysis over structured control flow, with a scoped lattice
(`divergent < subgroup < workgroup < cluster < uniform`), an op interface through which
ops say how uniformity flows through them, and a first consumer that reports
`gpu.barrier` and friends executed in control flow that diverges within their scope.
On Ivan's example, `%v1` comes out divergent, because `%v` is. The analysis only reports
uniformity that does not depend on which lanes are active, so what it says stays true when
a value is hoisted, which is also the answer to the speculatability question: "uniform at
definition with all lanes active" becomes two queries, one on the value and one on the
control flow enclosing its definition, and both are computed.
I would like to send it as a small PR series this week. If anyone would rather see a
Discourse thread first, say so and I will write one.
https://github.com/llvm/llvm-project/pull/157743
More information about the Mlir-commits
mailing list