https://github.com/efriedma-quic created https://github.com/llvm/llvm-project/pull/244740
There's no reason to let the backend try to infer the alignment here. >From f25cb5dc0c7c84f2db946d6a8cfce7a5522e2993 Mon Sep 17 00:00:00 2001 From: Eli Friedman <[email protected]> Date: Fri, 20 Nov 2026 14:36:25 -0800 Subject: [PATCH] [clang codegen] Add align attributes to inalloca and arguments. There's no reason to let the backend try to infer the alignment here. --- clang/lib/CodeGen/CGCall.cpp | 5 ++-- .../CodeGenCXX/attr-target-mv-inalloca.cpp | 8 +++---- clang/test/CodeGenCXX/attr-x86-interrupt.cpp | 24 +++++++++---------- clang/test/CodeGenCXX/inalloca-lambda.cpp | 4 ++-- .../test/CodeGenCXX/inalloca-overaligned.cpp | 8 +++---- clang/test/CodeGenCXX/inalloca-stmtexpr.cpp | 2 +- clang/test/CodeGenCXX/inalloca-vector.cpp | 8 +++---- .../CodeGenCXX/inheriting-constructor.cpp | 8 +++---- .../CodeGenCXX/microsoft-abi-arg-order.cpp | 4 ++-- .../CodeGenCXX/microsoft-abi-byval-sret.cpp | 16 ++++++------- .../CodeGenCXX/microsoft-abi-byval-thunks.cpp | 12 +++++----- .../CodeGenCXX/microsoft-abi-byval-vararg.cpp | 4 ++-- .../CodeGenCXX/microsoft-abi-eh-cleanups.cpp | 2 +- .../microsoft-abi-sret-and-byval.cpp | 20 ++++++++-------- .../microsoft-abi-vmemptr-conflicts.cpp | 2 +- ...nonvirtual-inheritance-this-adjustment.cpp | 2 +- clang/test/CodeGenCXX/ms-thunks-ehspec.cpp | 4 ++-- clang/test/CodeGenCXX/regcall.cpp | 2 +- clang/test/CodeGenCXX/regcall4.cpp | 2 +- .../CodeGenCXX/vararg-non-pod-ms-compat.cpp | 2 +- clang/test/CodeGenObjCXX/arc-indirect.mm | 4 ++-- .../microsoft-abi-arc-param-order.mm | 2 +- 22 files changed, 73 insertions(+), 72 deletions(-) diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp index ae73b16a42782d..2297ab8283e208 100644 --- a/clang/lib/CodeGen/CGCall.cpp +++ b/clang/lib/CodeGen/CGCall.cpp @@ -3102,8 +3102,9 @@ void CodeGenModule::ConstructAttributeList(StringRef Name, // Attach attributes to inalloca argument. if (IRFunctionArgs.hasInallocaArg()) { - ArgAttrs[IRFunctionArgs.getInallocaArgNo()].addInAllocaAttr( - FI.getArgStruct()); + llvm::AttrBuilder &Attrs = ArgAttrs[IRFunctionArgs.getInallocaArgNo()]; + Attrs.addInAllocaAttr(FI.getArgStruct()); + Attrs.addAlignmentAttr(FI.getArgStructAlignment().getAsAlign()); } // Apply `nonnull`, `dereferenceable(N)` and `align N` to the `this` argument, diff --git a/clang/test/CodeGenCXX/attr-target-mv-inalloca.cpp b/clang/test/CodeGenCXX/attr-target-mv-inalloca.cpp index e96af5d772d227..b052a6bb4ef887 100644 --- a/clang/test/CodeGenCXX/attr-target-mv-inalloca.cpp +++ b/clang/test/CodeGenCXX/attr-target-mv-inalloca.cpp @@ -21,20 +21,20 @@ void usage() { // DARWIN-NOT: inalloca( // LINUX-NOT: inalloca( -// WINDOWS: define dso_local noundef i32 @"?bar@@YAHUFoo@@@Z"(ptr inalloca(<{ %struct.Foo }>) %0) +// WINDOWS: define dso_local noundef i32 @"?bar@@YAHUFoo@@@Z"(ptr inalloca(<{ %struct.Foo }>) align 4 %0) // WINDOWS: %[[O:[0-9a-zA-Z]+]] = getelementptr inbounds nuw <{ %struct.Foo }>, ptr %0, i32 0, i32 0 // WINDOWS: %[[X:[0-9a-zA-Z]+]] = getelementptr inbounds nuw %struct.Foo, ptr %[[O]], i32 0, i32 0 // WINDOWS: %[[LOAD:[0-9a-zA-Z]+]] = load i32, ptr %[[X]] // WINDOWS: ret i32 %[[LOAD]] -// WINDOWS: define dso_local noundef i32 @"?bar@@YAHUFoo@@@Z.sse4.2"(ptr inalloca(<{ %struct.Foo }>) %0) +// WINDOWS: define dso_local noundef i32 @"?bar@@YAHUFoo@@@Z.sse4.2"(ptr inalloca(<{ %struct.Foo }>) align 4 %0) // WINDOWS: %[[O:[0-9a-zA-Z]+]] = getelementptr inbounds nuw <{ %struct.Foo }>, ptr %0, i32 0, i32 0 // WINDOWS: %[[X:[0-9a-zA-Z]+]] = getelementptr inbounds nuw %struct.Foo, ptr %[[O]], i32 0, i32 0 // WINDOWS: %[[LOAD:[0-9a-zA-Z]+]] = load i32, ptr %[[X]] // WINDOWS: %[[ADD:[0-9a-zA-Z]+]] = add nsw i32 %[[LOAD]], 1 // WINDOWS: ret i32 %[[ADD]] -// WINDOWS: define dso_local noundef i32 @"?bar@@YAHUFoo@@@Z.arch_ivybridge"(ptr inalloca(<{ %struct.Foo }>) %0) +// WINDOWS: define dso_local noundef i32 @"?bar@@YAHUFoo@@@Z.arch_ivybridge"(ptr inalloca(<{ %struct.Foo }>) align 4 %0) // WINDOWS: %[[O:[0-9a-zA-Z]+]] = getelementptr inbounds nuw <{ %struct.Foo }>, ptr %0, i32 0, i32 0 // WINDOWS: %[[X:[0-9a-zA-Z]+]] = getelementptr inbounds nuw %struct.Foo, ptr %[[O]], i32 0, i32 0 // WINDOWS: %[[LOAD:[0-9a-zA-Z]+]] = load i32, ptr %[[X]] @@ -44,7 +44,7 @@ void usage() { // WINDOWS: define dso_local void @"?usage@@YAXXZ"() // WINDOWS: %[[F:[0-9a-zA-Z]+]] = alloca %struct.Foo // WINDOWS: %[[ARGMEM:[0-9a-zA-Z]+]] = alloca inalloca <{ %struct.Foo }> -// WINDOWS: %[[CALL:[0-9a-zA-Z]+]] = call noundef i32 @"?bar@@YAHUFoo@@@Z.resolver"(ptr inalloca(<{ %struct.Foo }>) %[[ARGMEM]]) +// WINDOWS: %[[CALL:[0-9a-zA-Z]+]] = call noundef i32 @"?bar@@YAHUFoo@@@Z.resolver"(ptr inalloca(<{ %struct.Foo }>) align 4 %[[ARGMEM]]) // WINDOWS: define weak_odr dso_local i32 @"?bar@@YAHUFoo@@@Z.resolver"(ptr %0) // WINDOWS: %[[RET:[0-9a-zA-Z]+]] = musttail call i32 @"?bar@@YAHUFoo@@@Z.arch_ivybridge"(ptr %0) diff --git a/clang/test/CodeGenCXX/attr-x86-interrupt.cpp b/clang/test/CodeGenCXX/attr-x86-interrupt.cpp index 863db4a05975ab..641442c9b46fb2 100644 --- a/clang/test/CodeGenCXX/attr-x86-interrupt.cpp +++ b/clang/test/CodeGenCXX/attr-x86-interrupt.cpp @@ -18,18 +18,18 @@ struct St { static void foo9(int *a) __attribute__((interrupt)) {} }; // X86_64_LINUX: @llvm.compiler.used = appending global [3 x ptr] [ptr @{{.*}}foo7{{.*}}, ptr @{{.*}}foo8{{.*}}, ptr @{{.*}}foo9{{.*}}], section "llvm.metadata" -// X86_64_LINUX: define{{.*}} x86_intrcc void @{{.*}}foo7{{.*}}(ptr noundef byval(i32) %{{.+}}, i64 noundef %{{.+}}) -// X86_64_LINUX: define{{.*}} x86_intrcc void @{{.*}}foo8{{.*}}(ptr noundef byval(i32) %{{.+}}) -// X86_64_LINUX: define linkonce_odr x86_intrcc void @{{.*}}foo9{{.*}}(ptr noundef byval(i32) %{{.+}}) +// X86_64_LINUX: define{{.*}} x86_intrcc void @{{.*}}foo7{{.*}}(ptr noundef byval(i32) align 4 %{{.+}}, i64 noundef %{{.+}}) +// X86_64_LINUX: define{{.*}} x86_intrcc void @{{.*}}foo8{{.*}}(ptr noundef byval(i32) align 4 %{{.+}}) +// X86_64_LINUX: define linkonce_odr x86_intrcc void @{{.*}}foo9{{.*}}(ptr noundef byval(i32) align 4 %{{.+}}) // X86_LINUX: @llvm.compiler.used = appending global [3 x ptr] [ptr @{{.*}}foo7{{.*}}, ptr @{{.*}}foo8{{.*}}, ptr @{{.*}}foo9{{.*}}], section "llvm.metadata" -// X86_LINUX: define{{.*}} x86_intrcc void @{{.*}}foo7{{.*}}(ptr noundef byval(i32) %{{.+}}, i32 noundef %{{.+}}) -// X86_LINUX: define{{.*}} x86_intrcc void @{{.*}}foo8{{.*}}(ptr noundef byval(i32) %{{.+}}) -// X86_LINUX: define linkonce_odr x86_intrcc void @{{.*}}foo9{{.*}}(ptr noundef byval(i32) %{{.+}}) +// X86_LINUX: define{{.*}} x86_intrcc void @{{.*}}foo7{{.*}}(ptr noundef byval(i32) align 4 %{{.+}}, i32 noundef %{{.+}}) +// X86_LINUX: define{{.*}} x86_intrcc void @{{.*}}foo8{{.*}}(ptr noundef byval(i32) align 4 %{{.+}}) +// X86_LINUX: define linkonce_odr x86_intrcc void @{{.*}}foo9{{.*}}(ptr noundef byval(i32) align 4 %{{.+}}) // X86_64_WIN: @llvm.used = appending global [3 x ptr] [ptr @{{.*}}foo7{{.*}}, ptr @{{.*}}foo8{{.*}}, ptr @{{.*}}foo9{{.*}}], section "llvm.metadata" -// X86_64_WIN: define dso_local x86_intrcc void @{{.*}}foo7{{.*}}(ptr noundef byval(i32) %{{.+}}, i64 noundef %{{.+}}) -// X86_64_WIN: define dso_local x86_intrcc void @{{.*}}foo8{{.*}}(ptr noundef byval(i32) %{{.+}}) -// X86_64_WIN: define linkonce_odr dso_local x86_intrcc void @{{.*}}foo9{{.*}}(ptr noundef byval(i32) %{{.+}}) +// X86_64_WIN: define dso_local x86_intrcc void @{{.*}}foo7{{.*}}(ptr noundef byval(i32) align 4 %{{.+}}, i64 noundef %{{.+}}) +// X86_64_WIN: define dso_local x86_intrcc void @{{.*}}foo8{{.*}}(ptr noundef byval(i32) align 4 %{{.+}}) +// X86_64_WIN: define linkonce_odr dso_local x86_intrcc void @{{.*}}foo9{{.*}}(ptr noundef byval(i32) align 4 %{{.+}}) // X86_WIN: @llvm.used = appending global [3 x ptr] [ptr @{{.*}}foo7{{.*}}, ptr @{{.*}}foo8{{.*}}, ptr @{{.*}}foo9{{.*}}], section "llvm.metadata" -// X86_WIN: define dso_local x86_intrcc void @{{.*}}foo7{{.*}}(ptr noundef byval(i32) %{{.+}}, i32 noundef %{{.+}}) -// X86_WIN: define dso_local x86_intrcc void @{{.*}}foo8{{.*}}(ptr noundef byval(i32) %{{.+}}) -// X86_WIN: define linkonce_odr dso_local x86_intrcc void @{{.*}}foo9{{.*}}(ptr noundef byval(i32) %{{.+}}) +// X86_WIN: define dso_local x86_intrcc void @{{.*}}foo7{{.*}}(ptr noundef byval(i32) align 4 %{{.+}}, i32 noundef %{{.+}}) +// X86_WIN: define dso_local x86_intrcc void @{{.*}}foo8{{.*}}(ptr noundef byval(i32) align 4 %{{.+}}) +// X86_WIN: define linkonce_odr dso_local x86_intrcc void @{{.*}}foo9{{.*}}(ptr noundef byval(i32) align 4 %{{.+}}) diff --git a/clang/test/CodeGenCXX/inalloca-lambda.cpp b/clang/test/CodeGenCXX/inalloca-lambda.cpp index 72a5b04c970209..7b48387ce53fa1 100644 --- a/clang/test/CodeGenCXX/inalloca-lambda.cpp +++ b/clang/test/CodeGenCXX/inalloca-lambda.cpp @@ -18,7 +18,7 @@ void test() { // CHECK: define internal x86_thiscallcc noundef i32 // CHECK-SAME: @"??R<lambda_0>@?0??test@@YAXXZ@QBE?A?<auto>@@UA@@@Z" -// CHECK-SAME: (ptr noundef %this, ptr inalloca(<{ %struct.A }>) %[[ARG:.*]]) +// CHECK-SAME: (ptr noundef %this, ptr inalloca(<{ %struct.A }>) align 4 %[[ARG:.*]]) // CHECK: %[[V:.*]] = getelementptr inbounds nuw <{ %struct.A }>, ptr %[[ARG]], i32 0, i32 0 // CHECK: %call = call x86_thiscallcc noundef i32 // CHECK-SAME: @"?__impl@<lambda_0>@?0??test@@YAXXZ@QBE?A?<auto>@@UA@@@Z" @@ -26,7 +26,7 @@ void test() { // CHECK: define internal noundef i32 // CHECK-SAME: @"?__invoke@<lambda_0>@?0??test@@YAXXZ@CA?A?<auto>@@UA@@@Z" -// CHECK-SAME: (ptr inalloca(<{ %struct.A }>) %[[ARG:.*]]) +// CHECK-SAME: (ptr inalloca(<{ %struct.A }>) align 4 %[[ARG:.*]]) // CHECK: %unused.capture = alloca %class.anon, align 1 // CHECK: %[[VAR:.*]] = getelementptr inbounds nuw <{ %struct.A }>, ptr %[[ARG]], i32 0, i32 0 // CHECK: %call = call x86_thiscallcc noundef i32 diff --git a/clang/test/CodeGenCXX/inalloca-overaligned.cpp b/clang/test/CodeGenCXX/inalloca-overaligned.cpp index 83ac138ce313bc..1c2759880f3b2e 100644 --- a/clang/test/CodeGenCXX/inalloca-overaligned.cpp +++ b/clang/test/CodeGenCXX/inalloca-overaligned.cpp @@ -28,7 +28,7 @@ int receive_inalloca_overaligned(NonTrivial nt, OverAligned o) { } // CHECK-LABEL: define dso_local noundef i32 @"?receive_inalloca_overaligned@@Y{{.*}}" -// CHECK-SAME: (ptr inalloca(<{ %struct.NonTrivial, ptr }>) %0) +// CHECK-SAME: (ptr inalloca(<{ %struct.NonTrivial, ptr }>) align 4 %0) int pass_inalloca_overaligned() { gvi32 = receive_inalloca_overaligned(NonTrivial(), OverAligned()); @@ -50,7 +50,7 @@ int pass_inalloca_overaligned() { // Store the address of an OverAligned temporary into the struct. // CHECK: getelementptr inbounds nuw <{ %struct.NonTrivial, ptr }>, ptr %{{.*}}, i32 0, i32 1 // CHECK: store ptr [[TMP]], ptr %{{.*}}, align 4 -// CHECK: call noundef i32 @"?receive_inalloca_overaligned@@Y{{.*}}"(ptr inalloca(<{ %struct.NonTrivial, ptr }>) %argmem) +// CHECK: call noundef i32 @"?receive_inalloca_overaligned@@Y{{.*}}"(ptr inalloca(<{ %struct.NonTrivial, ptr }>) align 4 %argmem) int receive_both(Both o) { return o.x + o.y; @@ -74,7 +74,7 @@ int receive_inalloca_both(NonTrivial nt, Both o) { } // CHECK-LABEL: define dso_local noundef i32 @"?receive_inalloca_both@@Y{{.*}}" -// CHECK-SAME: (ptr inalloca(<{ %struct.NonTrivial, ptr }>) %0) +// CHECK-SAME: (ptr inalloca(<{ %struct.NonTrivial, ptr }>) align 4 %0) int pass_inalloca_both() { gvi32 = receive_inalloca_both(NonTrivial(), Both()); @@ -84,7 +84,7 @@ int pass_inalloca_both() { // CHECK-LABEL: define dso_local noundef i32 @"?pass_inalloca_both@@Y{{.*}}" // CHECK: [[TMP:%[^ ]*]] = alloca %struct.Both, align 8 // CHECK: call x86_thiscallcc noundef ptr @"??0Both@@QAE@XZ"(ptr {{[^,]*}} [[TMP]]) -// CHECK: call noundef i32 @"?receive_inalloca_both@@Y{{.*}}"(ptr inalloca(<{ %struct.NonTrivial, ptr }>) %argmem) +// CHECK: call noundef i32 @"?receive_inalloca_both@@Y{{.*}}"(ptr inalloca(<{ %struct.NonTrivial, ptr }>) align 4 %argmem) // Here we have a type that is: // - overaligned diff --git a/clang/test/CodeGenCXX/inalloca-stmtexpr.cpp b/clang/test/CodeGenCXX/inalloca-stmtexpr.cpp index 4ddd13d33d8a56..7c02bea90d5ccb 100644 --- a/clang/test/CodeGenCXX/inalloca-stmtexpr.cpp +++ b/clang/test/CodeGenCXX/inalloca-stmtexpr.cpp @@ -46,6 +46,6 @@ out:; // CHECK: call noundef zeroext i1 @"?cond@@YA_NXZ"() // CHECK: br i1 // CHECK: br label %out -// CHECK: call void @"?inalloca@@YAXUFoo@@0@Z"(ptr inalloca(<{ %struct.Foo, %struct.Foo }>) %{{.*}}) +// CHECK: call void @"?inalloca@@YAXUFoo@@0@Z"(ptr inalloca(<{ %struct.Foo, %struct.Foo }>) align 4 %{{.*}}) // CHECK: call void @llvm.stackrestore.p0(ptr %inalloca.save) // CHECK: out: diff --git a/clang/test/CodeGenCXX/inalloca-vector.cpp b/clang/test/CodeGenCXX/inalloca-vector.cpp index 0534fce9f1033a..02295b4a33b5f7 100644 --- a/clang/test/CodeGenCXX/inalloca-vector.cpp +++ b/clang/test/CodeGenCXX/inalloca-vector.cpp @@ -21,7 +21,7 @@ void receive_vec_128(NonTrivial nt, __m128 x, __m128 y, __m128 z, __m128 w, __m1 // CHECK-SAME: (<4 x float> inreg noundef %x, // CHECK-SAME: <4 x float> inreg noundef %y, // CHECK-SAME: <4 x float> inreg noundef %z, -// CHECK-SAME: ptr inalloca(<{ %struct.NonTrivial, ptr, ptr }>) %0) +// CHECK-SAME: ptr inalloca(<{ %struct.NonTrivial, ptr, ptr }>) align 4 %0) void pass_vec_128() { __m128 z = {0}; @@ -45,7 +45,7 @@ void pass_vec_128() { // CHECK-SAME: (<4 x float> inreg noundef %{{[^,]*}}, // CHECK-SAME: <4 x float> inreg noundef %{{[^,]*}}, // CHECK-SAME: <4 x float> inreg noundef %{{[^,]*}}, -// CHECK-SAME: ptr inalloca(<{ %struct.NonTrivial, ptr, ptr }>) %{{[^,]*}}) +// CHECK-SAME: ptr inalloca(<{ %struct.NonTrivial, ptr, ptr }>) align 4 %{{[^,]*}}) // w will be passed indirectly by register, and q will be passed indirectly, but // the pointer will be in memory. @@ -58,7 +58,7 @@ void __fastcall fastcall_receive_vec(__m128 x, __m128 y, __m128 z, __m128 w, int // CHECK-SAME: <4 x float> inreg noundef %z, // CHECK-SAME: ptr inreg nofreeobj noundef align 16 dead_on_return dereferenceable(16) %0, // CHECK-SAME: i32 inreg noundef %edx, -// CHECK-SAME: ptr inalloca(<{ ptr, %struct.NonTrivial }>) %1) +// CHECK-SAME: ptr inalloca(<{ ptr, %struct.NonTrivial }>) align 4 %1) void __vectorcall vectorcall_receive_vec(double xmm0, double xmm1, double xmm2, @@ -75,4 +75,4 @@ void __vectorcall vectorcall_receive_vec(double xmm0, double xmm1, double xmm2, // CHECK-SAME: <4 x float> inreg noundef %z, // CHECK-SAME: ptr inreg nofreeobj noundef align 16 dead_on_return dereferenceable(16) %0, // CHECK-SAME: i32 inreg noundef %edx, -// CHECK-SAME: ptr inalloca(<{ ptr, %struct.NonTrivial }>) %1) +// CHECK-SAME: ptr inalloca(<{ ptr, %struct.NonTrivial }>) align 4 %1) diff --git a/clang/test/CodeGenCXX/inheriting-constructor.cpp b/clang/test/CodeGenCXX/inheriting-constructor.cpp index 0834afa6b32d64..e97d2a484b11ce 100644 --- a/clang/test/CodeGenCXX/inheriting-constructor.cpp +++ b/clang/test/CodeGenCXX/inheriting-constructor.cpp @@ -152,7 +152,7 @@ namespace inalloca_nonvirt { // WIN32: store i32 2, ptr %[[ARG2]] // WIN32: %[[ARG4:.*]] = getelementptr {{.*}} %[[ARGMEM]] // WIN32: store ptr %[[TMP]], ptr %[[ARG4]] - // WIN32: call {{.*}} @"??0A@inalloca_nonvirt@@QAE@UQ@@H0$$QAU2@@Z"(ptr{{[^,]*}}, ptr inalloca(<{{.*}}>) %[[ARGMEM]]) + // WIN32: call {{.*}} @"??0A@inalloca_nonvirt@@QAE@UQ@@H0$$QAU2@@Z"(ptr{{[^,]*}}, ptr inalloca(<{{.*}}>) align 4 %[[ARGMEM]]) // WIN32: call void @llvm.stackrestore.p0( // WIN32: call {{.*}} @"??0Z@@QAE@XZ"( // WIN32: call {{.*}} @"??1Q@@QAE@XZ"( @@ -188,7 +188,7 @@ namespace inalloca_nonvirt { // WIN32: store i32 2, ptr %[[ARG2]] // WIN32: %[[ARG4:.*]] = getelementptr {{.*}} %[[ARGMEM]] // WIN32: store ptr %[[TMP]], ptr %[[ARG4]] - // WIN32: call {{.*}} @"??0A@inalloca_nonvirt@@QAE@UQ@@H0$$QAU2@@Z"(ptr{{[^,]*}}, ptr inalloca(<{{.*}}>) %[[ARGMEM]]) + // WIN32: call {{.*}} @"??0A@inalloca_nonvirt@@QAE@UQ@@H0$$QAU2@@Z"(ptr{{[^,]*}}, ptr inalloca(<{{.*}}>) align 4 %[[ARGMEM]]) // WIN32: call void @llvm.stackrestore.p0( // WIN32: call {{.*}} @"??0Z@@QAE@XZ"( // WIN32: call {{.*}} @"??1Q@@QAE@XZ"( @@ -234,7 +234,7 @@ namespace inalloca_virt { // WIN32: store i32 2, ptr %[[ARG2]] // WIN32: %[[ARG4:.*]] = getelementptr {{.*}} %[[ARGMEM]] // WIN32: store ptr %[[TMP]], ptr %[[ARG4]] - // WIN32: call {{.*}} @"??0A@inalloca_virt@@QAE@UQ@@H0$$QAU2@@Z"(ptr{{[^,]*}}, ptr inalloca(<{{.*}}>) %[[ARGMEM]]) + // WIN32: call {{.*}} @"??0A@inalloca_virt@@QAE@UQ@@H0$$QAU2@@Z"(ptr{{[^,]*}}, ptr inalloca(<{{.*}}>) align 4 %[[ARGMEM]]) // WIN32: call void @llvm.stackrestore.p0( // WIN32: br // @@ -284,7 +284,7 @@ namespace inalloca_virt { // WIN32: store i32 2, ptr %[[ARG2]] // WIN32: %[[ARG4:.*]] = getelementptr {{.*}} %[[ARGMEM]] // WIN32: store ptr %[[TMP]], ptr %[[ARG4]] - // WIN32: call {{.*}} @"??0A@inalloca_virt@@QAE@UQ@@H0$$QAU2@@Z"(ptr{{[^,]*}}, ptr inalloca(<{{.*}}>) %[[ARGMEM]]) + // WIN32: call {{.*}} @"??0A@inalloca_virt@@QAE@UQ@@H0$$QAU2@@Z"(ptr{{[^,]*}}, ptr inalloca(<{{.*}}>) align 4 %[[ARGMEM]]) // WIN32: call void @llvm.stackrestore.p0( // WIN32: br // diff --git a/clang/test/CodeGenCXX/microsoft-abi-arg-order.cpp b/clang/test/CodeGenCXX/microsoft-abi-arg-order.cpp index c879c483686e54..5093bf1b9592bc 100644 --- a/clang/test/CodeGenCXX/microsoft-abi-arg-order.cpp +++ b/clang/test/CodeGenCXX/microsoft-abi-arg-order.cpp @@ -14,7 +14,7 @@ void foo(A a, A b, A c) { // Order of destruction should be left to right. // // X86-LABEL: define dso_local void @"?foo@@YAXUA@@00@Z" -// X86: (ptr inalloca([[argmem_ty:<{ %struct.A, %struct.A, %struct.A }>]]) %0) +// X86: (ptr inalloca([[argmem_ty:<{ %struct.A, %struct.A, %struct.A }>]]) align 4 %0) // X86: %[[a:[^ ]*]] = getelementptr inbounds nuw [[argmem_ty]], ptr %0, i32 0, i32 0 // X86: %[[b:[^ ]*]] = getelementptr inbounds nuw [[argmem_ty]], ptr %0, i32 0, i32 1 // X86: %[[c:[^ ]*]] = getelementptr inbounds nuw [[argmem_ty]], ptr %0, i32 0, i32 2 @@ -47,7 +47,7 @@ void call_foo() { // X86: invoke x86_thiscallcc noundef ptr @"??0A@@QAE@H@Z"(ptr {{[^,]*}} %[[arg2]], i32 noundef 2) // X86: %[[arg1:[^ ]*]] = getelementptr inbounds nuw [[argmem_ty]], ptr %[[argmem]], i32 0, i32 0 // X86: invoke x86_thiscallcc noundef ptr @"??0A@@QAE@H@Z"(ptr {{[^,]*}} %[[arg1]], i32 noundef 1) -// X86: call void @"?foo@@YAXUA@@00@Z"(ptr inalloca([[argmem_ty]]) %[[argmem]]) +// X86: call void @"?foo@@YAXUA@@00@Z"(ptr inalloca([[argmem_ty]]) align 4 %[[argmem]]) // X86: call void @llvm.stackrestore.p0 // X86: ret void // diff --git a/clang/test/CodeGenCXX/microsoft-abi-byval-sret.cpp b/clang/test/CodeGenCXX/microsoft-abi-byval-sret.cpp index b9df1303c27073..33f240688001ba 100644 --- a/clang/test/CodeGenCXX/microsoft-abi-byval-sret.cpp +++ b/clang/test/CodeGenCXX/microsoft-abi-byval-sret.cpp @@ -19,7 +19,7 @@ A B::foo(A x) { } // CHECK-LABEL: define dso_local x86_thiscallcc ptr @"?foo@B@@QAE?AUA@@U2@@Z" -// CHECK: (ptr noundef %this, ptr inalloca(<{ ptr, %struct.A }>) %0) +// CHECK: (ptr noundef %this, ptr inalloca(<{ ptr, %struct.A }>) align 4 %0) // CHECK: getelementptr inbounds nuw <{ ptr, %struct.A }>, ptr %{{.*}}, i32 0, i32 0 // CHECK: load ptr, ptr // CHECK: ret ptr @@ -29,7 +29,7 @@ A B::bar(A x) { } // CHECK-LABEL: define dso_local ptr @"?bar@B@@QAA?AUA@@U2@@Z" -// CHECK: (ptr inalloca(<{ ptr, ptr, %struct.A }>) %0) +// CHECK: (ptr inalloca(<{ ptr, ptr, %struct.A }>) align 4 %0) // CHECK: getelementptr inbounds nuw <{ ptr, ptr, %struct.A }>, ptr %{{.*}}, i32 0, i32 1 // CHECK: load ptr, ptr // CHECK: ret ptr @@ -39,7 +39,7 @@ A B::baz(A x) { } // CHECK-LABEL: define dso_local x86_stdcallcc ptr @"?baz@B@@QAG?AUA@@U2@@Z" -// CHECK: (ptr inalloca(<{ ptr, ptr, %struct.A }>) %0) +// CHECK: (ptr inalloca(<{ ptr, ptr, %struct.A }>) align 4 %0) // CHECK: getelementptr inbounds nuw <{ ptr, ptr, %struct.A }>, ptr %{{.*}}, i32 0, i32 1 // CHECK: load ptr, ptr // CHECK: ret ptr @@ -49,7 +49,7 @@ A B::qux(A x) { } // CHECK-LABEL: define dso_local x86_fastcallcc void @"?qux@B@@QAI?AUA@@U2@@Z" -// CHECK: (ptr inreg noundef %this, ptr dead_on_unwind inreg noalias writable sret(%struct.A) align 4 %agg.result, ptr inalloca(<{ %struct.A }>) %0) +// CHECK: (ptr inreg noundef %this, ptr dead_on_unwind inreg noalias writable sret(%struct.A) align 4 %agg.result, ptr inalloca(<{ %struct.A }>) align 4 %0) // CHECK: ret void int main() { @@ -61,10 +61,10 @@ int main() { } // CHECK: call x86_thiscallcc ptr @"?foo@B@@QAE?AUA@@U2@@Z" -// CHECK: (ptr noundef %{{[^,]*}}, ptr inalloca(<{ ptr, %struct.A }>) %{{[^,]*}}) +// CHECK: (ptr noundef %{{[^,]*}}, ptr inalloca(<{ ptr, %struct.A }>) align 4 %{{[^,]*}}) // CHECK: call ptr @"?bar@B@@QAA?AUA@@U2@@Z" -// CHECK: (ptr inalloca(<{ ptr, ptr, %struct.A }>) %{{[^,]*}}) +// CHECK: (ptr inalloca(<{ ptr, ptr, %struct.A }>) align 4 %{{[^,]*}}) // CHECK: call x86_stdcallcc ptr @"?baz@B@@QAG?AUA@@U2@@Z" -// CHECK: (ptr inalloca(<{ ptr, ptr, %struct.A }>) %{{[^,]*}}) +// CHECK: (ptr inalloca(<{ ptr, ptr, %struct.A }>) align 4 %{{[^,]*}}) // CHECK: call x86_fastcallcc void @"?qux@B@@QAI?AUA@@U2@@Z" -// CHECK: (ptr inreg noundef %{{[^,]*}}, ptr dead_on_unwind inreg writable sret(%struct.A) align 4 %{{.*}}, ptr inalloca(<{ %struct.A }>) %{{[^,]*}}) +// CHECK: (ptr inreg noundef %{{[^,]*}}, ptr dead_on_unwind inreg writable sret(%struct.A) align 4 %{{.*}}, ptr inalloca(<{ %struct.A }>) align 4 %{{[^,]*}}) diff --git a/clang/test/CodeGenCXX/microsoft-abi-byval-thunks.cpp b/clang/test/CodeGenCXX/microsoft-abi-byval-thunks.cpp index 31acd5268c9db9..ee12ee9b3caf14 100644 --- a/clang/test/CodeGenCXX/microsoft-abi-byval-thunks.cpp +++ b/clang/test/CodeGenCXX/microsoft-abi-byval-thunks.cpp @@ -15,10 +15,10 @@ struct C : A, B { C(); virtual void foo(Agg x); }; C::C() {} // force emission // CHECK32-LABEL: define linkonce_odr dso_local x86_thiscallcc void @"?foo@C@byval_thunk@@W3AEXUAgg@2@@Z" -// CHECK32: (ptr noundef %this, ptr inalloca(<{ %"struct.byval_thunk::Agg" }>) %0) +// CHECK32: (ptr noundef %this, ptr inalloca(<{ %"struct.byval_thunk::Agg" }>) align 4 %0) // CHECK32: getelementptr i8, ptr %{{.*}}, i32 -4 // CHECK32: musttail call x86_thiscallcc void @"?foo@C@byval_thunk@@UAEXUAgg@2@@Z" -// CHECK32: (ptr noundef %{{.*}}, ptr inalloca(<{ %"struct.byval_thunk::Agg" }>) %0) +// CHECK32: (ptr noundef %{{.*}}, ptr inalloca(<{ %"struct.byval_thunk::Agg" }>) align 4 %0) // CHECK32-NEXT: ret void // CHECK64-LABEL: define linkonce_odr dso_local void @"?foo@C@byval_thunk@@W7EAAXUAgg@2@@Z" @@ -44,13 +44,13 @@ struct C : A, B { C(); virtual void __stdcall foo(Agg x); }; C::C() {} // force emission // CHECK32-LABEL: define linkonce_odr dso_local x86_stdcallcc void @"?foo@C@stdcall_thunk@@W3AGXUAgg@2@@Z" -// CHECK32: (ptr inalloca(<{ ptr, %"struct.stdcall_thunk::Agg" }>) %0) +// CHECK32: (ptr inalloca(<{ ptr, %"struct.stdcall_thunk::Agg" }>) align 4 %0) // CHECK32: %[[this_slot:[^ ]*]] = getelementptr inbounds nuw <{ ptr, %"struct.stdcall_thunk::Agg" }>, ptr %0, i32 0, i32 0 // CHECK32: load ptr, ptr %[[this_slot]] // CHECK32: getelementptr i8, ptr %{{.*}}, i32 -4 // CHECK32: store ptr %{{.*}}, ptr %[[this_slot]] // CHECK32: musttail call x86_stdcallcc void @"?foo@C@stdcall_thunk@@UAGXUAgg@2@@Z" -// CHECK32: (ptr inalloca(<{ ptr, %"struct.stdcall_thunk::Agg" }>) %0) +// CHECK32: (ptr inalloca(<{ ptr, %"struct.stdcall_thunk::Agg" }>) align 4 %0) // CHECK32-NEXT: ret void // CHECK64-LABEL: define linkonce_odr dso_local void @"?foo@C@stdcall_thunk@@W7EAAXUAgg@2@@Z" @@ -76,13 +76,13 @@ struct C : A, B { C(); virtual Agg __cdecl foo(Agg x); }; C::C() {} // force emission // CHECK32-LABEL: define linkonce_odr dso_local ptr @"?foo@C@sret_thunk@@W3AA?AUAgg@2@U32@@Z" -// CHECK32: (ptr inalloca(<{ ptr, ptr, %"struct.sret_thunk::Agg" }>) %0) +// CHECK32: (ptr inalloca(<{ ptr, ptr, %"struct.sret_thunk::Agg" }>) align 4 %0) // CHECK32: %[[this_slot:[^ ]*]] = getelementptr inbounds nuw <{ ptr, ptr, %"struct.sret_thunk::Agg" }>, ptr %0, i32 0, i32 0 // CHECK32: load ptr, ptr %[[this_slot]] // CHECK32: getelementptr i8, ptr %{{.*}}, i32 -4 // CHECK32: store ptr %{{.*}}, ptr %[[this_slot]] // CHECK32: %[[rv:[^ ]*]] = musttail call ptr @"?foo@C@sret_thunk@@UAA?AUAgg@2@U32@@Z" -// CHECK32: (ptr inalloca(<{ ptr, ptr, %"struct.sret_thunk::Agg" }>) %0) +// CHECK32: (ptr inalloca(<{ ptr, ptr, %"struct.sret_thunk::Agg" }>) align 4 %0) // CHECK32-NEXT: ret ptr %[[rv]] // CHECK64-LABEL: define linkonce_odr dso_local void @"?foo@C@sret_thunk@@W7EAA?AUAgg@2@U32@@Z" diff --git a/clang/test/CodeGenCXX/microsoft-abi-byval-vararg.cpp b/clang/test/CodeGenCXX/microsoft-abi-byval-vararg.cpp index 84cfc24acdd3b5..dfb82ca5223861 100644 --- a/clang/test/CodeGenCXX/microsoft-abi-byval-vararg.cpp +++ b/clang/test/CodeGenCXX/microsoft-abi-byval-vararg.cpp @@ -19,14 +19,14 @@ int foo(A a, ...) { return sum; } -// CHECK-LABEL: define dso_local noundef i32 @"?foo@@YAHUA@@ZZ"(ptr inalloca(<{ %struct.A }>) %0, ...) +// CHECK-LABEL: define dso_local noundef i32 @"?foo@@YAHUA@@ZZ"(ptr inalloca(<{ %struct.A }>) align 4 %0, ...) int main() { return foo(A(3), 1, 2, 3); } // CHECK-LABEL: define dso_local noundef i32 @main() // CHECK: %[[argmem:[^ ]*]] = alloca inalloca <{ %struct.A, i32, i32, i32 }> -// CHECK: call noundef i32 (ptr, ...) @"?foo@@YAHUA@@ZZ"{{.*}}(ptr inalloca(<{ %struct.A, i32, i32, i32 }>) %[[argmem]]) +// CHECK: call noundef i32 (ptr, ...) @"?foo@@YAHUA@@ZZ"{{.*}}(ptr inalloca(<{ %struct.A, i32, i32, i32 }>) align 4 %[[argmem]]) void varargs_zero(...); void varargs_one(int, ...); diff --git a/clang/test/CodeGenCXX/microsoft-abi-eh-cleanups.cpp b/clang/test/CodeGenCXX/microsoft-abi-eh-cleanups.cpp index 48c7b5f5c41a3d..a63b851b50724b 100644 --- a/clang/test/CodeGenCXX/microsoft-abi-eh-cleanups.cpp +++ b/clang/test/CodeGenCXX/microsoft-abi-eh-cleanups.cpp @@ -76,7 +76,7 @@ int HasDeactivatedCleanups() { // WIN32: invoke x86_thiscallcc noundef ptr @"??0A@@QAE@XZ" // WIN32: store i1 false, ptr %[[isactive]] // -// WIN32: invoke noundef i32 @"?TakesTwo@@YAHUA@@0@Z"(ptr inalloca([[argmem_ty]]) %[[argmem]]) +// WIN32: invoke noundef i32 @"?TakesTwo@@YAHUA@@0@Z"(ptr inalloca([[argmem_ty]]) align 4 %[[argmem]]) // Destroy the two const ref temporaries. // WIN32: call x86_thiscallcc void @"??1A@@QAE@XZ"({{.*}}) // WIN32: call x86_thiscallcc void @"??1A@@QAE@XZ"({{.*}}) diff --git a/clang/test/CodeGenCXX/microsoft-abi-sret-and-byval.cpp b/clang/test/CodeGenCXX/microsoft-abi-sret-and-byval.cpp index 27963969b0d89b..7dee258fffc6c2 100644 --- a/clang/test/CodeGenCXX/microsoft-abi-sret-and-byval.cpp +++ b/clang/test/CodeGenCXX/microsoft-abi-sret-and-byval.cpp @@ -79,7 +79,7 @@ struct SmallWithSmallWithPrivate { }; // WIN32: declare dso_local void @"{{.*take_bools_and_chars.*}}" -// WIN32: (ptr inalloca(<{ i8, [3 x i8], i8, [3 x i8], %struct.SmallWithDtor, i8, [3 x i8], i8, [3 x i8], i32, i8, [3 x i8] }>) +// WIN32: (ptr inalloca(<{ i8, [3 x i8], i8, [3 x i8], %struct.SmallWithDtor, i8, [3 x i8], i8, [3 x i8], i32, i8, [3 x i8] }>) align 4 void take_bools_and_chars(char a, char b, SmallWithDtor c, char d, bool e, int f, bool g); void call_bools_and_chars() { take_bools_and_chars('A', 'B', SmallWithDtor(), 'D', true, 13, false); @@ -179,7 +179,7 @@ void packed_arg(Packed s) {} // Test that dtors are invoked in the callee. void small_arg_with_dtor(SmallWithDtor s) {} -// WIN32: define dso_local void @"?small_arg_with_dtor@@YAXUSmallWithDtor@@@Z"(ptr inalloca(<{ %struct.SmallWithDtor }>) %0) {{.*}} { +// WIN32: define dso_local void @"?small_arg_with_dtor@@YAXUSmallWithDtor@@@Z"(ptr inalloca(<{ %struct.SmallWithDtor }>) align 4 %0) {{.*}} { // WIN32: call x86_thiscallcc void @"??1SmallWithDtor@@QAE@XZ" // WIN32: } // WIN64: define dso_local void @"?small_arg_with_dtor@@YAXUSmallWithDtor@@@Z"(i32 %s.coerce) {{.*}} { @@ -260,13 +260,13 @@ void eh_cleanup_arg_with_dtor() { void small_arg_with_vftable(SmallWithVftable s) {} // LINUX-LABEL: define{{.*}} void @_Z22small_arg_with_vftable16SmallWithVftable(ptr nofreeobj noundef align 4 dead_on_return dereferenceable(8) %s) -// WIN32: define dso_local void @"?small_arg_with_vftable@@YAXUSmallWithVftable@@@Z"(ptr inalloca(<{ %struct.SmallWithVftable }>) %0) +// WIN32: define dso_local void @"?small_arg_with_vftable@@YAXUSmallWithVftable@@@Z"(ptr inalloca(<{ %struct.SmallWithVftable }>) align 4 %0) // WIN64: define dso_local void @"?small_arg_with_vftable@@YAXUSmallWithVftable@@@Z"(ptr nofreeobj noundef align 8 dead_on_return dereferenceable(16) %s) // WOA64: define dso_local void @"?small_arg_with_vftable@@YAXUSmallWithVftable@@@Z"(ptr nofreeobj noundef align 8 dead_on_return dereferenceable(16) %s) void medium_arg_with_copy_ctor(MediumWithCopyCtor s) {} // LINUX-LABEL: define{{.*}} void @_Z25medium_arg_with_copy_ctor18MediumWithCopyCtor(ptr nofreeobj noundef align 4 dead_on_return dereferenceable(8) %s) -// WIN32: define dso_local void @"?medium_arg_with_copy_ctor@@YAXUMediumWithCopyCtor@@@Z"(ptr inalloca(<{ %struct.MediumWithCopyCtor }>) %0) +// WIN32: define dso_local void @"?medium_arg_with_copy_ctor@@YAXUMediumWithCopyCtor@@@Z"(ptr inalloca(<{ %struct.MediumWithCopyCtor }>) align 4 %0) // WIN64: define dso_local void @"?medium_arg_with_copy_ctor@@YAXUMediumWithCopyCtor@@@Z"(ptr nofreeobj noundef align 4 dead_on_return dereferenceable(8) %s) // WOA: define dso_local arm_aapcs_vfpcc void @"?medium_arg_with_copy_ctor@@YAXUMediumWithCopyCtor@@@Z"(ptr nofreeobj noundef align 4 dead_on_return dereferenceable(8) %s) // WOA64: define dso_local void @"?medium_arg_with_copy_ctor@@YAXUMediumWithCopyCtor@@@Z"(ptr nofreeobj noundef align 4 dead_on_return dereferenceable(8) %s) @@ -370,7 +370,7 @@ struct X { }; void g(X) { } -// WIN32: define dso_local void @"?g@@YAXUX@@@Z"(ptr inalloca(<{ %struct.X, [3 x i8] }>) %0) {{.*}} { +// WIN32: define dso_local void @"?g@@YAXUX@@@Z"(ptr inalloca(<{ %struct.X, [3 x i8] }>) align 4 %0) {{.*}} { // WIN32: call x86_thiscallcc void @"??1X@@QAE@XZ"(ptr {{.*}}) // WIN32: } void f() { @@ -405,7 +405,7 @@ void bar() { // WIN32: call void @llvm.memcpy // WIN32: getelementptr inbounds nuw [[argmem_ty]], ptr %[[argmem]], i32 0, i32 0 // WIN32: call x86_thiscallcc noundef ptr @"??0NonTrivial@test2@@QAE@XZ" -// WIN32: call noundef i32 @"?foo@test2@@YAHUNonTrivial@1@UPOD@1@@Z"(ptr inalloca([[argmem_ty]]) %argmem) +// WIN32: call noundef i32 @"?foo@test2@@YAHUNonTrivial@1@UPOD@1@@Z"(ptr inalloca([[argmem_ty]]) align 4 %argmem) // WIN32: ret void // WIN32: } @@ -421,7 +421,7 @@ struct NonTrivial { int a; }; void foo(NonTrivial a, bool b) { } -// WIN32-LABEL: define dso_local void @"?foo@test3@@YAXUNonTrivial@1@_N@Z"(ptr inalloca(<{ %"struct.test3::NonTrivial", i8, [3 x i8] }>) %0) +// WIN32-LABEL: define dso_local void @"?foo@test3@@YAXUNonTrivial@1@_N@Z"(ptr inalloca(<{ %"struct.test3::NonTrivial", i8, [3 x i8] }>) align 4 %0) } @@ -444,7 +444,7 @@ void fn2(FnPtr1 a, SmallWithDtor b) { fn1(a, b); }; // WIN32: %[[a2:[^ ]*]] = load ptr, ptr %[[a]], align 4 // WIN32: %[[gep2:[^ ]*]] = getelementptr inbounds nuw [[argmem_ty]], ptr %[[argmem]], i32 0, i32 0 // WIN32: store ptr %[[a2]], ptr %[[gep2]], align 4 -// WIN32: call void @"?fn1@@YAXP6AXUForwardDeclare1@@@ZUSmallWithDtor@@@Z"(ptr inalloca([[argmem_ty]]) %[[argmem]]) +// WIN32: call void @"?fn1@@YAXP6AXUForwardDeclare1@@@ZUSmallWithDtor@@@Z"(ptr inalloca([[argmem_ty]]) align 4 %[[argmem]]) namespace pr30293 { // Virtual methods living in a secondary vtable take ptr as their 'this' @@ -466,8 +466,8 @@ void C::g() { return h(SmallWithDtor()); } // WIN32-LABEL: define dso_local x86_thiscallcc void @"?g@C@pr30293@@QAEXXZ"(ptr {{[^,]*}} %this) // WIN32: call x86_thiscallcc noundef ptr @"??0SmallWithDtor@@QAE@XZ" -// WIN32: call void @"?h@C@pr30293@@UAAXUSmallWithDtor@@@Z"(ptr inalloca(<{ ptr, %struct.SmallWithDtor }>) %{{[^,)]*}}) -// WIN32: declare dso_local void @"?h@C@pr30293@@UAAXUSmallWithDtor@@@Z"(ptr inalloca(<{ ptr, %struct.SmallWithDtor }>)) +// WIN32: call void @"?h@C@pr30293@@UAAXUSmallWithDtor@@@Z"(ptr inalloca(<{ ptr, %struct.SmallWithDtor }>) align 4 %{{[^,)]*}}) +// WIN32: declare dso_local void @"?h@C@pr30293@@UAAXUSmallWithDtor@@@Z"(ptr inalloca(<{ ptr, %struct.SmallWithDtor }>) align 4) // WIN64-LABEL: define dso_local void @"?g@C@pr30293@@QEAAXXZ"(ptr {{[^,]*}} %this) // WIN64: declare dso_local void @"?h@C@pr30293@@UEAAXUSmallWithDtor@@@Z"(ptr noundef, i32) diff --git a/clang/test/CodeGenCXX/microsoft-abi-vmemptr-conflicts.cpp b/clang/test/CodeGenCXX/microsoft-abi-vmemptr-conflicts.cpp index 615a2e34d7a2b4..6a47c7a8eedc1c 100644 --- a/clang/test/CodeGenCXX/microsoft-abi-vmemptr-conflicts.cpp +++ b/clang/test/CodeGenCXX/microsoft-abi-vmemptr-conflicts.cpp @@ -94,7 +94,7 @@ void f(C *c) { // CHECK-LABEL: define dso_local void @"?f@cdecl_inalloca@@YAXPAUC@1@@Z"(ptr noundef %c) // CHECK: call void @"??_9C@cdecl_inalloca@@$BA@AA"(ptr {{[^,]*}} %{{.*}}) -// CHECK: call void @"??_9C@cdecl_inalloca@@$BA@AA"(ptr inalloca(<{ ptr, %"struct.cdecl_inalloca::Big" }>) %{{.*}}) +// CHECK: call void @"??_9C@cdecl_inalloca@@$BA@AA"(ptr inalloca(<{ ptr, %"struct.cdecl_inalloca::Big" }>) align 4 %{{.*}}) // CHECK-LABEL: define linkonce_odr void @"??_9C@cdecl_inalloca@@$BA@AA"(ptr noundef %this, ...) {{.*}} comdat // CHECK: musttail call void (ptr, ...) %{{.*}}(ptr noundef %{{.*}}, ...) diff --git a/clang/test/CodeGenCXX/microsoft-abi-vtables-multiple-nonvirtual-inheritance-this-adjustment.cpp b/clang/test/CodeGenCXX/microsoft-abi-vtables-multiple-nonvirtual-inheritance-this-adjustment.cpp index d18dfa45e5edd7..b198aabf85f021 100644 --- a/clang/test/CodeGenCXX/microsoft-abi-vtables-multiple-nonvirtual-inheritance-this-adjustment.cpp +++ b/clang/test/CodeGenCXX/microsoft-abi-vtables-multiple-nonvirtual-inheritance-this-adjustment.cpp @@ -187,7 +187,7 @@ void C::g(NonTrivial o) { whatsthis = this; } -// BITCODE-LABEL: define dso_local void @"?g@C@pr30293@@UAAXUNonTrivial@2@@Z"(ptr inalloca(<{ ptr, %"struct.pr30293::NonTrivial" }>) %0) +// BITCODE-LABEL: define dso_local void @"?g@C@pr30293@@UAAXUNonTrivial@2@@Z"(ptr inalloca(<{ ptr, %"struct.pr30293::NonTrivial" }>) align 4 %0) // BITCODE: %[[thisaddr:[^ ]*]] = getelementptr inbounds nuw <{ ptr, %"struct.pr30293::NonTrivial" }>, ptr {{.*}}, i32 0, i32 0 // BITCODE: %[[this1:[^ ]*]] = load ptr, ptr %[[thisaddr]], align 4 // BITCODE: %[[this3:[^ ]*]] = getelementptr inbounds i8, ptr %[[this1]], i32 -4 diff --git a/clang/test/CodeGenCXX/ms-thunks-ehspec.cpp b/clang/test/CodeGenCXX/ms-thunks-ehspec.cpp index c988e24e94cc5f..3fbbc42a88fc11 100644 --- a/clang/test/CodeGenCXX/ms-thunks-ehspec.cpp +++ b/clang/test/CodeGenCXX/ms-thunks-ehspec.cpp @@ -20,8 +20,8 @@ class C : A, B { }; C c; -// CHECK-LABEL: define linkonce_odr dso_local x86_thiscallcc void @"?f@C@@G3AEXUNonTrivial@@@Z"(ptr noundef %this, ptr inalloca(<{ %struct.NonTrivial }>) %0) +// CHECK-LABEL: define linkonce_odr dso_local x86_thiscallcc void @"?f@C@@G3AEXUNonTrivial@@@Z"(ptr noundef %this, ptr inalloca(<{ %struct.NonTrivial }>) align 4 %0) // CHECK-NOT: invoke -// CHECK: musttail call x86_thiscallcc void @"?f@C@@EAEXUNonTrivial@@@Z"(ptr noundef %{{.*}}, ptr inalloca(<{ %struct.NonTrivial }>) %0) +// CHECK: musttail call x86_thiscallcc void @"?f@C@@EAEXUNonTrivial@@@Z"(ptr noundef %{{.*}}, ptr inalloca(<{ %struct.NonTrivial }>) align 4 %0) // CHECK-NEXT: ret void diff --git a/clang/test/CodeGenCXX/regcall.cpp b/clang/test/CodeGenCXX/regcall.cpp index 413e675af1508c..11f504e39fb0db 100644 --- a/clang/test/CodeGenCXX/regcall.cpp +++ b/clang/test/CodeGenCXX/regcall.cpp @@ -31,7 +31,7 @@ void __regcall f1(Dyn a) { a.x = 42; } // CHECK-LIN64: define dso_local x86_regcallcc void @_Z14__regcall3__f13Dyn(ptr noundef byval(%struct.Dyn) align 8 %a) // CHECK-LIN32: define dso_local x86_regcallcc void @_Z14__regcall3__f13Dyn(ptr inreg nofreeobj noundef align 4 dead_on_return dereferenceable(16) %a) // CHECK-WIN64: define dso_local x86_regcallcc void @"?f1@@YwXUDyn@@@Z"(ptr nofreeobj noundef align 8 dead_on_return dereferenceable(24) %a) -// CHECK-WIN32: define dso_local x86_regcallcc void @"?f1@@YwXUDyn@@@Z"(ptr inalloca(<{ %struct.Dyn }>) %0) +// CHECK-WIN32: define dso_local x86_regcallcc void @"?f1@@YwXUDyn@@@Z"(ptr inalloca(<{ %struct.Dyn }>) align 4 %0) struct Base { int x; }; struct Derived : public Base { double a; }; diff --git a/clang/test/CodeGenCXX/regcall4.cpp b/clang/test/CodeGenCXX/regcall4.cpp index 3abbdc9178145d..6e08bc89859d9d 100644 --- a/clang/test/CodeGenCXX/regcall4.cpp +++ b/clang/test/CodeGenCXX/regcall4.cpp @@ -31,7 +31,7 @@ void __regcall f1(Dyn a) { a.x = 42; } // CHECK-LIN64: define dso_local x86_regcallcc void @_Z14__regcall4__f13Dyn(ptr noundef byval(%struct.Dyn) align 8 %a) // CHECK-LIN32: define dso_local x86_regcallcc void @_Z14__regcall4__f13Dyn(ptr inreg nofreeobj noundef align 4 dead_on_return dereferenceable(16) %a) // CHECK-WIN64: define dso_local x86_regcallcc void @"?f1@@YxXUDyn@@@Z"(ptr nofreeobj noundef align 8 dead_on_return dereferenceable(24) %a) -// CHECK-WIN32: define dso_local x86_regcallcc void @"?f1@@YxXUDyn@@@Z"(ptr inalloca(<{ %struct.Dyn }>) %0) +// CHECK-WIN32: define dso_local x86_regcallcc void @"?f1@@YxXUDyn@@@Z"(ptr inalloca(<{ %struct.Dyn }>) align 4 %0) struct Base { int x; }; struct Derived : public Base { double a; }; diff --git a/clang/test/CodeGenCXX/vararg-non-pod-ms-compat.cpp b/clang/test/CodeGenCXX/vararg-non-pod-ms-compat.cpp index 23109d5667ee2e..203f37c8ad3fe3 100644 --- a/clang/test/CodeGenCXX/vararg-non-pod-ms-compat.cpp +++ b/clang/test/CodeGenCXX/vararg-non-pod-ms-compat.cpp @@ -13,7 +13,7 @@ void test(X x) { // CHECK-LABEL: define dso_local void @"?test@@YAXUX@@@Z" // X86: %[[argmem:[^ ]*]] = alloca inalloca <{ %struct.X }> - // X86: call void (ptr, ...) @"?vararg@@YAXZZ"(ptr inalloca(<{ %struct.X }>) %[[argmem]]) + // X86: call void (ptr, ...) @"?vararg@@YAXZZ"(ptr inalloca(<{ %struct.X }>) align 4 %[[argmem]]) // X64: alloca %struct.X diff --git a/clang/test/CodeGenObjCXX/arc-indirect.mm b/clang/test/CodeGenObjCXX/arc-indirect.mm index b5fcf92f22231b..ff72dc7502d80e 100644 --- a/clang/test/CodeGenObjCXX/arc-indirect.mm +++ b/clang/test/CodeGenObjCXX/arc-indirect.mm @@ -15,8 +15,8 @@ - (void)object:(id)obj struct:(S)s { } @end -// CHECK-GNUSTEP: define internal void @_i_C__object_struct_(ptr inalloca(<{ ptr, ptr, ptr, %struct.S, [3 x i8] }>) %0) -// CHECK-DARWIN: define internal void @"\01-[C object:struct:]"(ptr inalloca(<{ ptr, ptr, ptr, %struct.S, [3 x i8] }>) %0) +// CHECK-GNUSTEP: define internal void @_i_C__object_struct_(ptr inalloca(<{ ptr, ptr, ptr, %struct.S, [3 x i8] }>) align 4 %0) +// CHECK-DARWIN: define internal void @"\01-[C object:struct:]"(ptr inalloca(<{ ptr, ptr, ptr, %struct.S, [3 x i8] }>) align 4 %0) // CHECK: %obj = getelementptr inbounds nuw <{ ptr, ptr, ptr, %struct.S, [3 x i8] }>, ptr %0, i32 0, i32 2 // CHECK: %[[INSTANCE:[0-9]+]] = load ptr, ptr %obj, align 4 // CHECK: call void @llvm.objc.storeStrong(ptr %obj, ptr %[[INSTANCE]]) diff --git a/clang/test/CodeGenObjCXX/microsoft-abi-arc-param-order.mm b/clang/test/CodeGenObjCXX/microsoft-abi-arc-param-order.mm index 37fe30544c59c6..90804cd2dc0848 100644 --- a/clang/test/CodeGenObjCXX/microsoft-abi-arc-param-order.mm +++ b/clang/test/CodeGenObjCXX/microsoft-abi-arc-param-order.mm @@ -10,7 +10,7 @@ // Verify that we destruct things from left to right in the MS C++ ABI: a, b, c, d. // // CHECK-LABEL: define dso_local void @"?test_arc_order@@YAXUA@@PAUobjc_object@@01@Z" -// CHECK: (ptr inalloca(<{ %struct.A, ptr, %struct.A, ptr }>) %0) +// CHECK: (ptr inalloca(<{ %struct.A, ptr, %struct.A, ptr }>) align 4 %0) void test_arc_order(A a, id __attribute__((ns_consumed)) b , A c, id __attribute__((ns_consumed)) d) { // CHECK: call x86_thiscallcc void @"??1A@@QAE@XZ"(ptr {{[^,]*}} %{{.*}}) // CHECK: call void @llvm.objc.storeStrong(ptr %{{.*}}, ptr null) _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
