[clang] [llvm] Implement WaveGetLaneCount SPIRV lowering (PR #227160)
Farzon Lotfi via cfe-commits
cfe-commits at lists.llvm.org
Wed Oct 7 12:50:49 PDT 2026
================
@@ -49,6 +58,22 @@
} \
}
+// 3-arg form: explicit SPIR-V postfix override (perfect for wave->subgroup)
+#define GENERATE_HLSL_INTRINSIC_FUNCTION3(FunctionName, DxilPostfix, \
+ SpirvPostfix) \
----------------
farzonl wrote:
This isn't a scalable solution if we need to adopt say a third backed for HLSL. Are we just going to add a GENERATE_HLSL_INTRINSIC_FUNCTION4?
Also so much repeated code here between GENERATE_HLSL_INTRINSIC_FUNCTION2 and GENERATE_HLSL_INTRINSIC_FUNCTION3 why couldn't we just make GENERATE_HLSL_INTRINSIC_FUNCTION take 3 args by default?
Or if you are really trying to avoid touching all the `GENERATE_HLSL_INTRINSIC_FUNCTION` Define two macros a GENERATE_HLSL_INTRINSIC_FUNCTION and a GENERATE_HLSL_INTRINSIC_FUNC_BASE. make Base be the three arg version and GENERATE_HLSL_INTRINSIC_FUNCTION be the two arg version. then call the two arg vs 3 arg version indepdendtly.
https://github.com/llvm/llvm-project/pull/227160
More information about the cfe-commits
mailing list