@@ -87,14 +87,14 @@ int load_field(S* s) {
87
87
// CIR: [[TMP0:%.*]] = cir.alloca !cir.ptr<!rec_S>, !cir.ptr<!cir.ptr<!rec_S>>, ["s", init]
88
88
// CIR: [[TMP1:%.*]] = cir.load{{.*}} [[TMP0]] : !cir.ptr<!cir.ptr<!rec_S>>, !cir.ptr<!rec_S>
89
89
// CIR: [[TMP2:%.*]] = cir.get_member [[TMP1]][0] {name = "c"} : !cir.ptr<!rec_S> -> !cir.ptr<!u64i>
90
- // CIR: [[TMP3:%.*]] = cir.get_bitfield(#bfi_c, [[TMP2]] : !cir.ptr<!u64i>) -> !s32i
90
+ // CIR: [[TMP3:%.*]] = cir.get_bitfield align(4) (#bfi_c, [[TMP2]] : !cir.ptr<!u64i>) -> !s32i
91
91
92
92
// LLVM: define dso_local i32 @load_field
93
93
// LLVM: [[TMP0:%.*]] = alloca ptr, i64 1, align 8
94
94
// LLVM: [[TMP1:%.*]] = alloca i32, i64 1, align 4
95
95
// LLVM: [[TMP2:%.*]] = load ptr, ptr [[TMP0]], align 8
96
96
// LLVM: [[TMP3:%.*]] = getelementptr %struct.S, ptr [[TMP2]], i32 0, i32 0
97
- // LLVM: [[TMP4:%.*]] = load i64, ptr [[TMP3]], align 8
97
+ // LLVM: [[TMP4:%.*]] = load i64, ptr [[TMP3]], align 4
98
98
// LLVM: [[TMP5:%.*]] = shl i64 [[TMP4]], 15
99
99
// LLVM: [[TMP6:%.*]] = ashr i64 [[TMP5]], 47
100
100
// LLVM: [[TMP7:%.*]] = trunc i64 [[TMP6]] to i32
@@ -115,13 +115,13 @@ unsigned int load_field_unsigned(A* s) {
115
115
//CIR: [[TMP0:%.*]] = cir.alloca !cir.ptr<!rec_A>, !cir.ptr<!cir.ptr<!rec_A>>, ["s", init] {alignment = 8 : i64}
116
116
//CIR: [[TMP1:%.*]] = cir.load align(8) [[TMP0]] : !cir.ptr<!cir.ptr<!rec_A>>, !cir.ptr<!rec_A>
117
117
//CIR: [[TMP2:%.*]] = cir.get_member [[TMP1]][3] {name = "more_bits"} : !cir.ptr<!rec_A> -> !cir.ptr<!u16i>
118
- //CIR: [[TMP3:%.*]] = cir.get_bitfield(#bfi_more_bits, [[TMP2]] : !cir.ptr<!u16i>) -> !u32i
118
+ //CIR: [[TMP3:%.*]] = cir.get_bitfield align(1) (#bfi_more_bits, [[TMP2]] : !cir.ptr<!u16i>) -> !u32i
119
119
120
120
//LLVM: define dso_local i32 @load_field_unsigned
121
121
//LLVM: [[TMP0:%.*]] = alloca ptr, i64 1, align 8
122
122
//LLVM: [[TMP1:%.*]] = load ptr, ptr [[TMP0]], align 8
123
123
//LLVM: [[TMP2:%.*]] = getelementptr %struct.A, ptr [[TMP1]], i32 0, i32 3
124
- //LLVM: [[TMP3:%.*]] = load i16, ptr [[TMP2]], align 2
124
+ //LLVM: [[TMP3:%.*]] = load i16, ptr [[TMP2]], align 1
125
125
//LLVM: [[TMP4:%.*]] = lshr i16 [[TMP3]], 3
126
126
//LLVM: [[TMP5:%.*]] = and i16 [[TMP4]], 15
127
127
//LLVM: [[TMP6:%.*]] = zext i16 [[TMP5]] to i32
@@ -143,15 +143,15 @@ void store_field() {
143
143
// CIR: [[TMP0:%.*]] = cir.alloca !rec_S, !cir.ptr<!rec_S>
144
144
// CIR: [[TMP1:%.*]] = cir.const #cir.int<3> : !s32i
145
145
// CIR: [[TMP2:%.*]] = cir.get_member [[TMP0]][1] {name = "e"} : !cir.ptr<!rec_S> -> !cir.ptr<!u16i>
146
- // CIR: cir.set_bitfield(#bfi_e, [[TMP2]] : !cir.ptr<!u16i>, [[TMP1]] : !s32i)
146
+ // CIR: cir.set_bitfield align(4) (#bfi_e, [[TMP2]] : !cir.ptr<!u16i>, [[TMP1]] : !s32i)
147
147
148
148
// LLVM: define dso_local void @store_field()
149
149
// LLVM: [[TMP0:%.*]] = alloca %struct.S, i64 1, align 4
150
150
// LLVM: [[TMP1:%.*]] = getelementptr %struct.S, ptr [[TMP0]], i32 0, i32 1
151
- // LLVM: [[TMP2:%.*]] = load i16, ptr [[TMP1]], align 2
151
+ // LLVM: [[TMP2:%.*]] = load i16, ptr [[TMP1]], align 4
152
152
// LLVM: [[TMP3:%.*]] = and i16 [[TMP2]], -32768
153
153
// LLVM: [[TMP4:%.*]] = or i16 [[TMP3]], 3
154
- // LLVM: store i16 [[TMP4]], ptr [[TMP1]], align 2
154
+ // LLVM: store i16 [[TMP4]], ptr [[TMP1]], align 4
155
155
156
156
// OGCG: define dso_local void @store_field()
157
157
// OGCG: [[TMP0:%.*]] = alloca %struct.S, align 4
@@ -169,24 +169,24 @@ void store_bitfield_to_bitfield() {
169
169
// CIR: cir.func {{.*@store_bitfield_to_bitfield}}
170
170
// CIR: [[TMP0:%.*]] = cir.alloca !rec_S, !cir.ptr<!rec_S>, ["s"] {alignment = 4 : i64}
171
171
// CIR: [[TMP1:%.*]] = cir.get_member [[TMP0]][0] {name = "c"} : !cir.ptr<!rec_S> -> !cir.ptr<!u64i>
172
- // CIR: [[TMP2:%.*]] = cir.get_bitfield(#bfi_c, [[TMP1]] : !cir.ptr<!u64i>) -> !s32i
172
+ // CIR: [[TMP2:%.*]] = cir.get_bitfield align(4) (#bfi_c, [[TMP1]] : !cir.ptr<!u64i>) -> !s32i
173
173
// CIR: [[TMP3:%.*]] = cir.get_member [[TMP0]][0] {name = "a"} : !cir.ptr<!rec_S> -> !cir.ptr<!u64i>
174
- // CIR: [[TMP4:%.*]] = cir.set_bitfield(#bfi_a, [[TMP3]] : !cir.ptr<!u64i>, [[TMP2]] : !s32i) -> !s32i
174
+ // CIR: [[TMP4:%.*]] = cir.set_bitfield align(4) (#bfi_a, [[TMP3]] : !cir.ptr<!u64i>, [[TMP2]] : !s32i) -> !s32i
175
175
176
176
// LLVM: define dso_local void @store_bitfield_to_bitfield()
177
177
// LLVM: [[TMP0:%.*]] = alloca %struct.S, i64 1, align 4
178
178
// LLVM: [[TMP1:%.*]] = getelementptr %struct.S, ptr [[TMP0]], i32 0, i32 0
179
- // LLVM: [[TMP2:%.*]] = load i64, ptr [[TMP1]], align 8
179
+ // LLVM: [[TMP2:%.*]] = load i64, ptr [[TMP1]], align 4
180
180
// LLVM: [[TMP3:%.*]] = shl i64 [[TMP2]], 15
181
181
// LLVM: [[TMP4:%.*]] = ashr i64 [[TMP3]], 47
182
182
// LLVM: [[TMP5:%.*]] = trunc i64 [[TMP4]] to i32
183
183
// LLVM: [[TMP6:%.*]] = getelementptr %struct.S, ptr [[TMP0]], i32 0, i32 0
184
184
// LLVM: [[TMP7:%.*]] = zext i32 [[TMP5]] to i64
185
- // LLVM: [[TMP8:%.*]] = load i64, ptr [[TMP6]], align 8
185
+ // LLVM: [[TMP8:%.*]] = load i64, ptr [[TMP6]], align 4
186
186
// LLVM: [[TMP9:%.*]] = and i64 [[TMP7]], 15
187
187
// LLVM: [[TMP10:%.*]] = and i64 [[TMP8]], -16
188
188
// LLVM: [[TMP11:%.*]] = or i64 [[TMP10]], [[TMP9]]
189
- // LLVM: store i64 [[TMP11]], ptr [[TMP6]], align 8
189
+ // LLVM: store i64 [[TMP11]], ptr [[TMP6]], align 4
190
190
// LLVM: [[TMP12:%.*]] = shl i64 [[TMP9]], 60
191
191
// LLVM: [[TMP13:%.*]] = ashr i64 [[TMP12]], 60
192
192
// LLVM: [[TMP15:%.*]] = trunc i64 [[TMP13]] to i32
@@ -222,16 +222,16 @@ void get_volatile(V* v) {
222
222
// CIR: [[TMP1:%.*]] = cir.const #cir.int<3> : !s32i
223
223
// CIR: [[TMP2:%.*]] = cir.load align(8) [[TMP0]] : !cir.ptr<!cir.ptr<!rec_V>>, !cir.ptr<!rec_V>
224
224
// CIR: [[TMP3:%.*]] = cir.get_member [[TMP2]][0] {name = "b"} : !cir.ptr<!rec_V> -> !cir.ptr<!u64i>
225
- // CIR: [[TMP4:%.*]] = cir.set_bitfield(#bfi_b, [[TMP3]] : !cir.ptr<!u64i>, [[TMP1]] : !s32i) {is_volatile} -> !s32i
225
+ // CIR: [[TMP4:%.*]] = cir.set_bitfield align(4) (#bfi_b, [[TMP3]] : !cir.ptr<!u64i>, [[TMP1]] : !s32i) {is_volatile} -> !s32i
226
226
227
227
// LLVM: define dso_local void @get_volatile
228
228
// LLVM: [[TMP0:%.*]] = alloca ptr, i64 1, align 8
229
229
// LLVM: [[TMP1:%.*]] = load ptr, ptr [[TMP0]], align 8
230
230
// LLVM: [[TMP2:%.*]] = getelementptr %struct.V, ptr [[TMP1]], i32 0, i32 0
231
- // LLVM: [[TMP3:%.*]] = load volatile i64, ptr [[TMP2]], align 8
231
+ // LLVM: [[TMP3:%.*]] = load volatile i64, ptr [[TMP2]], align 4
232
232
// LLVM: [[TMP4:%.*]] = and i64 [[TMP3]], -1095216660481
233
233
// LLVM: [[TMP5:%.*]] = or i64 [[TMP4]], 12884901888
234
- // LLVM: store volatile i64 [[TMP5]], ptr [[TMP2]], align 8
234
+ // LLVM: store volatile i64 [[TMP5]], ptr [[TMP2]], align 4
235
235
236
236
// OCGC: define dso_local void @get_volatile
237
237
// OCGC: [[TMP0:%.*]] = alloca ptr, align 8
@@ -249,16 +249,16 @@ void set_volatile(V* v) {
249
249
//CIR: [[TMP1:%.*]] = cir.const #cir.int<3> : !s32i
250
250
//CIR: [[TMP2:%.*]] = cir.load align(8) [[TMP0]] : !cir.ptr<!cir.ptr<!rec_V>>, !cir.ptr<!rec_V>
251
251
//CIR: [[TMP3:%.*]] = cir.get_member [[TMP2]][0] {name = "b"} : !cir.ptr<!rec_V> -> !cir.ptr<!u64i>
252
- //CIR: [[TMP4:%.*]] = cir.set_bitfield(#bfi_b, [[TMP3]] : !cir.ptr<!u64i>, [[TMP1]] : !s32i) {is_volatile} -> !s32i
252
+ //CIR: [[TMP4:%.*]] = cir.set_bitfield align(4) (#bfi_b, [[TMP3]] : !cir.ptr<!u64i>, [[TMP1]] : !s32i) {is_volatile} -> !s32i
253
253
254
254
// LLVM: define dso_local void @set_volatile
255
255
// LLVM: [[TMP0:%.*]] = alloca ptr, i64 1, align 8
256
256
// LLVM: [[TMP1:%.*]] = load ptr, ptr [[TMP0]], align 8
257
257
// LLVM: [[TMP2:%.*]] = getelementptr %struct.V, ptr [[TMP1]], i32 0, i32 0
258
- // LLVM: [[TMP3:%.*]] = load volatile i64, ptr [[TMP2]], align 8
258
+ // LLVM: [[TMP3:%.*]] = load volatile i64, ptr [[TMP2]], align 4
259
259
// LLVM: [[TMP4:%.*]] = and i64 [[TMP3]], -1095216660481
260
260
// LLVM: [[TMP5:%.*]] = or i64 [[TMP4]], 12884901888
261
- // LLVM: store volatile i64 [[TMP5]], ptr [[TMP2]], align 8
261
+ // LLVM: store volatile i64 [[TMP5]], ptr [[TMP2]], align 4
262
262
263
263
// OGCG: define dso_local void @set_volatile
264
264
// OGCG: [[TMP0:%.*]] = alloca ptr, align 8
@@ -276,24 +276,24 @@ void unOp(S* s) {
276
276
// CIR: [[TMP0:%.*]] = cir.alloca !cir.ptr<!rec_S>, !cir.ptr<!cir.ptr<!rec_S>>, ["s", init] {alignment = 8 : i64}
277
277
// CIR: [[TMP1:%.*]] = cir.load align(8) [[TMP0]] : !cir.ptr<!cir.ptr<!rec_S>>, !cir.ptr<!rec_S>
278
278
// CIR: [[TMP2:%.*]] = cir.get_member [[TMP1]][0] {name = "d"} : !cir.ptr<!rec_S> -> !cir.ptr<!u64i>
279
- // CIR: [[TMP3:%.*]] = cir.get_bitfield(#bfi_d, [[TMP2]] : !cir.ptr<!u64i>) -> !s32i
279
+ // CIR: [[TMP3:%.*]] = cir.get_bitfield align(4) (#bfi_d, [[TMP2]] : !cir.ptr<!u64i>) -> !s32i
280
280
// CIR: [[TMP4:%.*]] = cir.unary(inc, [[TMP3]]) nsw : !s32i, !s32i
281
- // CIR: cir.set_bitfield(#bfi_d, [[TMP2]] : !cir.ptr<!u64i>, [[TMP4]] : !s32i)
281
+ // CIR: cir.set_bitfield align(4) (#bfi_d, [[TMP2]] : !cir.ptr<!u64i>, [[TMP4]] : !s32i)
282
282
283
283
// LLVM: define {{.*@unOp}}
284
284
// LLVM: [[TMP0:%.*]] = getelementptr %struct.S, ptr [[LOAD0:%.*]], i32 0, i32 0
285
- // LLVM: [[TMP1:%.*]] = load i64, ptr [[TMP0]], align 8
285
+ // LLVM: [[TMP1:%.*]] = load i64, ptr [[TMP0]], align 4
286
286
// LLVM: [[TMP2:%.*]] = shl i64 [[TMP1]], 13
287
287
// LLVM: [[TMP3:%.*]] = ashr i64 [[TMP2]], 62
288
288
// LLVM: [[TMP4:%.*]] = trunc i64 [[TMP3]] to i32
289
289
// LLVM: [[TMP5:%.*]] = add nsw i32 [[TMP4]], 1
290
290
// LLVM: [[TMP6:%.*]] = zext i32 [[TMP5]] to i64
291
- // LLVM: [[TMP7:%.*]] = load i64, ptr [[TMP0]], align 8
291
+ // LLVM: [[TMP7:%.*]] = load i64, ptr [[TMP0]], align 4
292
292
// LLVM: [[TMP8:%.*]] = and i64 [[TMP6]], 3
293
293
// LLVM: [[TMP9:%.*]] = shl i64 [[TMP8]], 49
294
294
// LLVM: [[TMP10:%.*]] = and i64 [[TMP7]], -1688849860263937
295
295
// LLVM: [[TMP11:%.*]] = or i64 [[TMP10]], [[TMP9]]
296
- // LLVM: store i64 [[TMP11]], ptr [[TMP0]], align 8
296
+ // LLVM: store i64 [[TMP11]], ptr [[TMP0]], align 4
297
297
// LLVM: [[TMP12:%.*]] = shl i64 [[TMP8]], 62
298
298
// LLVM: [[TMP13:%.*]] = ashr i64 [[TMP12]], 62
299
299
// LLVM: [[TMP14:%.*]] = trunc i64 [[TMP13]] to i32
0 commit comments