[clang] [llvm] Add length builtins and length HLSL function to DirectX Backend (PR #101256)

Farzon Lotfi via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 2 16:11:46 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 scalar types
+; CHECK: error: invalid intrinsic signature
+
+define noundef float @test_length_float(float noundef %p0) {
+entry:
+  %hlsl.length = call float @llvm.dx.length.f32(float %p0)
----------------
farzonl wrote:

We get this error for free from how we define the intrinsic.  I thought what we wanted an error test for was `@llvm.dx.length.v1f32`?

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


More information about the cfe-commits mailing list