================
@@ -0,0 +1,13 @@
+; 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
+
+; CHECK: LLVM ERROR: %{{.*}} = G_INTRINSIC intrinsic(@llvm.spv.faceforward), 
%{{.*}}, %{{.*}}, %{{.*}} is only supported with the GLSL extended instruction 
set.
+
+define noundef <4 x float> @faceforward_float4(<4 x float> noundef %a, <4 x 
float> noundef %b, <4 x float> noundef %c) {
+entry:
+  %spv.faceforward = call <4 x float> @llvm.spv.faceforward.v4f32(<4 x float> 
%a, <4 x float> %b, <4 x float> %c)
----------------
farzonl wrote:

I'm a little concerned that we  might be pattern matching faceforward to an 
intrinsic that should only work for  vulkan targets. That would mean if you are 
trying to write faceforward source in openCL we would replace it with an 
intrinsic that will error.

So one of two things to make this valid.

1.  We don't do pattern matching if it isn't valid for all SPIRV targets
2.  We only do pattern matching in this specific case if we know we are 
targetting vulkan.

https://github.com/llvm/llvm-project/pull/139959
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to