[clang] [llvm] [HLSL][DXIL] Implement WaveGetLaneIndex Intrinsic (PR #111576)

Greg Roth via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 9 10:16:01 PDT 2024


================
@@ -18827,9 +18827,21 @@ case Builtin::BI__builtin_hlsl_elementwise_isinf: {
         ArrayRef<Value *>{Op0, Op1}, nullptr, "hlsl.step");
   }
   case Builtin::BI__builtin_hlsl_wave_get_lane_index: {
-    return EmitRuntimeCall(CGM.CreateRuntimeFunction(
-        llvm::FunctionType::get(IntTy, {}, false), "__hlsl_wave_get_lane_index",
-        {}, false, true));
+    // Since we don't define a SPIR-V intrinsic for the SPIR-V built-in from
+    // SPIRVBuiltins.td, manually get the matching name for the DirectX
+    // intrinsic and the demangled builtin name
----------------
pow2clk wrote:

I fear I missed some discussion explaining this, but why don't we add a builtin to SPIRVBuiltins.td?

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


More information about the cfe-commits mailing list