|
| 1 | +; Copyright (C) Codeplay Software Limited |
| 2 | +; |
| 3 | +; Licensed under the Apache License, Version 2.0 (the "License") with LLVM |
| 4 | +; Exceptions; you may not use this file except in compliance with the License. |
| 5 | +; You may obtain a copy of the License at |
| 6 | +; |
| 7 | +; https://github.com/codeplaysoftware/oneapi-construction-kit/blob/main/LICENSE.txt |
| 8 | +; |
| 9 | +; Unless required by applicable law or agreed to in writing, software |
| 10 | +; distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 11 | +; WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 12 | +; License for the specific language governing permissions and limitations |
| 13 | +; under the License. |
| 14 | +; |
| 15 | +; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 16 | + |
| 17 | +; RUN: veczc -vecz-passes="cfg-convert" -vecz-simd-width=4 -S < %s | FileCheck %s |
| 18 | + |
| 19 | +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" |
| 20 | +target triple = "spir64-unknown-unknown" |
| 21 | + |
| 22 | +declare i64 @__mux_get_local_id() |
| 23 | +declare i32 @__mux_work_group_scan_inclusive_smax_i32(i32, i32) |
| 24 | + |
| 25 | +; CHECK-LABEL: define spir_kernel void @__vecz_v4_foo() |
| 26 | +; CHECK-NOT: @__vecz_b_masked___mux_work_group_scan_inclusive_smax_i32 |
| 27 | +define spir_kernel void @foo() { |
| 28 | +entry: |
| 29 | + %0 = call i64 @__mux_get_local_id() |
| 30 | + br i1 false, label %for.body.i11, label %if.end.i105.i |
| 31 | + |
| 32 | +for.body.i11: |
| 33 | + %1 = icmp slt i64 %0, 0 |
| 34 | + br i1 %1, label %if.end.i13, label %if.end.i13 |
| 35 | + |
| 36 | +if.end.i13: |
| 37 | + br i1 false, label %exit, label %if.end.i105.i |
| 38 | + |
| 39 | +if.end.i105.i: |
| 40 | + %2 = call i32 @__mux_work_group_scan_inclusive_smax_i32(i32 0, i32 0) |
| 41 | + br label %exit |
| 42 | + |
| 43 | +exit: |
| 44 | + ret void |
| 45 | +} |
0 commit comments