Skip to content

Commit 66b2aad

Browse files
use [N x i8] for alloca types
1 parent b6d2d84 commit 66b2aad

27 files changed

+91
-68
lines changed

compiler/rustc_codegen_gcc/src/builder.rs

+12-5
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,18 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
734734
self.gcc_checked_binop(oop, typ, lhs, rhs)
735735
}
736736

737-
fn alloca(&mut self, ty: Type<'gcc>, align: Align) -> RValue<'gcc> {
737+
fn alloca(&mut self, size: Size, align: Align) -> RValue<'gcc> {
738+
let ty = self.cx.type_array(self.cx.type_i8(), size.bytes()).get_aligned(align.bytes());
739+
// TODO(antoyo): It might be better to return a LValue, but fixing the rustc API is non-trivial.
740+
self.stack_var_count.set(self.stack_var_count.get() + 1);
741+
self.current_func().new_local(None, ty, &format!("stack_var_{}", self.stack_var_count.get())).get_address(None)
742+
}
743+
744+
fn dynamic_alloca(&mut self, _len: RValue<'gcc>, _align: Align) -> RValue<'gcc> {
745+
unimplemented!();
746+
}
747+
748+
fn typed_alloca(&mut self, ty: Type<'gcc>, align: Align) -> RValue<'gcc> {
738749
// FIXME(antoyo): this check that we don't call get_aligned() a second time on a type.
739750
// Ideally, we shouldn't need to do this check.
740751
let aligned_type =
@@ -749,10 +760,6 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
749760
self.current_func().new_local(None, aligned_type, &format!("stack_var_{}", self.stack_var_count.get())).get_address(None)
750761
}
751762

752-
fn byte_array_alloca(&mut self, _len: RValue<'gcc>, _align: Align) -> RValue<'gcc> {
753-
unimplemented!();
754-
}
755-
756763
fn load(&mut self, pointee_ty: Type<'gcc>, ptr: RValue<'gcc>, align: Align) -> RValue<'gcc> {
757764
let block = self.llbb();
758765
let function = block.get_function();

compiler/rustc_codegen_gcc/src/intrinsic/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ impl<'gcc, 'tcx> ArgAbiExt<'gcc, 'tcx> for ArgAbi<'tcx, Ty<'tcx>> {
490490
// We instead thus allocate some scratch space...
491491
let scratch_size = cast.size(bx);
492492
let scratch_align = cast.align(bx);
493-
let llscratch = bx.alloca(cast.gcc_type(bx), scratch_align);
493+
let llscratch = bx.alloca(scratch_size, scratch_align);
494494
bx.lifetime_start(llscratch, scratch_size);
495495

496496
// ... where we first store the value...

compiler/rustc_codegen_gcc/src/intrinsic/simd.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use rustc_middle::span_bug;
1616
use rustc_middle::ty::layout::HasTyCtxt;
1717
use rustc_middle::ty::{self, Ty};
1818
use rustc_span::{sym, Span, Symbol};
19-
use rustc_target::abi::Align;
19+
use rustc_target::abi::{Align, Size};
2020

2121
use crate::builder::Builder;
2222
#[cfg(feature = "master")]
@@ -363,7 +363,7 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>(
363363
let ze = bx.zext(result, bx.type_ix(expected_bytes * 8));
364364

365365
// Convert the integer to a byte array
366-
let ptr = bx.alloca(bx.type_ix(expected_bytes * 8), Align::ONE);
366+
let ptr = bx.alloca(Size::from_bytes(expected_bytes), Align::ONE);
367367
bx.store(ze, ptr, Align::ONE);
368368
let array_ty = bx.type_array(bx.type_i8(), expected_bytes);
369369
let ptr = bx.pointercast(ptr, bx.cx.type_ptr_to(array_ty));

compiler/rustc_codegen_llvm/src/abi.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ impl<'ll, 'tcx> ArgAbiExt<'ll, 'tcx> for ArgAbi<'tcx, Ty<'tcx>> {
234234
// We instead thus allocate some scratch space...
235235
let scratch_size = cast.size(bx);
236236
let scratch_align = cast.align(bx);
237-
let llscratch = bx.alloca(cast.llvm_type(bx), scratch_align);
237+
let llscratch = bx.alloca(scratch_size, scratch_align);
238238
bx.lifetime_start(llscratch, scratch_size);
239239

240240
// ... where we first store the value...

compiler/rustc_codegen_llvm/src/builder.rs

+14-3
Original file line numberDiff line numberDiff line change
@@ -466,20 +466,31 @@ impl<'a, 'll, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
466466
val
467467
}
468468

469-
fn alloca(&mut self, ty: &'ll Type, align: Align) -> &'ll Value {
469+
fn alloca(&mut self, size: Size, align: Align) -> &'ll Value {
470470
let mut bx = Builder::with_cx(self.cx);
471471
bx.position_at_start(unsafe { llvm::LLVMGetFirstBasicBlock(self.llfn()) });
472+
let ty = self.cx().type_array(self.cx().type_i8(), size.bytes());
472473
unsafe {
473474
let alloca = llvm::LLVMBuildAlloca(bx.llbuilder, ty, UNNAMED);
474475
llvm::LLVMSetAlignment(alloca, align.bytes() as c_uint);
475476
alloca
476477
}
477478
}
478479

479-
fn byte_array_alloca(&mut self, len: &'ll Value, align: Align) -> &'ll Value {
480+
fn dynamic_alloca(&mut self, size: &'ll Value, align: Align) -> &'ll Value {
480481
unsafe {
481482
let alloca =
482-
llvm::LLVMBuildArrayAlloca(self.llbuilder, self.cx().type_i8(), len, UNNAMED);
483+
llvm::LLVMBuildArrayAlloca(self.llbuilder, self.cx().type_i8(), size, UNNAMED);
484+
llvm::LLVMSetAlignment(alloca, align.bytes() as c_uint);
485+
alloca
486+
}
487+
}
488+
489+
fn typed_alloca(&mut self, ty: &'ll Type, align: Align) -> &'ll Value {
490+
let mut bx = Builder::with_cx(self.cx);
491+
bx.position_at_start(unsafe { llvm::LLVMGetFirstBasicBlock(self.llfn()) });
492+
unsafe {
493+
let alloca = llvm::LLVMBuildAlloca(bx.llbuilder, ty, UNNAMED);
483494
llvm::LLVMSetAlignment(alloca, align.bytes() as c_uint);
484495
alloca
485496
}

compiler/rustc_codegen_llvm/src/intrinsic.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use rustc_middle::ty::layout::{FnAbiOf, HasTyCtxt, LayoutOf};
1818
use rustc_middle::ty::{self, GenericArgsRef, Ty};
1919
use rustc_middle::{bug, span_bug};
2020
use rustc_span::{sym, Span, Symbol};
21-
use rustc_target::abi::{self, Align, HasDataLayout, Primitive};
21+
use rustc_target::abi::{self, Align, HasDataLayout, Primitive, Size};
2222
use rustc_target::spec::{HasTargetSpec, PanicStrategy};
2323

2424
use std::cmp::Ordering;
@@ -635,8 +635,9 @@ fn codegen_msvc_try<'ll>(
635635
// }
636636
//
637637
// More information can be found in libstd's seh.rs implementation.
638+
let ptr_size = bx.tcx().data_layout.pointer_size;
638639
let ptr_align = bx.tcx().data_layout.pointer_align.abi;
639-
let slot = bx.alloca(bx.type_ptr(), ptr_align);
640+
let slot = bx.alloca(ptr_size, ptr_align);
640641
let try_func_ty = bx.type_func(&[bx.type_ptr()], bx.type_void());
641642
bx.invoke(try_func_ty, None, None, try_func, &[data], normal, catchswitch, None);
642643

@@ -909,7 +910,7 @@ fn codegen_emcc_try<'ll>(
909910
let ptr_align = bx.tcx().data_layout.pointer_align.abi;
910911
let i8_align = bx.tcx().data_layout.i8_align.abi;
911912
let catch_data_type = bx.type_struct(&[bx.type_ptr(), bx.type_bool()], false);
912-
let catch_data = bx.alloca(catch_data_type, ptr_align);
913+
let catch_data = bx.typed_alloca(catch_data_type, ptr_align);
913914
let catch_data_0 =
914915
bx.inbounds_gep(catch_data_type, catch_data, &[bx.const_usize(0), bx.const_usize(0)]);
915916
bx.store(ptr, catch_data_0, ptr_align);
@@ -1360,7 +1361,7 @@ fn generic_simd_intrinsic<'ll, 'tcx>(
13601361
let ze = bx.zext(i_, bx.type_ix(expected_bytes * 8));
13611362

13621363
// Convert the integer to a byte array
1363-
let ptr = bx.alloca(bx.type_ix(expected_bytes * 8), Align::ONE);
1364+
let ptr = bx.alloca(Size::from_bytes(expected_bytes), Align::ONE);
13641365
bx.store(ze, ptr, Align::ONE);
13651366
let array_ty = bx.type_array(bx.type_i8(), expected_bytes);
13661367
return Ok(bx.load(array_ty, ptr, Align::ONE));

compiler/rustc_codegen_ssa/src/base.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ fn get_argc_argv<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
511511
let param_handle = bx.get_param(0);
512512
let param_system_table = bx.get_param(1);
513513
let arg_argc = bx.const_int(cx.type_isize(), 2);
514-
let arg_argv = bx.alloca(cx.type_array(cx.type_ptr(), 2), Align::ONE);
514+
let arg_argv = bx.typed_alloca(cx.type_array(cx.type_ptr(), 2), Align::ONE);
515515
bx.store(param_handle, arg_argv, Align::ONE);
516516
let arg_argv_el1 = bx.gep(cx.type_ptr(), arg_argv, &[bx.const_int(cx.type_int(), 1)]);
517517
bx.store(param_system_table, arg_argv_el1, Align::ONE);

compiler/rustc_codegen_ssa/src/mir/operand.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ impl<'a, 'tcx, V: CodegenObject> OperandRef<'tcx, V> {
323323
let llfield_ty = bx.cx().backend_type(field);
324324

325325
// Can't bitcast an aggregate, so round trip through memory.
326-
let llptr = bx.alloca(llfield_ty, field.align.abi);
326+
let llptr = bx.alloca(field.size, field.align.abi);
327327
bx.store(*llval, llptr, field.align.abi);
328328
*llval = bx.load(llfield_ty, llptr, field.align.abi);
329329
}
@@ -471,7 +471,7 @@ impl<'a, 'tcx, V: CodegenObject> OperandValue<V> {
471471
let align_minus_1 = bx.sub(align, one);
472472
let size_extra = bx.add(size, align_minus_1);
473473
let min_align = Align::ONE;
474-
let alloca = bx.byte_array_alloca(size_extra, min_align);
474+
let alloca = bx.dynamic_alloca(size_extra, min_align);
475475
let address = bx.ptrtoint(alloca, bx.type_isize());
476476
let neg_address = bx.neg(address);
477477
let offset = bx.and(neg_address, align_minus_1);

compiler/rustc_codegen_ssa/src/mir/place.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ impl<'a, 'tcx, V: CodegenObject> PlaceRef<'tcx, V> {
5757
align: Align,
5858
) -> Self {
5959
assert!(layout.is_sized(), "tried to statically allocate unsized place");
60-
let tmp = bx.alloca(bx.cx().backend_type(layout), align);
60+
let tmp = bx.alloca(layout.size, align);
6161
Self::new_sized_aligned(tmp, layout, align)
6262
}
6363

compiler/rustc_codegen_ssa/src/traits/builder.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,12 @@ pub trait BuilderMethods<'a, 'tcx>:
141141
}
142142
fn to_immediate_scalar(&mut self, val: Self::Value, scalar: Scalar) -> Self::Value;
143143

144-
fn alloca(&mut self, ty: Self::Type, align: Align) -> Self::Value;
145-
fn byte_array_alloca(&mut self, len: Self::Value, align: Align) -> Self::Value;
144+
/// Used for all fixed-size Rust types.
145+
fn alloca(&mut self, size: Size, align: Align) -> Self::Value;
146+
/// Used for DSTs and unsized locals.
147+
fn dynamic_alloca(&mut self, size: Self::Value, align: Align) -> Self::Value;
148+
/// Should only be used for types without a Rust layout, e.g. C++ EH catch data.
149+
fn typed_alloca(&mut self, ty: Self::Type, align: Align) -> Self::Value;
146150

147151
fn load(&mut self, ty: Self::Type, ptr: Self::Value, align: Align) -> Self::Value;
148152
fn volatile_load(&mut self, ty: Self::Type, ptr: Self::Value) -> Self::Value;

tests/codegen/align-byval.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -106,20 +106,20 @@ pub struct ForceAlign16 {
106106
pub unsafe fn call_na1(x: NaturalAlign1) {
107107
// CHECK: start:
108108

109-
// m68k: [[ALLOCA:%[a-z0-9+]]] = alloca %NaturalAlign1, align 1
109+
// m68k: [[ALLOCA:%[a-z0-9+]]] = alloca [2 x i8], align 1
110110
// m68k: call void @natural_align_1({{.*}}byval(%NaturalAlign1) align 1{{.*}} [[ALLOCA]])
111111

112-
// wasm: [[ALLOCA:%[a-z0-9+]]] = alloca %NaturalAlign1, align 1
112+
// wasm: [[ALLOCA:%[a-z0-9+]]] = alloca [2 x i8], align 1
113113
// wasm: call void @natural_align_1({{.*}}byval(%NaturalAlign1) align 1{{.*}} [[ALLOCA]])
114114

115115
// x86_64-linux: call void @natural_align_1(i16
116116

117117
// x86_64-windows: call void @natural_align_1(i16
118118

119-
// i686-linux: [[ALLOCA:%[a-z0-9+]]] = alloca %NaturalAlign1, align 4
119+
// i686-linux: [[ALLOCA:%[a-z0-9+]]] = alloca [2 x i8], align 4
120120
// i686-linux: call void @natural_align_1({{.*}}byval(%NaturalAlign1) align 4{{.*}} [[ALLOCA]])
121121

122-
// i686-windows: [[ALLOCA:%[a-z0-9+]]] = alloca %NaturalAlign1, align 4
122+
// i686-windows: [[ALLOCA:%[a-z0-9+]]] = alloca [2 x i8], align 4
123123
// i686-windows: call void @natural_align_1({{.*}}byval(%NaturalAlign1) align 4{{.*}} [[ALLOCA]])
124124
natural_align_1(x);
125125
}
@@ -134,10 +134,10 @@ pub unsafe fn call_na2(x: NaturalAlign2) {
134134
// x86_64-linux-NEXT: call void @natural_align_2
135135
// x86_64-windows-NEXT: call void @natural_align_2
136136

137-
// i686-linux: [[ALLOCA:%[0-9]+]] = alloca %NaturalAlign2, align 4
137+
// i686-linux: [[ALLOCA:%[0-9]+]] = alloca [34 x i8], align 4
138138
// i686-linux: call void @natural_align_2({{.*}}byval(%NaturalAlign2) align 4{{.*}} [[ALLOCA]])
139139

140-
// i686-windows: [[ALLOCA:%[0-9]+]] = alloca %NaturalAlign2, align 4
140+
// i686-windows: [[ALLOCA:%[0-9]+]] = alloca [34 x i8], align 4
141141
// i686-windows: call void @natural_align_2({{.*}}byval(%NaturalAlign2) align 4{{.*}} [[ALLOCA]])
142142
natural_align_2(x);
143143
}

tests/codegen/align-enum.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ pub struct Nested64 {
1919
// CHECK-LABEL: @align64
2020
#[no_mangle]
2121
pub fn align64(a: u32) -> Align64 {
22-
// CHECK: %a64 = alloca %Align64, align 64
22+
// CHECK: %a64 = alloca [64 x i8], align 64
2323
// CHECK: call void @llvm.memcpy.{{.*}}(ptr align 64 %{{.*}}, ptr align 64 %{{.*}}, i{{[0-9]+}} 64, i1 false)
2424
let a64 = Align64::A(a);
2525
a64
@@ -28,7 +28,7 @@ pub fn align64(a: u32) -> Align64 {
2828
// CHECK-LABEL: @nested64
2929
#[no_mangle]
3030
pub fn nested64(a: u8, b: u32, c: u16) -> Nested64 {
31-
// CHECK: %n64 = alloca %Nested64, align 64
31+
// CHECK: %n64 = alloca [128 x i8], align 64
3232
let n64 = Nested64 { a, b: Align64::B(b), c };
3333
n64
3434
}

tests/codegen/align-struct.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ pub enum Enum64 {
3030
// CHECK-LABEL: @align64
3131
#[no_mangle]
3232
pub fn align64(i : i32) -> Align64 {
33-
// CHECK: %a64 = alloca %Align64, align 64
33+
// CHECK: %a64 = alloca [64 x i8], align 64
3434
// CHECK: call void @llvm.memcpy.{{.*}}(ptr align 64 %{{.*}}, ptr align 64 %{{.*}}, i{{[0-9]+}} 64, i1 false)
3535
let a64 = Align64(i);
3636
a64
@@ -48,23 +48,23 @@ pub fn align64_load(a: Align64) -> i32 {
4848
// CHECK-LABEL: @nested64
4949
#[no_mangle]
5050
pub fn nested64(a: Align64, b: i32, c: i32, d: i8) -> Nested64 {
51-
// CHECK: %n64 = alloca %Nested64, align 64
51+
// CHECK: %n64 = alloca [128 x i8], align 64
5252
let n64 = Nested64 { a, b, c, d };
5353
n64
5454
}
5555

5656
// CHECK-LABEL: @enum4
5757
#[no_mangle]
5858
pub fn enum4(a: i32) -> Enum4 {
59-
// CHECK: %e4 = alloca %Enum4, align 4
59+
// CHECK: %e4 = alloca [8 x i8], align 4
6060
let e4 = Enum4::A(a);
6161
e4
6262
}
6363

6464
// CHECK-LABEL: @enum64
6565
#[no_mangle]
6666
pub fn enum64(a: Align64) -> Enum64 {
67-
// CHECK: %e64 = alloca %Enum64, align 64
67+
// CHECK: %e64 = alloca [128 x i8], align 64
6868
let e64 = Enum64::A(a);
6969
e64
7070
}

tests/codegen/array-map.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ pub fn short_integer_map(x: [u32; 8]) -> [u32; 8] {
2727
#[no_mangle]
2828
pub fn long_integer_map(x: [u32; 512]) -> [u32; 512] {
2929
// CHECK: start:
30-
// CHECK-NEXT: alloca [512 x i32]
30+
// CHECK-NEXT: alloca [2048 x i8]
3131
// CHECK-NOT: alloca
3232
// CHECK: mul <{{[0-9]+}} x i32>
3333
// CHECK: add <{{[0-9]+}} x i32>

tests/codegen/debug-fndef-size.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pub fn main() {
1212
foo(0, 1, i32::cmp);
1313
}
1414

15-
// CHECK: %compare.dbg.spill = alloca {}, align 1
15+
// CHECK: %compare.dbg.spill = alloca [0 x i8], align 1
1616
// CHECK: call void @llvm.dbg.declare(metadata ptr %compare.dbg.spill, metadata ![[VAR:.*]], metadata !DIExpression()), !dbg !{{.*}}
1717
// CHECK: ![[TYPE:.*]] = !DIDerivedType(tag: DW_TAG_pointer_type, name: "fn(&i32, &i32) -> core::cmp::Ordering", baseType: !{{.*}}, align: 1, dwarfAddressSpace: {{.*}})
1818
// CHECK: ![[VAR]] = !DILocalVariable(name: "compare", scope: !{{.*}}, file: !{{.*}}, line: {{.*}}, type: ![[TYPE]], align: 1)

tests/codegen/enum/enum-match.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pub enum Enum0 {
1515
// CHECK-NEXT: start:
1616
// CHECK-NEXT: %1 = icmp eq i8 %0, 2
1717
// CHECK-NEXT: %2 = and i8 %0, 1
18-
// CHECK-NEXT: %_0.0 = select i1 %1, i8 13, i8 %2
18+
// CHECK-NEXT: %{{.+}} = select i1 %1, i8 13, i8 %2
1919
#[no_mangle]
2020
pub fn match0(e: Enum0) -> u8 {
2121
use Enum0::*;

tests/codegen/i128-x86-align.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
// correctly.
77

88
// CHECK: %ScalarPair = type { i32, [3 x i32], i128 }
9-
// CHECK: %Struct = type { i32, i32, [2 x i32], i128 }
109

1110
#![feature(core_intrinsics)]
1211

@@ -43,7 +42,7 @@ pub fn store(x: &mut ScalarPair) {
4342
#[no_mangle]
4443
pub fn alloca() {
4544
// CHECK-LABEL: @alloca(
46-
// CHECK: [[X:%.*]] = alloca %ScalarPair, align 16
45+
// CHECK: [[X:%.*]] = alloca [32 x i8], align 16
4746
// CHECK: store i32 1, ptr %x, align 16
4847
// CHECK-NEXT: [[GEP:%.*]] = getelementptr inbounds i8, ptr %x, i64 16
4948
// CHECK-NEXT: store i128 2, ptr [[GEP]], align 16
@@ -55,7 +54,7 @@ pub fn alloca() {
5554
pub fn load_volatile(x: &ScalarPair) -> ScalarPair {
5655
// CHECK-LABEL: @load_volatile(
5756
// CHECK-SAME: align 16 dereferenceable(32) %x
58-
// CHECK: [[TMP:%.*]] = alloca %ScalarPair, align 16
57+
// CHECK: [[TMP:%.*]] = alloca [32 x i8], align 16
5958
// CHECK: [[LOAD:%.*]] = load volatile %ScalarPair, ptr %x, align 16
6059
// CHECK-NEXT: store %ScalarPair [[LOAD]], ptr [[TMP]], align 16
6160
// CHECK-NEXT: [[A:%.*]] = load i32, ptr [[TMP]], align 16
@@ -67,7 +66,7 @@ pub fn load_volatile(x: &ScalarPair) -> ScalarPair {
6766
#[no_mangle]
6867
pub fn transmute(x: ScalarPair) -> (std::mem::MaybeUninit<i128>, i128) {
6968
// CHECK-LABEL: define { i128, i128 } @transmute(i32 noundef %x.0, i128 noundef %x.1)
70-
// CHECK: [[TMP:%.*]] = alloca { i128, i128 }, align 16
69+
// CHECK: [[TMP:%.*]] = alloca [32 x i8], align 16
7170
// CHECK-NEXT: store i32 %x.0, ptr [[TMP]], align 16
7271
// CHECK-NEXT: [[GEP:%.*]] = getelementptr inbounds i8, ptr [[TMP]], i64 16
7372
// CHECK-NEXT: store i128 %x.1, ptr [[GEP]], align 16
@@ -92,7 +91,7 @@ pub struct Struct {
9291
pub fn store_struct(x: &mut Struct) {
9392
// CHECK-LABEL: @store_struct(
9493
// CHECK-SAME: align 16 dereferenceable(32) %x
95-
// CHECK: [[TMP:%.*]] = alloca %Struct, align 16
94+
// CHECK: [[TMP:%.*]] = alloca [32 x i8], align 16
9695
// CHECK: store i32 1, ptr [[TMP]], align 16
9796
// CHECK-NEXT: [[GEP1:%.*]] = getelementptr inbounds i8, ptr [[TMP]], i64 4
9897
// CHECK-NEXT: store i32 2, ptr [[GEP1]], align 4

0 commit comments

Comments
 (0)