File: hoistcommoninsts.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 (47 lines) | stat: -rw-r--r-- 1,906 bytes parent folder | download | duplicates (2)
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
;=========================== begin_copyright_notice ============================
;
; Copyright (C) 2023-2024 Intel Corporation
;
; SPDX-License-Identifier: MIT
;
;============================ end_copyright_notice =============================
;
; RUN: igc_opt --opaque-pointers --simplifycfg -hoist-common-insts=true -S < %s 2>&1 | FileCheck %s
; ------------------------------------------------
;
; Checks that SimplyCFG pass hoists common instructions
;
; REQUIRES: llvm-14-plus
;
; CHECK: entry:
; CHECK-NOT: br
; CHECK: [[LD:%[a-zA-Z0-9_.]*]] = load <2 x float>
; CHECK: [[EXT1:%[a-zA-Z0-9_.]*]] = extractelement {{.*}}[[LD]]
; CHECK: [[EXT2:%[a-zA-Z0-9_.]*]] = extractelement {{.*}}[[LD]]
; CHECK: [[SEL:%[a-zA-Z0-9_.]*]] = select {{.*}}[[EXT1]]{{.*}}[[EXT2]]
; CHECK: fadd float {{.*}}[[SEL]]{{$}}

define spir_kernel void @detect(<2 x float> addrspace(1)* %classifier_weights, i1 %cmp79) {
entry:
  br i1 %cmp79, label %if.then81, label %if.else

if.then81:                                        ; preds = %for.end
  %idxprom82 = zext i32 0 to i64
  %arrayidx83 = getelementptr inbounds <2 x float>, <2 x float> addrspace(1)* %classifier_weights, i64 %idxprom82
  %0 = load <2 x float>, <2 x float> addrspace(1)* %classifier_weights, align 8
  %scalar47 = extractelement <2 x float> %0, i32 0
  br label %if.end88

if.else:                                          ; preds = %for.end
  %idxprom85 = zext i32 0 to i64
  %arrayidx86 = getelementptr inbounds <2 x float>, <2 x float> addrspace(1)* %classifier_weights, i64 %idxprom85
  %1 = load <2 x float>, <2 x float> addrspace(1)* %classifier_weights, align 8
  %scalar50 = extractelement <2 x float> %1, i32 1
  br label %if.end88

if.end88:                                         ; preds = %if.else, %if.then81
  %.pn = phi float [ %scalar47, %if.then81 ], [ %scalar50, %if.else ]
  %stage_value.1 = fadd float 0.000000e+00, %.pn
  ret void
}