File: pr30990.ll

package info (click to toggle)
llvm-toolchain-19 1%3A19.1.7-3~deb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm-proposed-updates
  • size: 1,998,492 kB
  • sloc: cpp: 6,951,680; ansic: 1,486,157; asm: 913,598; python: 232,024; f90: 80,126; objc: 75,281; lisp: 37,276; pascal: 16,990; sh: 10,009; ml: 5,058; perl: 4,724; awk: 3,523; makefile: 3,167; javascript: 2,504; xml: 892; fortran: 664; cs: 573
file content (140 lines) | stat: -rw-r--r-- 5,448 bytes parent folder | download | duplicates (12)
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
; RUN: opt < %s -passes=loop-vectorize -mcpu=pwr8 -mattr=+vsx -force-vector-interleave=1 -vectorizer-maximize-bandwidth=0 -S | FileCheck %s

target triple = "powerpc64-unknown-linux-gnu"

define signext i32 @foo(ptr readonly %ptr, i32 signext %l) {
entry:
  %idx.ext = sext i32 %l to i64
  %add.ptr = getelementptr inbounds i8, ptr %ptr, i64 %idx.ext
  %cmp7 = icmp sgt i32 %l, 0
  br i1 %cmp7, label %while.body.preheader, label %while.end

while.body.preheader:                             ; preds = %entry
  br label %while.body

while.body:                                       ; preds = %while.body.preheader, %while.body
  %count.09 = phi i32 [ %add, %while.body ], [ 0, %while.body.preheader ]
  %ptr.addr.08 = phi ptr [ %incdec.ptr, %while.body ], [ %ptr, %while.body.preheader ]
  %0 = load i8, ptr %ptr.addr.08, align 1
  %cmp1 = icmp slt i8 %0, -64
  %cond = zext i1 %cmp1 to i32
  %add = add nsw i32 %cond, %count.09
  %incdec.ptr = getelementptr inbounds i8, ptr %ptr.addr.08, i64 1
  %cmp = icmp ult ptr %incdec.ptr, %add.ptr
  br i1 %cmp, label %while.body, label %while.end.loopexit

while.end.loopexit:                               ; preds = %while.body
  %add.lcssa = phi i32 [ %add, %while.body ]
  br label %while.end

while.end:                                        ; preds = %while.end.loopexit, %entry
  %count.0.lcssa = phi i32 [ 0, %entry ], [ %add.lcssa, %while.end.loopexit ]
  ret i32 %count.0.lcssa

; CHECK: load <4 x i8>
; CHECK: icmp slt <4 x i8>
}


define signext i16 @foo2(ptr readonly %ptr, i32 signext %l) {
entry:
  %idx.ext = sext i32 %l to i64
  %add.ptr = getelementptr inbounds i8, ptr %ptr, i64 %idx.ext
  %cmp7 = icmp sgt i32 %l, 0
  br i1 %cmp7, label %while.body.preheader, label %while.end

while.body.preheader:                             ; preds = %entry
  br label %while.body

while.body:                                       ; preds = %while.body.preheader, %while.body
  %count.09 = phi i16 [ %add, %while.body ], [ 0, %while.body.preheader ]
  %ptr.addr.08 = phi ptr [ %incdec.ptr, %while.body ], [ %ptr, %while.body.preheader ]
  %0 = load i8, ptr %ptr.addr.08, align 1
  %cmp1 = icmp slt i8 %0, -64
  %cond = zext i1 %cmp1 to i16
  %add = add nsw i16 %cond, %count.09
  %incdec.ptr = getelementptr inbounds i8, ptr %ptr.addr.08, i64 1
  %cmp = icmp ult ptr %incdec.ptr, %add.ptr
  br i1 %cmp, label %while.body, label %while.end.loopexit

while.end.loopexit:                               ; preds = %while.body
  %add.lcssa = phi i16 [ %add, %while.body ]
  br label %while.end

while.end:                                        ; preds = %while.end.loopexit, %entry
  %count.0.lcssa = phi i16 [ 0, %entry ], [ %add.lcssa, %while.end.loopexit ]
  ret i16 %count.0.lcssa

; CHECK-LABEL: foo2
; CHECK: load <8 x i8>
; CHECK: icmp slt <8 x i8>
}

define signext i32 @foo3(ptr readonly %ptr, i32 signext %l) {
entry:
  %idx.ext = sext i32 %l to i64
  %add.ptr = getelementptr inbounds i16, ptr %ptr, i64 %idx.ext
  %cmp7 = icmp sgt i32 %l, 0
  br i1 %cmp7, label %while.body.preheader, label %while.end

while.body.preheader:                             ; preds = %entry
  br label %while.body

while.body:                                       ; preds = %while.body.preheader, %while.body
  %count.09 = phi i32 [ %add, %while.body ], [ 0, %while.body.preheader ]
  %ptr.addr.16 = phi ptr [ %incdec.ptr, %while.body ], [ %ptr, %while.body.preheader ]
  %0 = load i16, ptr %ptr.addr.16, align 1
  %cmp1 = icmp slt i16 %0, -64
  %cond = zext i1 %cmp1 to i32
  %add = add nsw i32 %cond, %count.09
  %incdec.ptr = getelementptr inbounds i16, ptr %ptr.addr.16, i64 1
  %cmp = icmp ult ptr %incdec.ptr, %add.ptr
  br i1 %cmp, label %while.body, label %while.end.loopexit

while.end.loopexit:                               ; preds = %while.body
  %add.lcssa = phi i32 [ %add, %while.body ]
  br label %while.end

while.end:                                        ; preds = %while.end.loopexit, %entry
  %count.0.lcssa = phi i32 [ 0, %entry ], [ %add.lcssa, %while.end.loopexit ]
  ret i32 %count.0.lcssa

; CHECK-LABEL: foo3
; CHECK: load <4 x i16>
; CHECK: icmp slt <4 x i16>
}

define i64 @foo4(ptr readonly %ptr, i32 signext %l) {
entry:
  %idx.ext = sext i32 %l to i64
  %add.ptr = getelementptr inbounds i16, ptr %ptr, i64 %idx.ext
  %cmp7 = icmp sgt i32 %l, 0
  br i1 %cmp7, label %while.body.preheader, label %while.end

while.body.preheader:                             ; preds = %entry
  br label %while.body

while.body:                                       ; preds = %while.body.preheader, %while.body
  %count.09 = phi i64 [ %add, %while.body ], [ 0, %while.body.preheader ]
  %ptr.addr.16 = phi ptr [ %incdec.ptr, %while.body ], [ %ptr, %while.body.preheader ]
  %0 = load i16, ptr %ptr.addr.16, align 1
  %cmp1 = icmp slt i16 %0, -64
  %cond = zext i1 %cmp1 to i64
  %add = add nsw i64 %cond, %count.09
  %incdec.ptr = getelementptr inbounds i16, ptr %ptr.addr.16, i64 1
  %cmp = icmp ult ptr %incdec.ptr, %add.ptr
  br i1 %cmp, label %while.body, label %while.end.loopexit

while.end.loopexit:                               ; preds = %while.body
  %add.lcssa = phi i64 [ %add, %while.body ]
  br label %while.end

while.end:                                        ; preds = %while.end.loopexit, %entry
  %count.0.lcssa = phi i64 [ 0, %entry ], [ %add.lcssa, %while.end.loopexit ]
  ret i64 %count.0.lcssa

; CHECK-LABEL: foo4
; CHECK: load <2 x i16>
; CHECK: icmp slt <2 x i16>
}