File: allocation-interposition.ll

package info (click to toggle)
llvm-toolchain-19 1%3A19.1.7-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,998,520 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 (221 lines) | stat: -rw-r--r-- 10,825 bytes parent folder | download | duplicates (4)
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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
; RUN: opt -S -passes=hipstdpar-interpose-alloc %s | FileCheck %s

%"struct.std::nothrow_t" = type { i8 }

@_ZSt7nothrow = external global %"struct.std::nothrow_t", align 1

declare ptr @__hipstdpar_aligned_alloc(i64, i64)

declare ptr @__hipstdpar_malloc(i64)

declare ptr @__hipstdpar_calloc(i64, i64)

declare i32 @__hipstdpar_posix_aligned_alloc(ptr, i64, i64)

declare void @__hipstdpar_hidden_free(ptr)

declare ptr @__hipstdpar_realloc(ptr, i64)

declare ptr @__hipstdpar_realloc_array(ptr, i64, i64)

declare void @__hipstdpar_free(ptr)

declare ptr @__hipstdpar_operator_new_aligned(i64, i64)

declare ptr @__hipstdpar_operator_new(i64)

declare ptr @__hipstdpar_operator_new_nothrow(i64, %"struct.std::nothrow_t")

declare ptr @__hipstdpar_operator_new_aligned_nothrow(i64, i64, %"struct.std::nothrow_t")

declare void @__hipstdpar_operator_delete_aligned_sized(ptr, i64, i64)

declare void @__hipstdpar_operator_delete(ptr)

declare void @__hipstdpar_operator_delete_aligned(ptr, i64)

declare void @__hipstdpar_operator_delete_sized(ptr, i64)

define dso_local noundef i32 @allocs() {
  ; CHECK: %1 = call noalias align 8 ptr @__hipstdpar_aligned_alloc(i64 noundef 8, i64 noundef 42)
  %1 = call noalias align 8 ptr @aligned_alloc(i64 noundef 8, i64 noundef 42)
  ; CHECK: call void @__hipstdpar_free(ptr noundef %1)
  call void @free(ptr noundef %1)

  ; CHECK: %2 = call noalias ptr @__hipstdpar_calloc(i64 noundef 1, i64 noundef 42)
  %2 = call noalias ptr @calloc(i64 noundef 1, i64 noundef 42)
  ; CHECK: call void @__hipstdpar_free(ptr noundef %2)
  call void @free(ptr noundef %2)

  ; CHECK: %3 = call noalias ptr @__hipstdpar_malloc(i64 noundef 42)
  %3 = call noalias ptr @malloc(i64 noundef 42)
  ; CHECK: call void @__hipstdpar_free(ptr noundef %3)
  call void @free(ptr noundef %3)

  ; CHECK: %4 = call noalias align 8 ptr @__hipstdpar_aligned_alloc(i64 noundef 8, i64 noundef 42)
  %4 = call noalias align 8 ptr @memalign(i64 noundef 8, i64 noundef 42)
  ; CHECK: call void @__hipstdpar_free(ptr noundef %4)
  call void @free(ptr noundef %4)

  %tmp = alloca ptr, align 8
  ; CHECK: %5 = call i32 @__hipstdpar_posix_aligned_alloc(ptr noundef %tmp, i64 noundef 8, i64 noundef 42)
  %5 = call i32 @posix_memalign(ptr noundef %tmp, i64 noundef 8, i64 noundef 42)
  ; CHECK: call void @__hipstdpar_free(ptr noundef %tmp)
  call void @free(ptr noundef %tmp)

  ; CHECK: %6 = call noalias ptr @__hipstdpar_malloc(i64 noundef 42)
  %6 = call noalias ptr @malloc(i64 noundef 42)
  ; CHECK: %7 = call ptr @__hipstdpar_realloc(ptr noundef %6, i64 noundef 42)
  %7 = call ptr @realloc(ptr noundef %6, i64 noundef 42)
  ; CHECK: call void @__hipstdpar_free(ptr noundef %7)
  call void @free(ptr noundef %7)

  ; CHECK: %8 = call noalias ptr @__hipstdpar_calloc(i64 noundef 1, i64 noundef 42)
  %8 = call noalias ptr @calloc(i64 noundef 1, i64 noundef 42)
  ; CHECK: %9 = call ptr @__hipstdpar_realloc_array(ptr noundef %8, i64 noundef 1, i64 noundef 42)
  %9 = call ptr @reallocarray(ptr noundef %8, i64 noundef 1, i64 noundef 42)
  ; CHECK: call void @__hipstdpar_free(ptr noundef %9)
  call void @free(ptr noundef %9)

  ; CHECK: %10 = call noalias noundef nonnull ptr @__hipstdpar_operator_new(i64 noundef 1)
  %10 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 1)
  ; CHECK: call void @__hipstdpar_operator_delete(ptr noundef %10)
  call void @_ZdlPv(ptr noundef %10)

  ; CHECK: %11 = call noalias noundef nonnull align 8 ptr @__hipstdpar_operator_new_aligned(i64 noundef 1, i64 noundef 8)
  %11 = call noalias noundef nonnull align 8 ptr @_ZnwmSt11align_val_t(i64 noundef 1, i64 noundef 8)
  ; CHECK: call void @__hipstdpar_operator_delete_aligned(ptr noundef %11, i64 noundef 8)
  call void @_ZdlPvSt11align_val_t(ptr noundef %11, i64 noundef 8)

  ; CHECK: %12 = call noalias noundef ptr @__hipstdpar_operator_new_nothrow(i64 noundef 1, ptr noundef nonnull align 1 dereferenceable(1) @_ZSt7nothrow)
  %12 = call noalias noundef ptr @_ZnwmRKSt9nothrow_t(i64 noundef 1, ptr noundef nonnull align 1 dereferenceable(1) @_ZSt7nothrow)
  ; CHECK: call void @__hipstdpar_operator_delete(ptr noundef %12)
  call void @_ZdlPv(ptr noundef %12)

  ; CHECK: %13 = call noalias noundef align 8 ptr @__hipstdpar_operator_new_aligned_nothrow(i64 noundef 1, i64 noundef 8, ptr noundef nonnull align 1 dereferenceable(1) @_ZSt7nothrow)
  %13 = call noalias noundef align 8 ptr @_ZnwmSt11align_val_tRKSt9nothrow_t(i64 noundef 1, i64 noundef 8, ptr noundef nonnull align 1 dereferenceable(1) @_ZSt7nothrow)
  ; CHECK: call void @__hipstdpar_operator_delete_aligned(ptr noundef %13, i64 noundef 8)
  call void @_ZdlPvSt11align_val_t(ptr noundef %13, i64 noundef 8)

  ; CHECK: %14 = call noalias noundef nonnull ptr @__hipstdpar_operator_new(i64 noundef 42)
  %14 = call noalias noundef nonnull ptr @_Znam(i64 noundef 42)
  ; CHECK: call void @__hipstdpar_operator_delete(ptr noundef %14)
  call void @_ZdaPv(ptr noundef %14)

  ; CHECK: %15 = call noalias noundef nonnull align 8 ptr @__hipstdpar_operator_new_aligned(i64 noundef 42, i64 noundef 8)
  %15 = call noalias noundef nonnull align 8 ptr @_ZnamSt11align_val_t(i64 noundef 42, i64 noundef 8)
  ; CHECK: call void @__hipstdpar_operator_delete_aligned(ptr noundef %15, i64 noundef 8)
  call void @_ZdaPvSt11align_val_t(ptr noundef %15, i64 noundef 8)

  ; CHECK:  %16 = call noalias noundef ptr @__hipstdpar_operator_new_nothrow(i64 noundef 42, ptr noundef nonnull align 1 dereferenceable(1) @_ZSt7nothrow)
  %16 = call noalias noundef ptr @_ZnamRKSt9nothrow_t(i64 noundef 42, ptr noundef nonnull align 1 dereferenceable(1) @_ZSt7nothrow)
  ; CHECK: call void @__hipstdpar_operator_delete(ptr noundef %16)
  call void @_ZdaPv(ptr noundef %16)

  ; CHECK: %17 = call noalias noundef align 8 ptr @__hipstdpar_operator_new_aligned_nothrow(i64 noundef 42, i64 noundef 8, ptr noundef nonnull align 1 dereferenceable(1) @_ZSt7nothrow)
  %17 = call noalias noundef align 8 ptr @_ZnamSt11align_val_tRKSt9nothrow_t(i64 noundef 42, i64 noundef 8, ptr noundef nonnull align 1 dereferenceable(1) @_ZSt7nothrow)
  ; CHECK: call void @__hipstdpar_operator_delete_aligned(ptr noundef %17, i64 noundef 8)
  call void @_ZdaPvSt11align_val_t(ptr noundef %17, i64 noundef 8)

  ; CHECK:  %18 = call ptr @__hipstdpar_calloc(i64 noundef 1, i64 noundef 42)
  %18 = call ptr @calloc(i64 noundef 1, i64 noundef 42)
  ; CHECK: call void @__hipstdpar_free(ptr noundef %18)
  call void @free(ptr noundef %18)

  ; CHECK: %19 = call ptr @__hipstdpar_malloc(i64 noundef 42)
  %19 = call ptr @malloc(i64 noundef 42)
  ; CHECK: call void @__hipstdpar_free(ptr noundef %19)
  call void @free(ptr noundef %19)

  ; CHECK: %20 = call noalias noundef nonnull ptr @__hipstdpar_operator_new(i64 noundef 42)
  %20 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 42)
  ; CHECK: call void @__hipstdpar_operator_delete(ptr noundef %20)
  call void @_ZdlPv(ptr noundef %20)

  ; CHECK:  %21 = call noalias noundef nonnull align 8 ptr @__hipstdpar_operator_new_aligned(i64 noundef 42, i64 noundef 8)
  %21 = call noalias noundef nonnull align 8 ptr @_ZnwmSt11align_val_t(i64 noundef 42, i64 noundef 8)
  ; CHECK: call void @__hipstdpar_operator_delete_aligned(ptr noundef %21, i64 noundef 8)
  call void @_ZdlPvSt11align_val_t(ptr noundef %21, i64 noundef 8)

  ; CHECK: %22 = call noalias noundef ptr @__hipstdpar_operator_new_nothrow(i64 noundef 42, ptr noundef nonnull align 1 dereferenceable(1) @_ZSt7nothrow)
  %22 = call noalias noundef ptr @_ZnwmRKSt9nothrow_t(i64 noundef 42, ptr noundef nonnull align 1 dereferenceable(1) @_ZSt7nothrow)
  ; CHECK: call void @__hipstdpar_operator_delete(ptr noundef %22)
  call void @_ZdlPv(ptr noundef %22)

  ; CHECK:  %23 = call noalias noundef align 8 ptr @__hipstdpar_operator_new_aligned_nothrow(i64 noundef 42, i64 noundef 8, ptr noundef nonnull align 1 dereferenceable(1) @_ZSt7nothrow)
  %23 = call noalias noundef align 8 ptr @_ZnwmSt11align_val_tRKSt9nothrow_t(i64 noundef 42, i64 noundef 8, ptr noundef nonnull align 1 dereferenceable(1) @_ZSt7nothrow)
  ; CHECK: call void @__hipstdpar_operator_delete_aligned(ptr noundef %23, i64 noundef 8)
  call void @_ZdlPvSt11align_val_t(ptr noundef %23, i64 noundef 8)

  ; CHECK: %24 = call ptr @__hipstdpar_malloc(i64 noundef 42)
  %24 = call ptr @malloc(i64 noundef 42)
  ; CHECK: %25 = call ptr @__hipstdpar_realloc(ptr noundef %24, i64 noundef 41)
  %25 = call ptr @realloc(ptr noundef %24, i64 noundef 41)
  ; CHECK: call void @__hipstdpar_free(ptr noundef %25)
  call void @free(ptr noundef %25)

  ; CHECK: %26 = call ptr @__hipstdpar_calloc(i64 noundef 1, i64 noundef 42)
  %26 = call ptr @__libc_calloc(i64 noundef 1, i64 noundef 42)
  ; CHECK: call void @__hipstdpar_free(ptr noundef %26)
  call void @__libc_free(ptr noundef %26)

  ; CHECK: %27 = call ptr @__hipstdpar_malloc(i64 noundef 42)
  %27 = call ptr @__libc_malloc(i64 noundef 42)
  ; CHECK: call void @__hipstdpar_free(ptr noundef %27)
  call void @__libc_free(ptr noundef %27)

  ; CHECK: %28 = call ptr @__hipstdpar_aligned_alloc(i64 noundef 8, i64 noundef 42)
  %28 = call ptr @__libc_memalign(i64 noundef 8, i64 noundef 42)
  ; CHECK: call void @__hipstdpar_free(ptr noundef %28)
  call void @__libc_free(ptr noundef %28)

  ret i32 0
}

declare noalias ptr @aligned_alloc(i64 noundef, i64 noundef)

declare void @free(ptr noundef)

declare noalias ptr @calloc(i64 noundef, i64 noundef)

declare noalias ptr @malloc(i64 noundef)

declare noalias ptr @memalign(i64 noundef, i64 noundef)

declare i32 @posix_memalign(ptr noundef, i64 noundef, i64 noundef)

declare ptr @realloc(ptr noundef, i64 noundef)

declare ptr @reallocarray(ptr noundef, i64 noundef, i64 noundef)

declare noundef nonnull ptr @_Znwm(i64 noundef)

declare void @_ZdlPv(ptr noundef)

declare noalias noundef nonnull ptr @_ZnwmSt11align_val_t(i64 noundef, i64 noundef)

declare void @_ZdlPvSt11align_val_t(ptr noundef, i64 noundef)

declare noalias noundef ptr @_ZnwmRKSt9nothrow_t(i64 noundef, ptr noundef nonnull align 1 dereferenceable(1))

declare noalias noundef ptr @_ZnwmSt11align_val_tRKSt9nothrow_t(i64 noundef, i64 noundef, ptr noundef nonnull align 1 dereferenceable(1))

declare noundef nonnull ptr @_Znam(i64 noundef)

declare void @_ZdaPv(ptr noundef)

declare noalias noundef nonnull ptr @_ZnamSt11align_val_t(i64 noundef, i64 noundef)

declare void @_ZdaPvSt11align_val_t(ptr noundef, i64 noundef)

declare noalias noundef ptr @_ZnamRKSt9nothrow_t(i64 noundef, ptr noundef nonnull align 1 dereferenceable(1))

declare noalias noundef ptr @_ZnamSt11align_val_tRKSt9nothrow_t(i64 noundef, i64 noundef, ptr noundef nonnull align 1 dereferenceable(1))

declare ptr @__libc_calloc(i64 noundef, i64 noundef)

declare void @__libc_free(ptr noundef)

declare ptr @__libc_malloc(i64 noundef)

declare ptr @__libc_memalign(i64 noundef, i64 noundef)