[llvm] [SPIR-V] Guard against infinite loop in decorateUsesAsNonUniform (PR #208224)
Arseniy Obolenskiy via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 10 00:01:30 PDT 2026
================
@@ -0,0 +1,41 @@
+; RUN: llc -O0 -mtriple=spirv1.6-unknown-vulkan1.3-compute %s -o - | FileCheck %s
+; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv1.6-unknown-vulkan1.3-compute %s -o - -filetype=obj | spirv-val %}
+
+; A non-uniform index carried across a loop through a phi creates an SSA cycle
+; (phi <-> add) in the use walk that propagates the NonUniformEXT decoration.
+; Check that codegen terminates and still decorates both the loop-carried index
+; phi and the access chain derived from it.
+
+target triple = "spirv1.6-unknown-vulkan1.3-compute"
+
+; CHECK-DAG: OpCapability Shader
+; CHECK-DAG: OpCapability ShaderNonUniformEXT
+; CHECK-DAG: OpCapability StorageTexelBufferArrayNonUniformIndexingEXT
+; CHECK-DAG: %[[#phi:]] = OpPhi {{.*}}
----------------
aobolensk wrote:
Applied
https://github.com/llvm/llvm-project/pull/208224
More information about the llvm-commits
mailing list