[llvm] [Reassociate] Use UniformityInfo to group uniform operands together (PR #198507)

Pankaj Dwivedi via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 8 00:00:10 PDT 2026


================

----------------
PankajDwivedi-25 wrote:

we get ((u1 + u2) + d1) + d2, and don't need any particular starting shape. Reassociate's `LinearizeExprTree` flattens the whole same-opcode tree into a flat operand list {u1, d1, u2, d2} regardless of the input bracketing.

we then boost the divergent ranks, the existing stable_sort re-orders, and RewriteExprTree rebuilds a left-linear chain with the uniforms deepest and the divergents applied toward the root.
So it's the first form, not the balanced.

https://github.com/llvm/llvm-project/pull/198507


More information about the llvm-commits mailing list