[llvm] [AMDGPU] make AMDGPUUniformIntrinsicCombine a function pass (PR #165265)

Pankaj Dwivedi via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 28 02:55:08 PDT 2025


================
@@ -126,6 +130,8 @@ define protected amdgpu_kernel void @trivial_waterfall_ne_zero(ptr addrspace(1)
 ; PASS-CHECK-NEXT:    br label %[[WHILE:.*]]
 ; PASS-CHECK:       [[WHILE]]:
 ; PASS-CHECK-NEXT:    [[DONE:%.*]] = phi i1 [ false, %[[ENTRY]] ], [ true, %[[IF:.*]] ]
+; PASS-CHECK-NEXT:    [[BALLOT:%.*]] = tail call i64 @llvm.amdgcn.ballot.i64(i1 [[DONE]])
----------------
PankajDwivedi-25 wrote:

other approach would be, but it will be extra work.

> SmallVector<Instruction *, 8> ToErase;
> 
> for (Instruction &I : instructions(F)) {
>   if (tryOptimize(&I, Tracker))
>     ToErase.push_back(&I);
> }
> 
> for (Instruction *I : ToErase)
>   I->eraseFromParent();


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


More information about the llvm-commits mailing list