File: vectorize-widest-phis.ll

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (77 lines) | stat: -rw-r--r-- 3,242 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -passes=slp-vectorizer -S -mcpu=cascadelake -mtriple=x86_64-unknown-linux-gnu < %s | FileCheck %s

define void @foo() {
; CHECK-LABEL: @foo(
; CHECK-NEXT:  entry:
; CHECK-NEXT:    [[CONV:%.*]] = uitofp i16 undef to float
; CHECK-NEXT:    [[SUB:%.*]] = fsub float 6.553500e+04, undef
; CHECK-NEXT:    br label [[BB1:%.*]]
; CHECK:       bb1:
; CHECK-NEXT:    [[TMP0:%.*]] = insertelement <4 x float> <float poison, float poison, float undef, float undef>, float [[SUB]], i32 0
; CHECK-NEXT:    [[TMP1:%.*]] = insertelement <4 x float> [[TMP0]], float [[CONV]], i32 1
; CHECK-NEXT:    br label [[BB2:%.*]]
; CHECK:       bb2:
; CHECK-NEXT:    [[TMP2:%.*]] = phi <4 x float> [ [[TMP1]], [[BB1]] ], [ [[TMP10:%.*]], [[BB3:%.*]] ]
; CHECK-NEXT:    [[TMP3:%.*]] = load double, ptr undef, align 8
; CHECK-NEXT:    br i1 undef, label [[BB3]], label [[BB4:%.*]]
; CHECK:       bb4:
; CHECK-NEXT:    [[TMP4:%.*]] = fpext <4 x float> [[TMP2]] to <4 x double>
; CHECK-NEXT:    [[CONV2:%.*]] = uitofp i16 undef to double
; CHECK-NEXT:    [[ADD1:%.*]] = fadd double [[TMP3]], [[CONV2]]
; CHECK-NEXT:    [[SUB1:%.*]] = fsub double undef, undef
; CHECK-NEXT:    [[TMP5:%.*]] = insertelement <4 x double> <double poison, double poison, double undef, double undef>, double [[SUB1]], i32 0
; CHECK-NEXT:    [[TMP6:%.*]] = insertelement <4 x double> [[TMP5]], double [[ADD1]], i32 1
; CHECK-NEXT:    [[TMP7:%.*]] = fcmp ogt <4 x double> [[TMP6]], [[TMP4]]
; CHECK-NEXT:    [[TMP8:%.*]] = fptrunc <4 x double> [[TMP6]] to <4 x float>
; CHECK-NEXT:    [[TMP9:%.*]] = select <4 x i1> [[TMP7]], <4 x float> [[TMP2]], <4 x float> [[TMP8]]
; CHECK-NEXT:    br label [[BB3]]
; CHECK:       bb3:
; CHECK-NEXT:    [[TMP10]] = phi <4 x float> [ [[TMP9]], [[BB4]] ], [ [[TMP2]], [[BB2]] ]
; CHECK-NEXT:    br label [[BB2]]
;
entry:
  %conv = uitofp i16 undef to float
  %sub = fsub float 6.553500e+04, undef
  br label %bb1

bb1:
  br label %bb2

bb2:
  %0 = phi float [ %sub, %bb1 ], [ %9, %bb3 ]
  %1 = phi float [ %conv, %bb1 ], [ %10, %bb3 ]
  %2 = phi float [ undef, %bb1 ], [ %11, %bb3 ]
  %3 = phi float [ undef, %bb1 ], [ %12, %bb3 ]
  %4 = load double, ptr undef, align 8
  br i1 undef, label %bb3, label %bb4

bb4:
  %ext = fpext float %3 to double
  %cmp1 = fcmp ogt double undef, %ext
  %5 = fptrunc double undef to float
  %sel1 = select i1 %cmp1, float %3, float %5
  %ext2 = fpext float %2 to double
  %cmp2 = fcmp ogt double undef, %ext2
  %6 = fptrunc double undef to float
  %sel2 = select i1 %cmp2, float %2, float %6
  %ext3 = fpext float %1 to double
  %conv2 = uitofp i16 undef to double
  %add1 = fadd double %4, %conv2
  %cmp3 = fcmp ogt double %add1, %ext3
  %7 = fptrunc double %add1 to float
  %sel3 = select i1 %cmp3, float %1, float %7
  %ext4 = fpext float %0 to double
  %sub1 = fsub double undef, undef
  %cmp4 = fcmp ogt double %sub1, %ext4
  %8 = fptrunc double %sub1 to float
  %sel4 = select i1 %cmp4, float %0, float %8
  br label %bb3

bb3:
  %9 = phi float [ %sel4, %bb4 ], [ %0, %bb2 ]
  %10 = phi float [ %sel3, %bb4 ], [ %1, %bb2 ]
  %11 = phi float [ %sel2, %bb4 ], [ %2, %bb2 ]
  %12 = phi float [ %sel1, %bb4 ], [ %3, %bb2 ]
  br label %bb2
}