llvm-project
6e2a720d - [AMDGPU][Uniformity][TTI] Make Uniformity Analysis Operand-Aware via Custom Uniformity Checks (#137639)

Commit
1 day ago
[AMDGPU][Uniformity][TTI] Make Uniformity Analysis Operand-Aware via Custom Uniformity Checks (#137639) See: https://github.com/llvm/llvm-project/issues/131779 Extends uniformity analysis to support instructions whose uniformity depends on which specific operands are uniform. Introduces `InstructionUniformity::Custom` and a target hook `TTI::isUniform(I, UniformArgs)` that allows targets to define custom uniformity rules. During propagation, custom candidates are checked via the target hook. If we can prove they are uniform, we skip marking them divergent and let iterative propagation re-evaluate as operands change. Implements AMDGPU's `llvm.amdgcn.wave.shuffle` rules (uniform when either operand is uniform, divergent only when both are divergent) as the motivating example. This inverted-logic approach is critical for correctness: proving uniformity early during propagation would be unsafe, as operands can transition from uniform to divergent during divergence propagation. --------- Co-authored-by: Matt Arsenault <arsenm2@gmail.com>
Parents
Loading