[clang] [AMDGPU] Use generic builtins for `wave_reduce` ops (PR #179589)

Shilei Tian via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 4 09:03:05 PST 2026


================
@@ -296,6 +296,42 @@ bool SemaAMDGPU::CheckAMDGCNBuiltinFunctionCall(unsigned BuiltinID,
     }
     return false;
   }
+  case AMDGPU::BI__builtin_amdgcn_wave_reduce_add:
+  case AMDGPU::BI__builtin_amdgcn_wave_reduce_and:
+  case AMDGPU::BI__builtin_amdgcn_wave_reduce_max:
+  case AMDGPU::BI__builtin_amdgcn_wave_reduce_min:
+  case AMDGPU::BI__builtin_amdgcn_wave_reduce_or:
+  case AMDGPU::BI__builtin_amdgcn_wave_reduce_sub:
+  case AMDGPU::BI__builtin_amdgcn_wave_reduce_xor: {
+    Expr *Val = TheCall->getArg(0);
+    if (Val->isTypeDependent())
----------------
shiltian wrote:

This might be `isInstantiationDependent`, if you were thinking about template.

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


More information about the cfe-commits mailing list