| 1 |
;=========================== begin_copyright_notice ============================ |
| 2 |
; |
| 3 |
; Copyright (C) 2024 Intel Corporation |
| 4 |
; |
| 5 |
; SPDX-License-Identifier: MIT |
| 6 |
; |
| 7 |
;============================ end_copyright_notice ============================= |
| 8 |
|
| 9 |
; REQUIRES: opaque-pointers |
| 10 |
; RUN: opt -passes=cmsimdcflowering -S < %s | FileCheck %s |
| 11 |
|
| 12 |
@Rcp_T2 = internal global <64 x double> undef |
| 13 |
|
| 14 |
; CHECK: @EM = internal global <32 x i1> |
| 15 |
|
| 16 |
define dso_local dllexport void @test1(<32 x i16> %mask, <64 x i32> %oldval) { |
| 17 |
%Rcp_T = alloca <64 x double>, align 512 |
| 18 |
%cmp = icmp ne <32 x i16> %mask, zeroinitializer |
| 19 |
%call = call i1 @llvm.genx.simdcf.any.v32i1(<32 x i1> %cmp) |
| 20 |
br i1 %call, label %if.then, label %if.end |
| 21 |
|
| 22 |
; CHECK-LABEL: if.then: |
| 23 |
if.then: |
| 24 |
; CHECK: [[EM_LOAD:%.*]] = load <32 x i1>, ptr @EM |
| 25 |
; CHECK-NEXT: [[PRED_WRR:%.*]] = call <64 x i32> @llvm.genx.wrregioni.v64i32.v32i32.i16.v32i1(<64 x i32> %oldval, <32 x i32> zeroinitializer, i32 0, i32 32, i32 2, i16 0, i32 undef, <32 x i1> [[EM_LOAD]]) |
| 26 |
; CHECK-NEXT: [[PRED_WRR_CAST:%.*]] = bitcast <64 x i32> [[PRED_WRR]] to <32 x double> |
| 27 |
%wrregion26 = call <64 x i32> @llvm.genx.wrregioni.v64i32.v32i32.i16.i1(<64 x i32> %oldval, <32 x i32> zeroinitializer, i32 0, i32 32, i32 2, i16 0, i32 undef, i1 true) |
| 28 |
%cast27 = bitcast <64 x i32> %wrregion26 to <32 x double> |
| 29 |
%Rcp_T2_load = load <64 x double>, ptr %Rcp_T |
| 30 |
%wrregion28 = call <64 x double> @llvm.genx.wrregionf.v64f64.v32f64.i16.i1(<64 x double> %Rcp_T2_load, <32 x double> %cast27, i32 0, i32 32, i32 1, i16 0, i32 32, i1 true) |
| 31 |
store <64 x double> %wrregion28, ptr %Rcp_T |
| 32 |
br label %if.end |
| 33 |
|
| 34 |
if.end: |
| 35 |
%ld = load <64 x double>, ptr %Rcp_T |
| 36 |
store <64 x double> %ld, ptr @Rcp_T2 |
| 37 |
ret void |
| 38 |
} |
| 39 |
|
| 40 |
declare i1 @llvm.genx.simdcf.any.v32i1(<32 x i1>) |
| 41 |
declare <64 x i32> @llvm.genx.wrregioni.v64i32.v32i32.i16.i1(<64 x i32>, <32 x i32>, i32, i32, i32, i16, i32, i1) |
| 42 |
declare <64 x double> @llvm.genx.wrregionf.v64f64.v32f64.i16.i1(<64 x double>, <32 x double>, i32, i32, i32, i16, i32, i1) |