[clang] [llvm] Add length HLSL function to DirectX Backend (PR #101256)
Farzon Lotfi via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 1 11:06:47 PDT 2024
================
@@ -63,5 +63,6 @@ let TargetPrefix = "spv" in {
def int_spv_frac : DefaultAttrsIntrinsic<[LLVMMatchType<0>], [llvm_anyfloat_ty]>;
def int_spv_lerp : Intrinsic<[LLVMMatchType<0>], [llvm_anyfloat_ty, LLVMMatchType<0>,LLVMMatchType<0>],
[IntrNoMem, IntrWillReturn] >;
+ def int_spv_length : DefaultAttrsIntrinsic<[LLVMVectorElementType<0>], [llvm_anyfloat_ty]>;
----------------
farzonl wrote:
He has to define this because of `CGM.getHLSLRuntime().getLengthIntrinsic()`. the alternative would be to just emit `int_dx_length` in `CGBuiltin.cpp` until there is a spirv implementation. then swap in `getLengthIntrinsic`
https://github.com/llvm/llvm-project/pull/101256
More information about the llvm-commits
mailing list