File: double-fp-type.ll

package info (click to toggle)
intel-graphics-compiler2 2.16.0-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 106,644 kB
  • sloc: cpp: 805,640; lisp: 287,672; ansic: 16,414; python: 3,952; yacc: 2,588; lex: 1,666; pascal: 313; sh: 186; makefile: 35
file content (54 lines) | stat: -rw-r--r-- 1,761 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
49
50
51
52
53
54
;=========================== begin_copyright_notice ============================
;
; Copyright (C) 2024 Intel Corporation
;
; SPDX-License-Identifier: MIT
;
;============================ end_copyright_notice =============================
;
; REQUIRES: llvm-14-plus
; RUN: igc_opt --opaque-pointers -debugify -igc-custom-loop-opt -S < %s 2>&1 | FileCheck %s
; ------------------------------------------------
; CustomLoopVersioning
; ------------------------------------------------

; This test checks that we're not creating a cmp inst with mismatched fp types.

define spir_kernel void @test_customloop(ptr addrspace(65549) %a, double %b, double %c, double %d) {
entry:
  %aa = inttoptr i32 42 to ptr addrspace(65549)
  %cc = call double @llvm.maxnum.f64(double %c, double 3.000000e+00)
  %dd = call double @llvm.minnum.f64(double %d, double 2.000000e+00)
  br label %pre_header

pre_header:
  ; CHECK: [[TMP:%.*]] = load double
  %0 = load double, ptr addrspace(65549) %aa, align 4
  %1 = fmul double %b, %0
  ; CHECK: fcmp fast ogt double [[TMP]], 1.000000e+00
  br label %loop_body

loop_body:
  %2 = phi double [ %b, %pre_header ], [ %3, %loop_body ]
  %3 = phi double [ %1, %pre_header ], [ %7, %loop_body ]
  %4 = call double @llvm.maxnum.f64(double %cc, double %2)
  %5 = call double @llvm.minnum.f64(double %dd, double %3)
  %6 = load double, ptr addrspace(65549) %aa, align 4
  %7 = fmul double %3, %6
  %8 = fcmp ult double %3, %dd
  br i1 %8, label %loop_body, label %end

end:
  store double %3, ptr addrspace(65549) %a, align 4
  ret void
}


declare double @llvm.maxnum.f64(double, double) #0
declare double @llvm.minnum.f64(double, double) #0

!igc.functions = !{!0}

!0 = !{ptr @test_customloop, !1}
!1 = !{!2}
!2 = !{!"function_type", i32 0}