@@ -142,8 +142,8 @@ define void @memset_1024(i8* %dest, i8 %val) {
142
142
}
143
143
144
144
; The following tests check that frame index elimination works for
145
- ; bulk memory instructions. The stack pointer is bumped by 16 instead
146
- ; of 10 because the stack pointer in WebAssembly is currently always
145
+ ; bulk memory instructions. The stack pointer is bumped by 112 instead
146
+ ; of 100 because the stack pointer in WebAssembly is currently always
147
147
; 16-byte aligned, even in leaf functions, although it is not written
148
148
; back to the global in this case.
149
149
@@ -156,52 +156,52 @@ define void @memset_1024(i8* %dest, i8 %val) {
156
156
; NO-BULK-MEM-NOT: memory.copy
157
157
; BULK-MEM-NEXT: .functype memcpy_alloca_src (i32) -> ()
158
158
; BULK-MEM-NEXT: global.get $push[[L0:[0-9]+]]=, __stack_pointer
159
- ; BULK-MEM-NEXT: i32.const $push[[L1:[0-9]+]]=, 16
159
+ ; BULK-MEM-NEXT: i32.const $push[[L1:[0-9]+]]=, 112
160
160
; BULK-MEM-NEXT: i32.sub $push[[L2:[0-9]+]]=, $pop[[L0]], $pop[[L1]]
161
- ; BULK-MEM-NEXT: i32.const $push[[L3:[0-9]+]]=, 6
161
+ ; BULK-MEM-NEXT: i32.const $push[[L3:[0-9]+]]=, 12
162
162
; BULK-MEM-NEXT: i32.add $push[[L4:[0-9]+]]=, $pop[[L2]], $pop[[L3]]
163
- ; BULK-MEM-NEXT: i32.const $push[[L5:[0-9]+]]=, 10
163
+ ; BULK-MEM-NEXT: i32.const $push[[L5:[0-9]+]]=, 100
164
164
; BULK-MEM-NEXT: memory.copy 0, 0, $0, $pop[[L4]], $pop[[L5]]
165
165
; BULK-MEM-NEXT: return
166
166
define void @memcpy_alloca_src (i8* %dst ) {
167
- %a = alloca [10 x i8 ]
168
- %p = bitcast [10 x i8 ]* %a to i8*
169
- call void @llvm.memcpy.p0i8.p0i8.i32 (i8* %dst , i8* %p , i32 10 , i1 false )
167
+ %a = alloca [100 x i8 ]
168
+ %p = bitcast [100 x i8 ]* %a to i8*
169
+ call void @llvm.memcpy.p0i8.p0i8.i32 (i8* %dst , i8* %p , i32 100 , i1 false )
170
170
ret void
171
171
}
172
172
173
173
; CHECK-LABEL: memcpy_alloca_dst:
174
174
; NO-BULK-MEM-NOT: memory.copy
175
175
; BULK-MEM-NEXT: .functype memcpy_alloca_dst (i32) -> ()
176
176
; BULK-MEM-NEXT: global.get $push[[L0:[0-9]+]]=, __stack_pointer
177
- ; BULK-MEM-NEXT: i32.const $push[[L1:[0-9]+]]=, 16
177
+ ; BULK-MEM-NEXT: i32.const $push[[L1:[0-9]+]]=, 112
178
178
; BULK-MEM-NEXT: i32.sub $push[[L2:[0-9]+]]=, $pop[[L0]], $pop[[L1]]
179
- ; BULK-MEM-NEXT: i32.const $push[[L3:[0-9]+]]=, 6
179
+ ; BULK-MEM-NEXT: i32.const $push[[L3:[0-9]+]]=, 12
180
180
; BULK-MEM-NEXT: i32.add $push[[L4:[0-9]+]]=, $pop[[L2]], $pop[[L3]]
181
- ; BULK-MEM-NEXT: i32.const $push[[L5:[0-9]+]]=, 10
181
+ ; BULK-MEM-NEXT: i32.const $push[[L5:[0-9]+]]=, 100
182
182
; BULK-MEM-NEXT: memory.copy 0, 0, $pop[[L4]], $0, $pop[[L5]]
183
183
; BULK-MEM-NEXT: return
184
184
define void @memcpy_alloca_dst (i8* %src ) {
185
- %a = alloca [10 x i8 ]
186
- %p = bitcast [10 x i8 ]* %a to i8*
187
- call void @llvm.memcpy.p0i8.p0i8.i32 (i8* %p , i8* %src , i32 10 , i1 false )
185
+ %a = alloca [100 x i8 ]
186
+ %p = bitcast [100 x i8 ]* %a to i8*
187
+ call void @llvm.memcpy.p0i8.p0i8.i32 (i8* %p , i8* %src , i32 100 , i1 false )
188
188
ret void
189
189
}
190
190
191
191
; CHECK-LABEL: memset_alloca:
192
192
; NO-BULK-MEM-NOT: memory.fill
193
193
; BULK-MEM-NEXT: .functype memset_alloca (i32) -> ()
194
194
; BULK-MEM-NEXT: global.get $push[[L0:[0-9]+]]=, __stack_pointer
195
- ; BULK-MEM-NEXT: i32.const $push[[L1:[0-9]+]]=, 16
195
+ ; BULK-MEM-NEXT: i32.const $push[[L1:[0-9]+]]=, 112
196
196
; BULK-MEM-NEXT: i32.sub $push[[L2:[0-9]+]]=, $pop[[L0]], $pop[[L1]]
197
- ; BULK-MEM-NEXT: i32.const $push[[L3:[0-9]+]]=, 6
197
+ ; BULK-MEM-NEXT: i32.const $push[[L3:[0-9]+]]=, 12
198
198
; BULK-MEM-NEXT: i32.add $push[[L4:[0-9]+]]=, $pop[[L2]], $pop[[L3]]
199
- ; BULK-MEM-NEXT: i32.const $push[[L5:[0-9]+]]=, 10
199
+ ; BULK-MEM-NEXT: i32.const $push[[L5:[0-9]+]]=, 100
200
200
; BULK-MEM-NEXT: memory.fill 0, $pop[[L4]], $0, $pop[[L5]]
201
201
; BULK-MEM-NEXT: return
202
202
define void @memset_alloca (i8 %val ) {
203
- %a = alloca [10 x i8 ]
204
- %p = bitcast [10 x i8 ]* %a to i8*
205
- call void @llvm.memset.p0i8.i32 (i8* %p , i8 %val , i32 10 , i1 false )
203
+ %a = alloca [100 x i8 ]
204
+ %p = bitcast [100 x i8 ]* %a to i8*
205
+ call void @llvm.memset.p0i8.i32 (i8* %p , i8 %val , i32 100 , i1 false )
206
206
ret void
207
207
}
0 commit comments