[clang] [llvm] [HLSL] Add WaveGetLaneCount() intrinsic to FE (PR #143127)

Nathan Gauër via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 6 08:48:58 PDT 2025


================
@@ -691,6 +691,11 @@ Value *CodeGenFunction::EmitHLSLBuiltinExpr(unsigned BuiltinID,
     return EmitRuntimeCall(
         Intrinsic::getOrInsertDeclaration(&CGM.getModule(), ID));
   }
+  case Builtin::BI__builtin_hlsl_wave_get_lane_count: {
+    Intrinsic::ID ID = CGM.getHLSLRuntime().getWaveGetLaneCountIntrinsic();
+    return EmitRuntimeCall(
----------------
Keenuts wrote:

Reason why other wave intrinsics are using this instead of Builder.CreateIntrinsics are convergence intrinsics: correctly adding the token to the call.

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


More information about the llvm-commits mailing list