[llvm] [WIP][InstCombine] Add assume-based optimizations for equality and AMDGPU ballot patterns (PR #160670)

Teja Alaghari via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 2 22:42:52 PST 2025


TejaX-Alaghari wrote:

> Also, this work should be done in some AMDGPU IR pass.

Per my preliminary understanding so far, I'd like to propose implementing this logic in `AMDGPUUniformIntrinsicCombine` pass.
As this pass already handles optimizing AMDGPU specific intrinsics when their operands are uniform (including ballot), I think this pass can be extended to handle the assume-ballot truth value propagation.

Also this pass seems to run early before GVN, which might be beneficial to take advantage of its optimizations as well.

One downside is, I might need to add a new dependency for injecting Assume intrinsics related data in this pass.

@ssahasra and @PankajDwivedi-25, Please help me zero-in on identifying the right pass

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


More information about the llvm-commits mailing list