[clang] [llvm] [clang][HLSL] Add WaveIsFirstLane() intrinsic (PR #103299)

Farzon Lotfi via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 14 15:54:22 PDT 2024


================
@@ -18660,6 +18660,10 @@ case Builtin::BI__builtin_hlsl_elementwise_isinf: {
         llvm::FunctionType::get(IntTy, {}, false), "__hlsl_wave_get_lane_index",
         {}, false, true));
   }
+  case Builtin::BI__builtin_hlsl_wave_is_first_lane: {
+    Intrinsic::ID ID = CGM.getHLSLRuntime().getWaveIsFirstLaneIntrinsic();
+    return EmitRuntimeCall(Intrinsic::getDeclaration(&CGM.getModule(), ID));
----------------
farzonl wrote:

we typically have used `return Builder.CreateIntrinsic(...);` Whats the reason\advantage to using EmitRuntimeCall?

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


More information about the llvm-commits mailing list