File: bypass_select.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 (48 lines) | stat: -rw-r--r-- 2,625 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
45
46
47
48
;=========================== begin_copyright_notice ============================
;
; Copyright (C) 2024 Intel Corporation
;
; SPDX-License-Identifier: MIT
;
;============================ end_copyright_notice =============================

; RUN: %opt %use_old_pass_manager% -GenXDeadVectorRemoval -march=genx64 -mcpu=Gen9 -mtriple=spir64-unknown-unknown -S < %s | FileCheck %s

; CHECK-LABEL: @two_selects
define <16 x i32> @two_selects(<16 x i32> %arg1, <16 x i1> %pred1, <16 x i1> %pred2) {
; CHECK-NOT: %bypass = select <16 x i1> %pred1, <16 x i32> %arg1, <16 x i32>  undef
  %bypass = select <16 x i1> %pred1, <16 x i32> %arg1, <16 x i32>  undef
; CHECK-NOT: %bypass2 = select <16 x i1> %pred2, <16 x i32> %bypass, <16 x i32>  undef
  %bypass2 = select <16 x i1> %pred2, <16 x i32>  undef, <16 x i32> %bypass
; CHECK-NEXT: ret <16 x i32> %arg1
  ret <16 x i32> %bypass2
}


declare { <32 x i1>, <32 x i1>, i1 } @llvm.genx.simdcf.goto.v32i1.v32i1(<32 x i1>, <32 x i1>, <32 x i1>) #1
declare { <32 x i1>, i1 } @llvm.genx.simdcf.join.v32i1.v32i1(<32 x i1>, <32 x i1>) #1

; CHECK-LABEL: @select_em
define dllexport void @select_em(<32 x i32>* %a, <32 x i1> %b) {
entry:
  %stack_data = load <32 x i32>, <32 x i32>* %a
  br label %lbl

lbl:                                              ; preds = %lbl, %entry
  %goto.call = call { <32 x i1>, <32 x i1>, i1 } @llvm.genx.simdcf.goto.v32i1.v32i1(<32 x i1> <i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true>, <32 x i1> zeroinitializer, <32 x i1> %b)
  %EM = extractvalue { <32 x i1>, <32 x i1>, i1 } %goto.call, 0
  %RM = extractvalue { <32 x i1>, <32 x i1>, i1 } %goto.call, 1
  %Pred = extractvalue { <32 x i1>, <32 x i1>, i1 } %goto.call, 2
  br i1 %Pred, label %exit, label %lbl

; CHECK-LABEL: exit
exit:                                             ; preds = %lbl
  %const.cast = bitcast i32 1244252123 to <32 x i1>
; CHECK: %first_select = select <32 x i1> %EM, <32 x i32> %stack_data, <32 x i32> undef
  %first_select = select <32 x i1> %EM, <32 x i32> %stack_data, <32 x i32> undef
; CHECK-NEXT: %second_select = select <32 x i1> %EM, <32 x i32> undef, <32 x i32> %first_select
  %second_select = select <32 x i1> %EM, <32 x i32> undef, <32 x i32> %first_select
  store <32 x i32> %second_select, <32 x i32>* %a
  %join_call = tail call { <32 x i1>, i1 } @llvm.genx.simdcf.join.v32i1.v32i1(<32 x i1> %EM, <32 x i1> %RM)
  ret void
}