================
@@ -0,0 +1,55 @@
+; RUN: llc -mtriple=spirv-unknown-vulkan1.3-vertex -o - %s | FileCheck %s
+; RUN: %if spirv-tools %{ llc -mtriple=spirv-unknown-vulkan1.3-vertex \
+; RUN:   -filetype=obj -o - %s | spirv-val --target-env vulkan1.3 %}
+;
+; Confirm that an addrspace(7) global protected by llvm.compiler.used appears
+; in the SPIR-V output as a distinct OpVariable, even though it has no IR 
users.
+;
+; @used_input has a real load. @dead_input is only in llvm.compiler.used.
+;
+; %[[#USED]] and %[[#DEAD]] capture different IDs (Location 0 vs 1), so the
+; OpVariable checks below require two distinct OpVariable Input instructions.
+;
+; Without the processGlobalValue fix in SPIRVEmitIntrinsics.cpp, @dead_input
+; gets no spv_unref_global, buildGlobalVariable is never called for it, and
+; both OpDecorate Location 1 and the second OpVariable Input are absent.
+
+; CHECK: OpCapability Shader
+; CHECK: OpEntryPoint Vertex %[[#]] "main"
----------------
s-perron wrote:

I think you need the dead variables to appear in the OpEntryPoint as well. We 
should be checking for that.

https://github.com/llvm/llvm-project/pull/196404
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to