File: addc_pattern.ll

package info (click to toggle)
intel-graphics-compiler 1.0.17791.18-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 102,312 kB
  • sloc: cpp: 935,343; lisp: 286,143; ansic: 16,196; python: 3,279; yacc: 2,487; lex: 1,642; pascal: 300; sh: 174; makefile: 27
file content (44 lines) | stat: -rw-r--r-- 1,950 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
;=========================== begin_copyright_notice ============================
;
; Copyright (C) 2022-2024 Intel Corporation
;
; SPDX-License-Identifier: MIT
;
;============================ end_copyright_notice =============================

; REQUIRES: llvm-14-plus
; RUN: igc_opt --opaque-pointers -igc-gen-specific-pattern -S %s -o %t.ll
; RUN: FileCheck %s --input-file=%t.ll

define spir_kernel void @testkernel(i32 addrspace(1)* %arg_x) {
entry:
  %ptrtoint = ptrtoint i32 addrspace(1)* %arg_x to i64
  %inttoptr = inttoptr i64 %ptrtoint to <4 x i32> addrspace(1)*
  %load = load <4 x i32>, <4 x i32> addrspace(1)* %inttoptr, align 4
  %w = extractelement <4 x i32> %load, i32 0
  %x = extractelement <4 x i32> %load, i32 1
  %y = extractelement <4 x i32> %load, i32 2
  %z = extractelement <4 x i32> %load, i32 3
  %add = add i32 %w, 1
  %cmp = icmp eq i32 %w, -1
  %conv = zext i1 %cmp to i32
  %add.1 = add i32 %x, %conv
  %cmp.1 = icmp ult i32 %add.1, %x
  %conv.2 = zext i1 %cmp.1 to i32
  %add.2 = add i32 %y, %conv.2
  %cmp.2 = icmp ult i32 %add.2, %y
  %conv.3 = zext i1 %cmp.2 to i32
  %add.3 = add i32 %z, %conv.3
  ret void
}

; CHECK-LABEL: @testkernel
; CHECK: [[CALL:%[a-zA-Z0-9]+]] = call <2 x i32> @llvm.genx.GenISA.uaddc.v2i32.i32(i32 %w, i32 1)
; CHECK: [[ZEXT0:%[a-zA-Z0-9]+]] = extractelement <2 x i32> [[CALL]], i32 0
; CHECK: [[ZEXT1:%[a-zA-Z0-9]+]] = extractelement <2 x i32> [[CALL]], i32 1
; CHECK: [[CALL1:%[a-zA-Z0-9]+]] = call <2 x i32> @llvm.genx.GenISA.uaddc.v2i32.i32(i32 %x, i32 [[ZEXT1]])
; CHECK: [[ZEXT12:%[a-zA-Z0-9]+]] = extractelement <2 x i32> [[CALL1]], i32 0
; CHECK: [[ZEXT13:%[a-zA-Z0-9]+]] = extractelement <2 x i32> [[CALL1]], i32 1
; CHECK: [[CALL2:%[a-zA-Z0-9]+]] = call <2 x i32> @llvm.genx.GenISA.uaddc.v2i32.i32(i32 %y, i32 [[ZEXT13]])
; CHECK: [[ZEXT14:%[a-zA-Z0-9]+]] = extractelement <2 x i32> [[CALL2]], i32 0
; CHECK: [[ZEXT15:%[a-zA-Z0-9]+]] = extractelement <2 x i32> [[CALL2]], i32 1