[llvm] [IndVarSimplify] Fix `IndVarSimplify` to skip on unfolding predicates when the loop contains control convergence operations. (PR #165643)

Steven Perron via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 4 06:44:33 PST 2025


================
@@ -0,0 +1,98 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; RUN: opt < %s -passes=indvars -indvars-predicate-loops=1 -S | FileCheck %s
+
+; Loop with body using loop convergence token should be skipped by IndVarSimplify.
+
+%"class.hlsl::RWStructuredBuffer" = type { target("spirv.VulkanBuffer", [0 x i32], 12, 1), target("spirv.VulkanBuffer", i32, 12, 1) }
+
+ at _ZL3Out = internal global %"class.hlsl::RWStructuredBuffer" poison, align 8
+ at .str = private unnamed_addr constant [4 x i8] c"Out\00", align 1
----------------
s-perron wrote:

You can simplify the tests. Reduce the llvm-ir to only what is necessary for testing the transformation. All of the HLSL resource code can be removed. That will make the test much cleaner. 

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


More information about the llvm-commits mailing list