File: gep.ll

package info (click to toggle)
llvm-toolchain-16 1%3A16.0.6-15~deb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,634,792 kB
  • sloc: cpp: 6,179,261; ansic: 1,216,205; asm: 741,319; python: 196,614; objc: 75,325; f90: 49,640; lisp: 32,396; pascal: 12,286; sh: 9,394; perl: 7,442; ml: 5,494; awk: 3,523; makefile: 2,723; javascript: 1,206; xml: 886; fortran: 581; cs: 573
file content (165 lines) | stat: -rw-r--r-- 11,043 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
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
; RUN: opt -mtriple=riscv32 -passes="print<cost-model>" 2>&1 -disable-output < %s \
; RUN:   | FileCheck %s -check-prefix=RVI
; RUN: opt -mtriple=riscv64 -passes="print<cost-model>" 2>&1 -disable-output < %s \
; RUN:   | FileCheck %s -check-prefix=RVI

define void @testi8(ptr %a, i32 %i) {
; RVI-LABEL: 'testi8'
; RVI-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %a1 = getelementptr inbounds i8, ptr %a, i32 1
; RVI-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %a2 = getelementptr inbounds i8, ptr %a, i32 -1
; RVI-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %a3 = getelementptr inbounds i8, ptr %a, i32 2047
; RVI-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %a4 = getelementptr inbounds i8, ptr %a, i32 2048
; RVI-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %a5 = getelementptr inbounds i8, ptr %a, i32 -2048
; RVI-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %a6 = getelementptr inbounds i8, ptr %a, i32 -2049
; RVI-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %ai = getelementptr inbounds i8, ptr %a, i32 %i
; RVI-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
;
  %a1 = getelementptr inbounds i8, ptr %a, i32 1
  %a2 = getelementptr inbounds i8, ptr %a, i32 -1
  %a3 = getelementptr inbounds i8, ptr %a, i32 2047
  %a4 = getelementptr inbounds i8, ptr %a, i32 2048
  %a5 = getelementptr inbounds i8, ptr %a, i32 -2048
  %a6 = getelementptr inbounds i8, ptr %a, i32 -2049
  %ai = getelementptr inbounds i8, ptr %a, i32 %i
  ret void
}

define void @testi16(ptr %a, i32 %i) {
; RVI-LABEL: 'testi16'
; RVI-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %a1 = getelementptr inbounds i16, ptr %a, i32 1
; RVI-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %a2 = getelementptr inbounds i16, ptr %a, i32 -1
; RVI-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %a3 = getelementptr inbounds i16, ptr %a, i32 1023
; RVI-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %a4 = getelementptr inbounds i16, ptr %a, i32 1024
; RVI-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %a5 = getelementptr inbounds i16, ptr %a, i32 -1024
; RVI-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %a6 = getelementptr inbounds i16, ptr %a, i32 -1025
; RVI-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %ai = getelementptr inbounds i16, ptr %a, i32 %i
; RVI-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
;
  %a1 = getelementptr inbounds i16, ptr %a, i32 1
  %a2 = getelementptr inbounds i16, ptr %a, i32 -1
  %a3 = getelementptr inbounds i16, ptr %a, i32 1023
  %a4 = getelementptr inbounds i16, ptr %a, i32 1024
  %a5 = getelementptr inbounds i16, ptr %a, i32 -1024
  %a6 = getelementptr inbounds i16, ptr %a, i32 -1025
  %ai = getelementptr inbounds i16, ptr %a, i32 %i
  ret void
}

define void @testi32(ptr %a, i32 %i) {
; RVI-LABEL: 'testi32'
; RVI-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %a1 = getelementptr inbounds i32, ptr %a, i32 1
; RVI-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %a2 = getelementptr inbounds i32, ptr %a, i32 -1
; RVI-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %a3 = getelementptr inbounds i32, ptr %a, i32 511
; RVI-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %a4 = getelementptr inbounds i32, ptr %a, i32 512
; RVI-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %a5 = getelementptr inbounds i32, ptr %a, i32 -512
; RVI-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %a6 = getelementptr inbounds i32, ptr %a, i32 -513
; RVI-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %ai = getelementptr inbounds i32, ptr %a, i32 %i
; RVI-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
;
  %a1 = getelementptr inbounds i32, ptr %a, i32 1
  %a2 = getelementptr inbounds i32, ptr %a, i32 -1
  %a3 = getelementptr inbounds i32, ptr %a, i32 511
  %a4 = getelementptr inbounds i32, ptr %a, i32 512
  %a5 = getelementptr inbounds i32, ptr %a, i32 -512
  %a6 = getelementptr inbounds i32, ptr %a, i32 -513
  %ai = getelementptr inbounds i32, ptr %a, i32 %i
  ret void
}

define void @testi64(ptr %a, i32 %i) {
; RVI-LABEL: 'testi64'
; RVI-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %a1 = getelementptr inbounds i64, ptr %a, i32 1
; RVI-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %a2 = getelementptr inbounds i64, ptr %a, i32 -1
; RVI-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %a3 = getelementptr inbounds i64, ptr %a, i32 255
; RVI-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %a4 = getelementptr inbounds i64, ptr %a, i32 256
; RVI-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %a5 = getelementptr inbounds i64, ptr %a, i32 -256
; RVI-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %a6 = getelementptr inbounds i64, ptr %a, i32 -257
; RVI-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %ai = getelementptr inbounds i64, ptr %a, i32 %i
; RVI-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
;
  %a1 = getelementptr inbounds i64, ptr %a, i32 1
  %a2 = getelementptr inbounds i64, ptr %a, i32 -1
  %a3 = getelementptr inbounds i64, ptr %a, i32 255
  %a4 = getelementptr inbounds i64, ptr %a, i32 256
  %a5 = getelementptr inbounds i64, ptr %a, i32 -256
  %a6 = getelementptr inbounds i64, ptr %a, i32 -257
  %ai = getelementptr inbounds i64, ptr %a, i32 %i
  ret void
}

define void @testfloat(ptr %a, i32 %i) {
; RVI-LABEL: 'testfloat'
; RVI-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %a1 = getelementptr inbounds float, ptr %a, i32 1
; RVI-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %a2 = getelementptr inbounds float, ptr %a, i32 -1
; RVI-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %a3 = getelementptr inbounds float, ptr %a, i32 511
; RVI-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %a4 = getelementptr inbounds float, ptr %a, i32 512
; RVI-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %a5 = getelementptr inbounds float, ptr %a, i32 -512
; RVI-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %a6 = getelementptr inbounds float, ptr %a, i32 -513
; RVI-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %ai = getelementptr inbounds float, ptr %a, i32 %i
; RVI-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
;
  %a1 = getelementptr inbounds float, ptr %a, i32 1
  %a2 = getelementptr inbounds float, ptr %a, i32 -1
  %a3 = getelementptr inbounds float, ptr %a, i32 511
  %a4 = getelementptr inbounds float, ptr %a, i32 512
  %a5 = getelementptr inbounds float, ptr %a, i32 -512
  %a6 = getelementptr inbounds float, ptr %a, i32 -513
  %ai = getelementptr inbounds float, ptr %a, i32 %i
  ret void
}

define void @testdouble(ptr %a, i32 %i) {
; RVI-LABEL: 'testdouble'
; RVI-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %a1 = getelementptr inbounds double, ptr %a, i32 1
; RVI-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %a2 = getelementptr inbounds double, ptr %a, i32 -1
; RVI-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %a3 = getelementptr inbounds double, ptr %a, i32 255
; RVI-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %a4 = getelementptr inbounds double, ptr %a, i32 256
; RVI-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %a5 = getelementptr inbounds double, ptr %a, i32 -256
; RVI-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %a6 = getelementptr inbounds double, ptr %a, i32 -257
; RVI-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %ai = getelementptr inbounds double, ptr %a, i32 %i
; RVI-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
;
  %a1 = getelementptr inbounds double, ptr %a, i32 1
  %a2 = getelementptr inbounds double, ptr %a, i32 -1
  %a3 = getelementptr inbounds double, ptr %a, i32 255
  %a4 = getelementptr inbounds double, ptr %a, i32 256
  %a5 = getelementptr inbounds double, ptr %a, i32 -256
  %a6 = getelementptr inbounds double, ptr %a, i32 -257
  %ai = getelementptr inbounds double, ptr %a, i32 %i
  ret void
}

define void @testvecs(i32 %i) {
; RVI-LABEL: 'testvecs'
; RVI-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %b0 = getelementptr inbounds <4 x i8>, ptr undef, i32 1
; RVI-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %b1 = getelementptr inbounds <4 x i16>, ptr undef, i32 1
; RVI-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %b2 = getelementptr inbounds <4 x i32>, ptr undef, i32 1
; RVI-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %b3 = getelementptr inbounds <4 x i64>, ptr undef, i32 1
; RVI-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %b4 = getelementptr inbounds <4 x float>, ptr undef, i32 1
; RVI-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %b5 = getelementptr inbounds <4 x double>, ptr undef, i32 1
; RVI-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %c1 = getelementptr inbounds <4 x i8>, ptr undef, i32 128
; RVI-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %c2 = getelementptr inbounds <4 x i16>, ptr undef, i32 128
; RVI-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %c3 = getelementptr inbounds <4 x i32>, ptr undef, i32 128
; RVI-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %c4 = getelementptr inbounds <4 x i64>, ptr undef, i32 128
; RVI-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %c5 = getelementptr inbounds <4 x float>, ptr undef, i32 128
; RVI-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %c6 = getelementptr inbounds <4 x double>, ptr undef, i32 128
; RVI-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
;

  %b0 = getelementptr inbounds <4 x i8>, ptr undef, i32 1
  %b1 = getelementptr inbounds <4 x i16>, ptr undef, i32 1
  %b2 = getelementptr inbounds <4 x i32>, ptr undef, i32 1
  %b3 = getelementptr inbounds <4 x i64>, ptr undef, i32 1
  %b4 = getelementptr inbounds <4 x float>, ptr undef, i32 1
  %b5 = getelementptr inbounds <4 x double>, ptr undef, i32 1

  %c1 = getelementptr inbounds <4 x i8>, ptr undef, i32 128
  %c2 = getelementptr inbounds <4 x i16>, ptr undef, i32 128
  %c3 = getelementptr inbounds <4 x i32>, ptr undef, i32 128
  %c4 = getelementptr inbounds <4 x i64>, ptr undef, i32 128
  %c5 = getelementptr inbounds <4 x float>, ptr undef, i32 128
  %c6 = getelementptr inbounds <4 x double>, ptr undef, i32 128

  ret void
}