[clang] [llvm] Add length HLSL function to DirectX Backend (PR #101256)
Justin Bogner via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 1 11:11:21 PDT 2024
================
@@ -0,0 +1,10 @@
+; RUN: not opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s 2>&1 | FileCheck %s
+
+; DXIL operation length does not support double overload type
+; CHECK: LLVM ERROR: Invalid Overload
+
+define noundef double @test_length_double2(<2 x double> noundef %p0) {
+entry:
+ %hlsl.length = call double @llvm.dx.length.v2f32(<2 x double> %p0)
+ ret double %hlsl.length
+}
----------------
bogner wrote:
Do we also need a test that we error on `dx.length` of a scalar?
https://github.com/llvm/llvm-project/pull/101256
More information about the llvm-commits
mailing list