[llvm] [SPIR-V] Emit OpLoopMerge for non-shader targets without SPV_INTEL_unstructured_loop_controls extension (PR #187519)
Juan Manuel Martinez CaamaƱo via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 30 04:46:04 PDT 2026
================
@@ -0,0 +1,108 @@
+; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv64-unknown-unknown %s -o - | FileCheck %s
+; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv64-unknown-unknown %s -o - -filetype=obj | spirv-val %}
+
+; Test that OpLoopMerge is emitted for non-shader targets without requiring
+; SPV_INTEL_unstructured_loop_controls.
+
+; Test 1: llvm.loop.unroll.enable -> OpLoopMerge with Unroll.
+; CHECK: OpFunction
+; CHECK: OpLoopMerge %[[#]] %[[#]] Unroll
+; CHECK: OpBranchConditional
+; CHECK: OpFunctionEnd
+
+define spir_kernel void @test_unroll_enable(ptr addrspace(1) %dst) {
----------------
jmmartinez wrote:
Thanks!
https://github.com/llvm/llvm-project/pull/187519
More information about the llvm-commits
mailing list