[clang] [llvm] [HLSL] Implement the `reflect` HLSL function (PR #122992)

Farzon Lotfi via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 17 16:47:24 PST 2025


================
@@ -0,0 +1,22 @@
+; RUN: not llc -verify-machineinstrs -O0 -mtriple=spirv64-unknown-unknown %s -o /dev/null 2>&1 | FileCheck %s
+; RUN: not llc -verify-machineinstrs -O0 -mtriple=spirv32-unknown-unknown %s -o /dev/null 2>&1 | FileCheck %s
+; RUN: not %if spirv-tools %{ llc -O0 -mtriple=spirv64-unknown-unknown %s -o /dev/null 2>&1 -filetype=obj %}
+; RUN: not %if spirv-tools %{ llc -O0 -mtriple=spirv32-unknown-unknown %s -o /dev/null 2>&1 -filetype=obj %}
+
+; CHECK: LLVM ERROR: Intrinsic selection not supported for this instruction set: %{{.*}} = G_INTRINSIC intrinsic(@llvm.spv.reflect), %{{.*}}, %{{.*}}
----------------
farzonl wrote:

This is my bad now that I'm seeing it  the lannguage is a bit obtuse and it doesn't look like instruction is encoded. We should simplify this error message.

Maybe:
```suggestion
; CHECK: LLVM ERROR: %{{.*}} = G_INTRINSIC intrinsic(@llvm.spv.reflect), % is only supported for GL instructions.
```
Or if you have something better go with that.

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


More information about the llvm-commits mailing list