Debian Codegraph @

llvm/test/CodeGen/SPIRV/dominator-order.ll

raw
1 ; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv64-unknown-unknown %s -o - | FileCheck %s
2 ; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv64-unknown-unknown %s -o - -filetype=obj | spirv-val %}
3
4 ; This test checks that basic blocks are reordered in SPIR-V so that dominators
5 ; are emitted ahead of their dominated blocks as required by the SPIR-V
6 ; specification.
7
8 ; CHECK-DAG: OpName %[[#ENTRY:]] "entry"
9 ; CHECK-DAG: OpName %[[#FOR_BODY137_LR_PH:]] "for.body137.lr.ph"
10 ; CHECK-DAG: OpName %[[#FOR_BODY:]] "for.body"
11
12 ; CHECK: %[[#ENTRY]] = OpLabel
13 ; CHECK: %[[#FOR_BODY]] = OpLabel
14 ; CHECK: %[[#FOR_BODY137_LR_PH]] = OpLabel
15
16 define spir_kernel void @test(ptr addrspace(1) %arg, i1 %cond) {
17 entry:
18 br label %for.body
19
20 for.body137.lr.ph: ; preds = %for.body
21 ret void
22
23 for.body: ; preds = %for.body, %entry
24 br i1 %cond, label %for.body, label %for.body137.lr.ph
25 }