|
| 1 | +;=========================== begin_copyright_notice ============================ |
| 2 | +; |
| 3 | +; Copyright (C) 2024 Intel Corporation |
| 4 | +; |
| 5 | +; SPDX-License-Identifier: MIT |
| 6 | +; |
| 7 | +;============================ end_copyright_notice ============================= |
| 8 | + |
| 9 | +; RUN: %opt %use_old_pass_manager% -GenXLegalization -march=genx64 -mcpu=Gen11 -mtriple=spir64-unknown-unknown -S < %s | FileCheck %s |
| 10 | + |
| 11 | +declare i16 @llvm.genx.rdregioni.i16.v2i16.i16(<2 x i16>, i32, i32, i32, i16, i32) |
| 12 | +declare <64 x i16> @llvm.genx.wrregioni.v64i16.v4i16.i16.i1(<64 x i16>, <4 x i16>, i32, i32, i32, i16, i32, i1) |
| 13 | + |
| 14 | +define <64 x i16> @test(<64 x i16> %buff, <4 x i16> %insert, i1 %cmp.1, i1 %cmp.2, i1 %cmp.3) { |
| 15 | +entry: |
| 16 | + br i1 %cmp.1, label %l0, label %end |
| 17 | + |
| 18 | +l0: |
| 19 | + br i1 %cmp.2, label %if, label %else |
| 20 | + |
| 21 | +if: |
| 22 | + %ph.0 = phi i16 [ 0, %l0 ], [ %ph.1, %else] |
| 23 | + br label %else |
| 24 | + |
| 25 | +else: |
| 26 | + %ph.1 = phi i16 [ 0, %l0 ], [ %ph.0, %if ] |
| 27 | + %val = sub i16 %ph.1, 0 |
| 28 | + br i1 %cmp.3, label %end, label %if |
| 29 | + |
| 30 | +end: |
| 31 | + %idx = phi i16 [ %val, %else ], [ 0, %entry ] |
| 32 | + ; CHECK-NOT: call <1 x i16> @llvm.genx.rdregioni.v1i16.v4i16.i16 |
| 33 | + %wrreg = tail call <64 x i16> @llvm.genx.wrregioni.v64i16.v4i16.i16.i1(<64 x i16> %buff, <4 x i16> %insert, i32 0, i32 2, i32 1, i16 %idx, i32 undef, i1 true) |
| 34 | + %res = add <64 x i16> %wrreg, %buff |
| 35 | + ret <64 x i16> %res |
| 36 | +} |
0 commit comments