https://github.com/adams381 updated https://github.com/llvm/llvm-project/pull/220673
>From d202f7dda1e1a25f47060bd5c0286e1b48fd597b Mon Sep 17 00:00:00 2001 From: Adam Smith <[email protected]> Date: Wed, 2 Sep 2026 10:43:24 -0700 Subject: [PATCH] [CIR] Stop marking byval arguments noalias We were putting llvm.noalias on every byval argument. Classic adds it only under -fpass-by-value-is-noalias, which defaults off, and that option isn't plumbed into CIR at all, so the right thing is to not emit it. llvm.noundef stays, since classic does emit that. Most of the test churn is collapsing LLVM-CIR / LLVM-OGCG prefix pairs that existed only to record the divergence. Assisted-by: Cursor / claude-opus-5 --- .../TargetLowering/CIRABIRewriteContext.cpp | 31 ++++----- clang/test/CIR/CodeGen/arg-attrs.cpp | 17 ++--- .../call-conv-lowering-x86_64-abi-compat.c | 17 ++--- .../CodeGen/call-conv-lowering-x86_64-avx.c | 32 +++++----- .../call-conv-lowering-x86_64-byref.cpp | 4 +- .../call-conv-lowering-x86_64-empty.cpp | 14 ++-- .../call-conv-lowering-x86_64-indirect.c | 12 ++-- .../call-conv-lowering-x86_64-packed.c | 36 ++++------- .../call-conv-lowering-x86_64-padded.c | 16 ++--- .../call-conv-lowering-x86_64-variadic.c | 24 +++---- ...conv-lowering-x86_64-zero-width-bitfield.c | 5 +- .../CIR/CodeGen/call-conv-lowering-x86_64.c | 39 ++++------- clang/test/CIR/CodeGen/call.c | 5 +- clang/test/CIR/CodeGen/complex-libcall-abi.c | 5 +- .../byval-sret-arg-attr-lowering.cir | 4 +- .../abi-lowering/indirect-byval.cir | 64 ++++++------------- .../indirect-call-test-target.cir | 4 +- .../Transforms/abi-lowering/indirect-call.cir | 2 +- .../Transforms/abi-lowering/x86_64-bitint.cir | 8 +-- .../abi-lowering/x86_64-complex.cir | 2 +- .../abi-lowering/x86_64-empty-class.cir | 4 +- .../abi-lowering/x86_64-struct-indirect.cir | 4 +- .../abi-lowering/x86_64-struct-padded.cir | 2 +- .../Transforms/abi-lowering/x86_64-union.cir | 20 +++--- .../abi-lowering/x86_64-variadic-call.cir | 20 +++--- .../Transforms/abi-lowering/x86_64-vector.cir | 2 +- .../Transforms/abi-lowering/x86_64-vptr.cir | 4 +- .../abi-lowering/x86_64-wide-floats.cir | 2 +- 28 files changed, 161 insertions(+), 238 deletions(-) diff --git a/clang/lib/CIR/Dialect/Transforms/TargetLowering/CIRABIRewriteContext.cpp b/clang/lib/CIR/Dialect/Transforms/TargetLowering/CIRABIRewriteContext.cpp index 8cf332bbbefa3..918f3f17b9933 100644 --- a/clang/lib/CIR/Dialect/Transforms/TargetLowering/CIRABIRewriteContext.cpp +++ b/clang/lib/CIR/Dialect/Transforms/TargetLowering/CIRABIRewriteContext.cpp @@ -29,13 +29,10 @@ using namespace mlir::abi; // non-trivial copy constructor, move constructor, or destructor, so the ABI // passes it through a pointer instead of in registers. // -// For byval (ArgClassification::byVal == true) the callee gets -// llvm.byval + llvm.noalias + llvm.noundef; for byref (byVal == false) -// the callee gets llvm.byref without the ownership attrs. At the call site -// byval copies into a fresh alloca while byref forwards the caller's storage. -// At the callee, byval loads the incoming pointer (a local copy), while -// byref rewires the CIRGen param-slot alloca to the incoming pointer so -// the body mutates the caller's storage in place. +// At the call site byval copies into a fresh alloca while byref forwards +// the caller's storage. At the callee, byval loads the incoming pointer +// (a local copy), while byref rewires the CIRGen param-slot alloca to the +// incoming pointer so the body mutates the caller's storage in place. // // For Expand, the single struct argument is replaced by N scalar arguments // (one per field). At the callee, the N field block arguments are stored @@ -223,15 +220,12 @@ mlir::ArrayAttr updateArgAttrs(mlir::MLIRContext *ctx, // type T (the pre-rewrite arg type); T is recorded explicitly because // it cannot be recovered from the opaque LLVM pointer after lowering. // - // For byval, two additional attributes match classic CodeGen: - // llvm.noundef -- the copy is always fully defined (the caller's - // original must be defined or UB has already occurred, and the - // copy inherits that property). - // llvm.noalias -- the copy is a fresh caller-allocated alloca that - // no other pointer in the function can alias. Classic CodeGen - // emits this when -fpass-by-value-is-noalias is set; here we - // emit it unconditionally because the byval call-site rewrite - // always produces a fresh alloca+store. + // byval also gets llvm.noundef: the caller's original must be defined + // or UB has already occurred, and the copy inherits that. + // + // byval does not get llvm.noalias. Classic adds it only under + // -fpass-by-value-is-noalias for a record that can pass in registers, + // and that option is not plumbed into CIR. mlir::Type pointeeTy = origArgTypes[oldIdx]; StringRef ownershipAttr = ac.byVal ? mlir::LLVM::LLVMDialect::getByValAttrName() @@ -240,12 +234,9 @@ mlir::ArrayAttr updateArgAttrs(mlir::MLIRContext *ctx, attrs.set(mlir::LLVM::LLVMDialect::getAlignAttrName(), builder.getI64IntegerAttr(ac.indirectAlign.value())); attrs.set(ownershipAttr, mlir::TypeAttr::get(pointeeTy)); - if (ac.byVal) { - attrs.set(mlir::LLVM::LLVMDialect::getNoAliasAttrName(), - builder.getUnitAttr()); + if (ac.byVal) attrs.set(mlir::LLVM::LLVMDialect::getNoUndefAttrName(), builder.getUnitAttr()); - } newArgAttrs.push_back(attrs.getDictionary(ctx)); } else { newArgAttrs.push_back(existing); diff --git a/clang/test/CIR/CodeGen/arg-attrs.cpp b/clang/test/CIR/CodeGen/arg-attrs.cpp index 5a6987a4c3484..8960de7345baf 100644 --- a/clang/test/CIR/CodeGen/arg-attrs.cpp +++ b/clang/test/CIR/CodeGen/arg-attrs.cpp @@ -1,9 +1,9 @@ // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir -emit-cir %s -o %t.cir // RUN: FileCheck --input-file=%t.cir %s -check-prefix=CIR -// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir -emit-llvm %s -o %t.ll -// RUN: FileCheck --input-file=%t.ll %s -check-prefix=BOTH,LLVM +// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir -emit-llvm %s -o %t-cir.ll +// RUN: FileCheck --input-file=%t-cir.ll %s -check-prefix=BOTH // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm %s -o %t.ll -// RUN: FileCheck --input-file=%t.ll %s -check-prefix=BOTH,OGCG +// RUN: FileCheck --input-file=%t.ll %s -check-prefix=BOTH struct Incomplete; struct Struct { @@ -18,10 +18,8 @@ void Struct::this_func(){} // CIR: cir.func {{.*}}@_ZN6Struct9this_funcEv(%{{.*}}: !cir.ptr<!rec_Struct> {llvm.align = 4 : i64, llvm.dereferenceable = 20 : i64, llvm.nonnull, llvm.noundef} {{.*}}) {{.*}} { // BOTH: define {{.*}}void @_ZN6Struct9this_funcEv(ptr noundef nonnull align 4 dereferenceable(20) %{{.*}}) void Struct::arg_attr(Struct s, int &i, Incomplete &j){} - // CIR: cir.func {{.*}}@_ZN6Struct8arg_attrES_RiR10Incomplete(%{{[^,)]+}}: !cir.ptr<!rec_Struct> {llvm.align = 4 : i64, llvm.dereferenceable = 20 : i64, llvm.nonnull, llvm.noundef} {{.*}}, %{{[^,)]+}}: !cir.ptr<!rec_Struct> {llvm.align = 8 : i64, llvm.byval = !rec_Struct, llvm.noalias, llvm.noundef} {{.*}}, %{{[^,)]+}}: !cir.ptr<!s32i> {llvm.align = 4 : i64, llvm.dereferenceable = 4 : i64, llvm.nonnull, llvm.noundef} {{.*}}, %arg3: !cir.ptr<!rec_Incomplete> {llvm.align = 1 : i64, llvm.nonnull, llvm.noundef} {{.*}}) {{.*}} { - // TODO(cir): CIR adds noalias to a byval argument where classic does not. - // LLVM: define {{.*}}void @_ZN6Struct8arg_attrES_RiR10Incomplete(ptr noundef nonnull align 4 dereferenceable(20) %{{[^,)]+}}, ptr noalias noundef byval(%struct.Struct) align 8 %{{[^,)]+}}, ptr noundef nonnull align 4 dereferenceable(4) %{{[^,)]+}}, ptr noundef nonnull align 1 %{{[^,)]+}}) - // OGCG: define {{.*}}void @_ZN6Struct8arg_attrES_RiR10Incomplete(ptr noundef nonnull align 4 dereferenceable(20) %{{.*}}, ptr noundef byval(%struct.Struct) align 8 %{{.*}}, ptr noundef nonnull align 4 dereferenceable(4) %{{.*}}, ptr noundef nonnull align 1 %{{.*}}) + // CIR: cir.func {{.*}}@_ZN6Struct8arg_attrES_RiR10Incomplete(%{{[^,)]+}}: !cir.ptr<!rec_Struct> {llvm.align = 4 : i64, llvm.dereferenceable = 20 : i64, llvm.nonnull, llvm.noundef} {{.*}}, %{{[^,)]+}}: !cir.ptr<!rec_Struct> {llvm.align = 8 : i64, llvm.byval = !rec_Struct, llvm.noundef} {{.*}}, %{{[^,)]+}}: !cir.ptr<!s32i> {llvm.align = 4 : i64, llvm.dereferenceable = 4 : i64, llvm.nonnull, llvm.noundef} {{.*}}, %arg3: !cir.ptr<!rec_Incomplete> {llvm.align = 1 : i64, llvm.nonnull, llvm.noundef} {{.*}}) {{.*}} { + // BOTH: define {{.*}}void @_ZN6Struct8arg_attrES_RiR10Incomplete(ptr noundef nonnull align 4 dereferenceable(20) %{{[^,)]+}}, ptr noundef byval(%struct.Struct) align 8 %{{[^,)]+}}, ptr noundef nonnull align 4 dereferenceable(4) %{{[^,)]+}}, ptr noundef nonnull align 1 %{{[^,)]+}}) struct __attribute__((aligned(32))) Aligned32 { int x; @@ -52,8 +50,7 @@ void caller(Struct s, int i, Incomplete &inc) { // CIR: cir.call @_ZN6Struct9this_funcEv(%{{.*}}) : (!cir.ptr<!rec_Struct> {llvm.align = 4 : i64, llvm.dereferenceable = 20 : i64, llvm.nonnull, llvm.noundef}) // BOTH: call void @_ZN6Struct9this_funcEv(ptr noundef nonnull align 4 dereferenceable(20) %{{.*}}) s.arg_attr(s, i, inc); - // CIR: cir.call @_ZN6Struct8arg_attrES_RiR10Incomplete(%{{.*}}, %{{.*}}, %{{.*}}, %{{.*}}) : (!cir.ptr<!rec_Struct> {llvm.align = 4 : i64, llvm.dereferenceable = 20 : i64, llvm.nonnull, llvm.noundef}, !cir.ptr<!rec_Struct> {llvm.align = 8 : i64, llvm.byval = !rec_Struct, llvm.noalias, llvm.noundef}, !cir.ptr<!s32i> {llvm.align = 4 : i64, llvm.dereferenceable = 4 : i64, llvm.nonnull, llvm.noundef}, !cir.ptr<!rec_Incomplete> {llvm.align = 1 : i64, llvm.nonnull, llvm.noundef}) - // LLVM: call void @_ZN6Struct8arg_attrES_RiR10Incomplete(ptr noundef nonnull align 4 dereferenceable(20) %{{.*}}, ptr noalias noundef byval(%struct.Struct) align 8 %{{.*}}, ptr noundef nonnull align 4 dereferenceable(4) %{{.*}}, ptr noundef nonnull align 1 %{{.*}}) - // OGCG: call void @_ZN6Struct8arg_attrES_RiR10Incomplete(ptr noundef nonnull align 4 dereferenceable(20) %{{.*}}, ptr noundef byval(%struct.Struct) align 8 %{{.*}}, ptr noundef nonnull align 4 dereferenceable(4) %{{.*}}, ptr noundef nonnull align 1 %{{.*}}) + // CIR: cir.call @_ZN6Struct8arg_attrES_RiR10Incomplete(%{{.*}}, %{{.*}}, %{{.*}}, %{{.*}}) : (!cir.ptr<!rec_Struct> {llvm.align = 4 : i64, llvm.dereferenceable = 20 : i64, llvm.nonnull, llvm.noundef}, !cir.ptr<!rec_Struct> {llvm.align = 8 : i64, llvm.byval = !rec_Struct, llvm.noundef}, !cir.ptr<!s32i> {llvm.align = 4 : i64, llvm.dereferenceable = 4 : i64, llvm.nonnull, llvm.noundef}, !cir.ptr<!rec_Incomplete> {llvm.align = 1 : i64, llvm.nonnull, llvm.noundef}) + // BOTH: call void @_ZN6Struct8arg_attrES_RiR10Incomplete(ptr noundef nonnull align 4 dereferenceable(20) %{{.*}}, ptr noundef byval(%struct.Struct) align 8 %{{.*}}, ptr noundef nonnull align 4 dereferenceable(4) %{{.*}}, ptr noundef nonnull align 1 %{{.*}}) } diff --git a/clang/test/CIR/CodeGen/call-conv-lowering-x86_64-abi-compat.c b/clang/test/CIR/CodeGen/call-conv-lowering-x86_64-abi-compat.c index 8eb03df7fa5f9..60c60daf5e7c8 100644 --- a/clang/test/CIR/CodeGen/call-conv-lowering-x86_64-abi-compat.c +++ b/clang/test/CIR/CodeGen/call-conv-lowering-x86_64-abi-compat.c @@ -1,7 +1,7 @@ // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -target-feature +avx -fclangir -emit-llvm %s -o %t-cir.ll -// RUN: FileCheck --check-prefixes=LINUX,LINUX-CIR --input-file=%t-cir.ll %s +// RUN: FileCheck --check-prefix=LINUX --input-file=%t-cir.ll %s // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -target-feature +avx -emit-llvm %s -o %t.ll -// RUN: FileCheck --check-prefixes=LINUX,LINUX-OGCG --input-file=%t.ll %s +// RUN: FileCheck --check-prefix=LINUX --input-file=%t.ll %s // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -target-feature +avx -fclang-abi-compat=3.8 -fclangir -emit-llvm %s -o %t-38-cir.ll // RUN: FileCheck --check-prefix=LINUX38 --input-file=%t-38-cir.ll %s @@ -14,9 +14,9 @@ // RUN: FileCheck --check-prefix=LINUX9 --input-file=%t-9.ll %s // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -target-feature +avx -fclang-abi-compat=11 -fclangir -emit-llvm %s -o %t-11-cir.ll -// RUN: FileCheck --check-prefixes=LINUX11-CIR --input-file=%t-11-cir.ll %s +// RUN: FileCheck --check-prefix=LINUX11 --input-file=%t-11-cir.ll %s // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -target-feature +avx -fclang-abi-compat=11 -emit-llvm %s -o %t-11.ll -// RUN: FileCheck --check-prefixes=LINUX11-OGCG --input-file=%t-11.ll %s +// RUN: FileCheck --check-prefix=LINUX11 --input-file=%t-11.ll %s // RUN: %clang_cc1 -triple x86_64-apple-darwin -target-feature +avx -fclangir -emit-llvm %s -o %t-darwin-cir.ll // RUN: FileCheck --check-prefix=DARWIN --input-file=%t-darwin-cir.ll %s @@ -34,8 +34,7 @@ typedef float v8f __attribute__((vector_size(32))); typedef union { long double l; int i; } ULongDouble; void rev98(ULongDouble u) { (void)u; } -// LINUX-CIR: define dso_local void @rev98(ptr noalias noundef byval(%union.ULongDouble) align 16 %{{[^,)]+}}) -// LINUX-OGCG: define dso_local void @rev98(ptr noundef byval(%union.ULongDouble) align 16 %{{[^,)]+}}) +// LINUX: define dso_local void @rev98(ptr noundef byval(%union.ULongDouble) align 16 %{{[^,)]+}}) // DARWIN: define void @rev98(i64 %{{[^,)]+}}, double %{{[^,)]+}}) // GCC classifies a 64-bit vector of a 64-bit integer as SSE. Clang 3.8 and @@ -52,8 +51,7 @@ void mmx(v1ll v) { (void)v; } // would otherwise reach a register, which is what makes the rule observable. void wide_int128(v2i128 v) { (void)v; } -// LINUX-CIR: define dso_local void @wide_int128(ptr noalias noundef byval(<2 x i128>) align 32 %{{[^,)]+}}) -// LINUX-OGCG: define dso_local void @wide_int128(ptr noundef byval(<2 x i128>) align 32 %{{[^,)]+}}) +// LINUX: define dso_local void @wide_int128(ptr noundef byval(<2 x i128>) align 32 %{{[^,)]+}}) // LINUX38: define dso_local void @wide_int128(<2 x i128> noundef %{{[^,)]+}}) // LINUX9: define dso_local void @wide_int128(<2 x i128> noundef %{{[^,)]+}}) // DARWIN: define void @wide_int128(<2 x i128> noundef %{{[^,)]+}}) @@ -66,5 +64,4 @@ union UnionWideVector { v8f v; float f; }; void take_union_wide_vector(union UnionWideVector u) { (void)u; } // LINUX: define dso_local void @take_union_wide_vector(<4 x double> %{{[^,)]+}}) -// LINUX11-CIR: define dso_local void @take_union_wide_vector(ptr noalias noundef byval(%union.UnionWideVector) align 32 %{{[^,)]+}}) -// LINUX11-OGCG: define dso_local void @take_union_wide_vector(ptr noundef byval(%union.UnionWideVector) align 32 %{{[^,)]+}}) +// LINUX11: define dso_local void @take_union_wide_vector(ptr noundef byval(%union.UnionWideVector) align 32 %{{[^,)]+}}) diff --git a/clang/test/CIR/CodeGen/call-conv-lowering-x86_64-avx.c b/clang/test/CIR/CodeGen/call-conv-lowering-x86_64-avx.c index d632744e9c647..7b0fb4d4cb5b1 100644 --- a/clang/test/CIR/CodeGen/call-conv-lowering-x86_64-avx.c +++ b/clang/test/CIR/CodeGen/call-conv-lowering-x86_64-avx.c @@ -44,7 +44,7 @@ void take_v256(v8f v) { (void)v; } // CIR-SSE: cir.func {{.*}}@take_v256(%arg0: !cir.ptr<!cir.vector<8 x !cir.float>> {{.*}}llvm.align = 32 : i64{{.*}}llvm.byval = !cir.vector<8 x !cir.float>{{.*}}) // CIR-AVX: cir.func {{.*}}@take_v256(%arg0: !cir.vector<8 x !cir.float>{{.*}}) -// LLVM-CIR-SSE: define dso_local void @take_v256(ptr noalias noundef byval(<8 x float>) align 32 %{{[^,)]+}}) +// LLVM-CIR-SSE: define dso_local void @take_v256(ptr noundef byval(<8 x float>) align 32 %{{[^,)]+}}) // LLVM-OGCG-SSE: define dso_local void @take_v256(ptr noundef byval(<8 x float>) align 32 %{{[^,)]+}}) // LLVM-AVX: define dso_local void @take_v256(<8 x float> noundef %{{[^,)]+}}) // LLVM-AVX512: define dso_local void @take_v256(<8 x float> noundef %{{[^,)]+}}) @@ -59,8 +59,8 @@ v8f ret_v256(void) { v8f z = {0}; return z; } // vector argument needs on a non-variadic call. void call_v256(v8f v) { take_v256(v); } -// LLVM-CIR-SSE: define dso_local void @call_v256(ptr noalias noundef byval(<8 x float>) align 32 %{{[^,)]+}}) -// LLVM-CIR-SSE: call void @take_v256(ptr noalias noundef byval(<8 x float>) align 32 %{{[^,)]+}}) +// LLVM-CIR-SSE: define dso_local void @call_v256(ptr noundef byval(<8 x float>) align 32 %{{[^,)]+}}) +// LLVM-CIR-SSE: call void @take_v256(ptr noundef byval(<8 x float>) align 32 %{{[^,)]+}}) // LLVM-OGCG-SSE: define dso_local void @call_v256(ptr noundef byval(<8 x float>) align 32 %{{[^,)]+}}) // LLVM-OGCG-SSE: call void @take_v256(ptr noundef byval(<8 x float>) align 32 %{{[^,)]+}}) // LLVM-AVX: define dso_local void @call_v256(<8 x float> noundef %{{[^,)]+}}) @@ -73,9 +73,9 @@ void take_v512(v16f v) { (void)v; } // CIR-SSE: cir.func {{.*}}@take_v512(%arg0: !cir.ptr<!cir.vector<16 x !cir.float>> {{.*}}llvm.align = 64 : i64{{.*}}llvm.byval = !cir.vector<16 x !cir.float>{{.*}}) // CIR-AVX: cir.func {{.*}}@take_v512(%arg0: !cir.ptr<!cir.vector<16 x !cir.float>> {{.*}}llvm.align = 64 : i64{{.*}}llvm.byval = !cir.vector<16 x !cir.float>{{.*}}) -// LLVM-CIR-SSE: define dso_local void @take_v512(ptr noalias noundef byval(<16 x float>) align 64 %{{[^,)]+}}) +// LLVM-CIR-SSE: define dso_local void @take_v512(ptr noundef byval(<16 x float>) align 64 %{{[^,)]+}}) // LLVM-OGCG-SSE: define dso_local void @take_v512(ptr noundef byval(<16 x float>) align 64 %{{[^,)]+}}) -// LLVM-CIR-AVX: define dso_local void @take_v512(ptr noalias noundef byval(<16 x float>) align 64 %{{[^,)]+}}) +// LLVM-CIR-AVX: define dso_local void @take_v512(ptr noundef byval(<16 x float>) align 64 %{{[^,)]+}}) // LLVM-OGCG-AVX: define dso_local void @take_v512(ptr noundef byval(<16 x float>) align 64 %{{[^,)]+}}) // LLVM-AVX512: define dso_local void @take_v512(<16 x float> noundef %{{[^,)]+}}) @@ -84,9 +84,9 @@ void take_v512(v16f v) { (void)v; } // module's, so this is byval only where the module itself lacks AVX512. __attribute__((target("no-avx512f"))) void take_v512_no_avx512(v16f v) { (void)v; } -// LLVM-CIR-SSE: define dso_local void @take_v512_no_avx512(ptr noalias noundef byval(<16 x float>) align 64 %{{[^,)]+}}) +// LLVM-CIR-SSE: define dso_local void @take_v512_no_avx512(ptr noundef byval(<16 x float>) align 64 %{{[^,)]+}}) // LLVM-OGCG-SSE: define dso_local void @take_v512_no_avx512(ptr noundef byval(<16 x float>) align 64 %{{[^,)]+}}) -// LLVM-CIR-AVX: define dso_local void @take_v512_no_avx512(ptr noalias noundef byval(<16 x float>) align 64 %{{[^,)]+}}) +// LLVM-CIR-AVX: define dso_local void @take_v512_no_avx512(ptr noundef byval(<16 x float>) align 64 %{{[^,)]+}}) // LLVM-OGCG-AVX: define dso_local void @take_v512_no_avx512(ptr noundef byval(<16 x float>) align 64 %{{[^,)]+}}) // LLVM-AVX512: define dso_local void @take_v512_no_avx512(<16 x float> noundef %{{[^,)]+}}) @@ -98,14 +98,14 @@ __attribute__((target("avx"))) void take_v256_tgt(v8f v) { (void)v; } // CIR: cir.func {{.*}}@take_v256_tgt(%arg0: !cir.vector<8 x !cir.float>{{.*}}) // LLVM: define dso_local void @take_v256_tgt(<8 x float> noundef %{{[^,)]+}}) -// LLVM-CIR-PINNED: define dso_local void @take_v256_tgt(ptr noalias noundef byval(<8 x float>) align 32 %{{[^,)]+}}) +// LLVM-CIR-PINNED: define dso_local void @take_v256_tgt(ptr noundef byval(<8 x float>) align 32 %{{[^,)]+}}) // LLVM-OGCG-PINNED: define dso_local void @take_v256_tgt(ptr noundef byval(<8 x float>) align 32 %{{[^,)]+}}) __attribute__((target("avx512f"))) void take_v512_tgt(v16f v) { (void)v; } // CIR: cir.func {{.*}}@take_v512_tgt(%arg0: !cir.vector<16 x !cir.float>{{.*}}) // LLVM: define dso_local void @take_v512_tgt(<16 x float> noundef %{{[^,)]+}}) -// LLVM-CIR-PINNED: define dso_local void @take_v512_tgt(ptr noalias noundef byval(<16 x float>) align 64 %{{[^,)]+}}) +// LLVM-CIR-PINNED: define dso_local void @take_v512_tgt(ptr noundef byval(<16 x float>) align 64 %{{[^,)]+}}) // LLVM-OGCG-PINNED: define dso_local void @take_v512_tgt(ptr noundef byval(<16 x float>) align 64 %{{[^,)]+}}) // A call site has to agree with the callee it resolves to. Both sides carry @@ -116,8 +116,8 @@ __attribute__((target("avx"))) void call_v256_tgt(v8f v) { take_v256_tgt(v); } // LLVM: define dso_local void @call_v256_tgt(<8 x float> noundef %{{[^,)]+}}) // LLVM: call void @take_v256_tgt(<8 x float> noundef %{{[^,)]+}}) -// LLVM-CIR-PINNED: define dso_local void @call_v256_tgt(ptr noalias noundef byval(<8 x float>) align 32 %{{[^,)]+}}) -// LLVM-CIR-PINNED: call void @take_v256_tgt(ptr noalias noundef byval(<8 x float>) align 32 %{{[^,)]+}}) +// LLVM-CIR-PINNED: define dso_local void @call_v256_tgt(ptr noundef byval(<8 x float>) align 32 %{{[^,)]+}}) +// LLVM-CIR-PINNED: call void @take_v256_tgt(ptr noundef byval(<8 x float>) align 32 %{{[^,)]+}}) // LLVM-OGCG-PINNED: define dso_local void @call_v256_tgt(ptr noundef byval(<8 x float>) align 32 %{{[^,)]+}}) // LLVM-OGCG-PINNED: call void @take_v256_tgt(ptr noundef byval(<8 x float>) align 32 %{{[^,)]+}}) @@ -129,13 +129,13 @@ __attribute__((target("avx"))) void call_indirect(v8f_fn p, v8f v) { p(v); } // LLVM: define dso_local void @call_indirect(ptr noundef %{{[^,)]+}}, <8 x float> noundef %{{[^,)]+}}) // LLVM: call void %{{[0-9]+}}(<8 x float> noundef %{{[^,)]+}}) -// LLVM-CIR-PINNED: define dso_local void @call_indirect(ptr noundef %{{[^,)]+}}, ptr noalias noundef byval(<8 x float>) align 32 %{{[^,)]+}}) +// LLVM-CIR-PINNED: define dso_local void @call_indirect(ptr noundef %{{[^,)]+}}, ptr noundef byval(<8 x float>) align 32 %{{[^,)]+}}) // LLVM-OGCG-PINNED: define dso_local void @call_indirect(ptr noundef %{{[^,)]+}}, ptr noundef byval(<8 x float>) align 32 %{{[^,)]+}}) void call_indirect_plain(v8f_fn p, v8f v) { p(v); } -// LLVM-CIR-SSE: define dso_local void @call_indirect_plain(ptr noundef %{{[^,)]+}}, ptr noalias noundef byval(<8 x float>) align 32 %{{[^,)]+}}) -// LLVM-CIR-SSE: call void %{{[0-9]+}}(ptr noalias noundef byval(<8 x float>) align 32 %{{[^,)]+}}) +// LLVM-CIR-SSE: define dso_local void @call_indirect_plain(ptr noundef %{{[^,)]+}}, ptr noundef byval(<8 x float>) align 32 %{{[^,)]+}}) +// LLVM-CIR-SSE: call void %{{[0-9]+}}(ptr noundef byval(<8 x float>) align 32 %{{[^,)]+}}) // LLVM-OGCG-SSE: define dso_local void @call_indirect_plain(ptr noundef %{{[^,)]+}}, ptr noundef byval(<8 x float>) align 32 %{{[^,)]+}}) // LLVM-AVX: define dso_local void @call_indirect_plain(ptr noundef %{{[^,)]+}}, <8 x float> noundef %{{[^,)]+}}) // LLVM-AVX: call void %{{[0-9]+}}(<8 x float> noundef %{{[^,)]+}}) @@ -151,7 +151,7 @@ void pass_swv(StructWideVector s) { variadic("x", s); } // LLVM-AVX: define dso_local void @named_swv(<8 x float> %{{[^,)]+}}) // LLVM-AVX: define dso_local void @pass_swv(<8 x float> %{{[^,)]+}}) -// LLVM-CIR-AVX: call i32 (ptr, ...) @variadic(ptr noundef @.str, ptr noalias noundef byval(%struct.StructWideVector) align 32 %{{[^,)]+}}) +// LLVM-CIR-AVX: call i32 (ptr, ...) @variadic(ptr noundef @.str, ptr noundef byval(%struct.StructWideVector) align 32 %{{[^,)]+}}) // LLVM-OGCG-AVX: call i32 (ptr, ...) @variadic(ptr noundef @.str, ptr noundef byval(%struct.StructWideVector) align 32 %{{[^,)]+}}) // A union whose widest member is a 256-bit vector is classified from that @@ -159,7 +159,7 @@ void pass_swv(StructWideVector s) { variadic("x", s); } union UnionWideVector { v8f v; float f; }; void take_union_wide_vector(union UnionWideVector u) { (void)u; } -// LLVM-CIR-SSE: define dso_local void @take_union_wide_vector(ptr noalias noundef byval(%union.UnionWideVector) align 32 %{{[^,)]+}}) +// LLVM-CIR-SSE: define dso_local void @take_union_wide_vector(ptr noundef byval(%union.UnionWideVector) align 32 %{{[^,)]+}}) // LLVM-OGCG-SSE: define dso_local void @take_union_wide_vector(ptr noundef byval(%union.UnionWideVector) align 32 %{{[^,)]+}}) // LLVM-AVX: define dso_local void @take_union_wide_vector(<4 x double> %{{[^,)]+}}) // LLVM-AVX512: define dso_local void @take_union_wide_vector(<4 x double> %{{[^,)]+}}) diff --git a/clang/test/CIR/CodeGen/call-conv-lowering-x86_64-byref.cpp b/clang/test/CIR/CodeGen/call-conv-lowering-x86_64-byref.cpp index d3e59e6f7f7e8..26bbcafcff6d0 100644 --- a/clang/test/CIR/CodeGen/call-conv-lowering-x86_64-byref.cpp +++ b/clang/test/CIR/CodeGen/call-conv-lowering-x86_64-byref.cpp @@ -107,11 +107,11 @@ void callByval() { // CIR: %[[V:.*]] = cir.load align(8) %[[TMP]] : !cir.ptr<!rec_Big>, !rec_Big // CIR: %[[SLOT:.*]] = cir.alloca "byval" align(8) : !cir.ptr<!rec_Big> // CIR: cir.store %[[V]], %[[SLOT]] : !rec_Big, !cir.ptr<!rec_Big> -// CIR: cir.call @_Z9takeByval3Big(%[[SLOT]]) : (!cir.ptr<!rec_Big> {llvm.align = 8 : i64, llvm.byval = !rec_Big, llvm.noalias, llvm.noundef}) -> () +// CIR: cir.call @_Z9takeByval3Big(%[[SLOT]]) : (!cir.ptr<!rec_Big> {llvm.align = 8 : i64, llvm.byval = !rec_Big, llvm.noundef}) -> () // LLVM-LABEL: define dso_local void @_Z9callByvalv() // LLVM: call void @llvm.memcpy.p0.p0.i64(ptr align 8 %[[TMP:[^,]+]], ptr align 8 %{{[^,]+}}, i64 32, i1 false) // LLVM-CIR: %[[V:.*]] = load %struct.Big, ptr %[[TMP]], align 8 // LLVM-CIR: store %struct.Big %[[V]], ptr %[[SLOT:.*]], align 8 -// LLVM-CIR: call void @_Z9takeByval3Big(ptr noalias noundef byval(%struct.Big) align 8 %[[SLOT]]) +// LLVM-CIR: call void @_Z9takeByval3Big(ptr noundef byval(%struct.Big) align 8 %[[SLOT]]) // OGCG: call void @_Z9takeByval3Big(ptr noundef byval(%struct.Big) align 8 %[[TMP]]) diff --git a/clang/test/CIR/CodeGen/call-conv-lowering-x86_64-empty.cpp b/clang/test/CIR/CodeGen/call-conv-lowering-x86_64-empty.cpp index 30999935ef9d0..a2aa9c58bf0ad 100644 --- a/clang/test/CIR/CodeGen/call-conv-lowering-x86_64-empty.cpp +++ b/clang/test/CIR/CodeGen/call-conv-lowering-x86_64-empty.cpp @@ -3,9 +3,9 @@ // RUN: FileCheck --check-prefix=CIR --input-file=%t.cir %s // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -std=c++17 -fclangir \ // RUN: -fclangir-call-conv-lowering -emit-llvm %s -o %t-cir.ll -// RUN: FileCheck --check-prefixes=LLVM,LLVM-CIR --input-file=%t-cir.ll %s +// RUN: FileCheck --check-prefix=LLVM --input-file=%t-cir.ll %s // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -std=c++17 -emit-llvm %s -o %t.ll -// RUN: FileCheck --check-prefixes=LLVM,LLVM-OGCG --input-file=%t.ll %s +// RUN: FileCheck --check-prefix=LLVM --input-file=%t.ll %s struct Empty {}; struct EmptyMem { Empty e; }; @@ -149,9 +149,8 @@ float takeFloatEmptyFirst(FloatEmptyFirst v) { return v.a; } // this size is passed indirectly at its declared alignment. int takeBig32(Big32 v, int k) { return k; } -// CIR: cir.func {{.*}}@_Z9takeBig325Big32i(%arg0: !cir.ptr<!rec_Big32> {llvm.align = 32 : i64, llvm.byval = !rec_Big32, llvm.noalias, llvm.noundef}{{.*}}, %arg1: !s32i {{.*}}) -> (!s32i -// LLVM-CIR: define dso_local noundef i32 @_Z9takeBig325Big32i(ptr noalias noundef byval(%struct.Big32) align 32 %{{[^,]+}}, i32 noundef %{{[^,]+}}) -// LLVM-OGCG: define dso_local noundef i32 @_Z9takeBig325Big32i(ptr noundef byval(%struct.Big32) align 32 %{{[^,]+}}, i32 noundef %{{[^,]+}}) +// CIR: cir.func {{.*}}@_Z9takeBig325Big32i(%arg0: !cir.ptr<!rec_Big32> {llvm.align = 32 : i64, llvm.byval = !rec_Big32, llvm.noundef}{{.*}}, %arg1: !s32i {{.*}}) -> (!s32i +// LLVM: define dso_local noundef i32 @_Z9takeBig325Big32i(ptr noundef byval(%struct.Big32) align 32 %{{[^,]+}}, i32 noundef %{{[^,]+}}) // The same class returned uses sret at that alignment. Big32 retBig32() { return Big32{}; } @@ -217,9 +216,8 @@ int takeUEmptyBytes(UEmptyBytes v) { return v.c[0]; } // member changes nothing here. int takeUBigEmpty(UBigEmpty v, int k) { return k; } -// CIR: cir.func {{.*}}@_Z13takeUBigEmpty9UBigEmptyi(%arg0: !cir.ptr<!rec_UBigEmpty> {llvm.align = 32 : i64, llvm.byval = !rec_UBigEmpty, llvm.noalias, llvm.noundef}{{.*}}, %arg1: !s32i {{.*}}) -> (!s32i -// LLVM-CIR: define dso_local noundef i32 @_Z13takeUBigEmpty9UBigEmptyi(ptr noalias noundef byval(%union.UBigEmpty) align 32 %{{[^,]+}}, i32 noundef %{{[^,]+}}) -// LLVM-OGCG: define dso_local noundef i32 @_Z13takeUBigEmpty9UBigEmptyi(ptr noundef byval(%union.UBigEmpty) align 32 %{{[^,]+}}, i32 noundef %{{[^,]+}}) +// CIR: cir.func {{.*}}@_Z13takeUBigEmpty9UBigEmptyi(%arg0: !cir.ptr<!rec_UBigEmpty> {llvm.align = 32 : i64, llvm.byval = !rec_UBigEmpty, llvm.noundef}{{.*}}, %arg1: !s32i {{.*}}) -> (!s32i +// LLVM: define dso_local noundef i32 @_Z13takeUBigEmpty9UBigEmptyi(ptr noundef byval(%union.UBigEmpty) align 32 %{{[^,]+}}, i32 noundef %{{[^,]+}}) // The same union returned uses sret at that alignment. UBigEmpty retUBigEmpty() { return UBigEmpty{}; } diff --git a/clang/test/CIR/CodeGen/call-conv-lowering-x86_64-indirect.c b/clang/test/CIR/CodeGen/call-conv-lowering-x86_64-indirect.c index d9225423a7bea..922b1325491a8 100644 --- a/clang/test/CIR/CodeGen/call-conv-lowering-x86_64-indirect.c +++ b/clang/test/CIR/CodeGen/call-conv-lowering-x86_64-indirect.c @@ -1,9 +1,9 @@ // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir -fclangir-call-conv-lowering -emit-cir %s -o %t.cir // RUN: FileCheck --check-prefix=CIR --input-file=%t.cir %s // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir -fclangir-call-conv-lowering -emit-llvm %s -o %t-cir.ll -// RUN: FileCheck --check-prefixes=LLVM,LLVM-CIR --input-file=%t-cir.ll %s +// RUN: FileCheck --check-prefix=LLVM --input-file=%t-cir.ll %s // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm %s -o %t.ll -// RUN: FileCheck --check-prefixes=LLVM,LLVM-OGCG --input-file=%t.ll %s +// RUN: FileCheck --check-prefix=LLVM --input-file=%t.ll %s typedef struct { long a, b, c, d; } Big; typedef struct { int a, b; } Pair; @@ -32,11 +32,9 @@ long call_byval(long (*fp)(Big), Big b) { return fp(b); } // CIR: cir.func {{.*}}@call_byval(%arg0: !cir.ptr<!cir.func<(!rec_Big) -> !s64i>> {{.*}}, %arg1: !cir.ptr<!rec_Big> {{.*}}llvm.byval = !rec_Big{{.*}}) -> !s64i // CIR: %[[CAST:.*]] = cir.cast bitcast %{{.+}} : !cir.ptr<!cir.func<(!rec_Big) -> !s64i>> -> !cir.ptr<!cir.func<(!cir.ptr<!rec_Big>) -> !s64i>> -// CIR: %{{.+}} = cir.call %[[CAST]](%{{.+}}) : (!cir.ptr<!cir.func<(!cir.ptr<!rec_Big>) -> !s64i>>, !cir.ptr<!rec_Big> {llvm.align = 8 : i64, llvm.byval = !rec_Big, llvm.noalias, llvm.noundef}) -> !s64i -// LLVM-CIR: define dso_local i64 @call_byval(ptr noundef %{{.+}}, ptr noalias noundef byval(%struct.Big) align 8 %{{.+}}) -// LLVM-OGCG: define dso_local i64 @call_byval(ptr noundef %{{.+}}, ptr noundef byval(%struct.Big) align 8 %{{.+}}) -// LLVM-CIR: call i64 %{{.+}}(ptr noalias noundef byval(%struct.Big) align 8 %{{.+}}) -// LLVM-OGCG: call i64 %{{.+}}(ptr noundef byval(%struct.Big) align 8 %{{.+}}) +// CIR: %{{.+}} = cir.call %[[CAST]](%{{.+}}) : (!cir.ptr<!cir.func<(!cir.ptr<!rec_Big>) -> !s64i>>, !cir.ptr<!rec_Big> {llvm.align = 8 : i64, llvm.byval = !rec_Big, llvm.noundef}) -> !s64i +// LLVM: define dso_local i64 @call_byval(ptr noundef %{{.+}}, ptr noundef byval(%struct.Big) align 8 %{{.+}}) +// LLVM: call i64 %{{.+}}(ptr noundef byval(%struct.Big) align 8 %{{.+}}) // Indirect call returning a large struct: an sret pointer slot is prepended // and the callee is bitcast to the void-returning sret signature. diff --git a/clang/test/CIR/CodeGen/call-conv-lowering-x86_64-packed.c b/clang/test/CIR/CodeGen/call-conv-lowering-x86_64-packed.c index 540e02d1db7f5..c34913f3a9539 100644 --- a/clang/test/CIR/CodeGen/call-conv-lowering-x86_64-packed.c +++ b/clang/test/CIR/CodeGen/call-conv-lowering-x86_64-packed.c @@ -1,9 +1,9 @@ // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir -emit-cir %s -o %t.cir // RUN: FileCheck --check-prefix=CIR --input-file=%t.cir %s // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir -emit-llvm %s -o %t-cir.ll -// RUN: FileCheck --check-prefixes=LLVM,LLVM-CIR --input-file=%t-cir.ll %s +// RUN: FileCheck --check-prefix=LLVM --input-file=%t-cir.ll %s // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm %s -o %t.ll -// RUN: FileCheck --check-prefixes=LLVM,LLVM-OGCG --input-file=%t.ll %s +// RUN: FileCheck --check-prefix=LLVM --input-file=%t.ll %s typedef struct __attribute__((packed)) { char c; int i; } CharInt; typedef struct __attribute__((packed)) { char c; int i : 32; } CharIntBF; @@ -59,12 +59,9 @@ typedef struct { char c; int i; } PragmaPacked; int take_char_int(CharInt v) { return v.i; } CharInt ret_char_int(int x) { CharInt v = {0, x}; return v; } -// CIR: cir.func{{.*}} @take_char_int(%arg0: !cir.ptr<!rec_CharInt> {llvm.align = 8 : i64, llvm.byval = !rec_CharInt, llvm.noalias, llvm.noundef}{{.*}}) -> !s32i +// CIR: cir.func{{.*}} @take_char_int(%arg0: !cir.ptr<!rec_CharInt> {llvm.align = 8 : i64, llvm.byval = !rec_CharInt, llvm.noundef}{{.*}}) -> !s32i // CIR: cir.func{{.*}} @ret_char_int(%arg0: !cir.ptr<!rec_CharInt> {llvm.align = 1 : i64, llvm.dead_on_unwind, llvm.noalias, llvm.sret = !rec_CharInt, llvm.writable}{{.*}}, %arg1: !s32i {llvm.noundef}{{.*}}) -// CIR emits noalias on a byval argument where classic does not, here and -// wherever else this file splits a byval line by backend. -// LLVM-CIR: define dso_local i32 @take_char_int(ptr noalias noundef byval(%struct.CharInt) align 8 %{{.+}}) -// LLVM-OGCG: define dso_local i32 @take_char_int(ptr noundef byval(%struct.CharInt) align 8 %{{.+}}) +// LLVM: define dso_local i32 @take_char_int(ptr noundef byval(%struct.CharInt) align 8 %{{.+}}) // LLVM: define dso_local void @ret_char_int(ptr dead_on_unwind noalias writable sret(%struct.CharInt) align 1 %{{.+}}, i32 noundef %{{.+}}) // The same record with the int declared as a bit-field. A bit-field may sit @@ -165,17 +162,15 @@ TwoFloatChar ret_two_float_char(float x) { TwoFloatChar v = {x, x, 0}; return v; // two eightbytes that decides. int take_seventeen(Seventeen v) { return v.a[3]; } -// CIR: cir.func{{.*}} @take_seventeen(%arg0: !cir.ptr<!rec_Seventeen> {llvm.align = 8 : i64, llvm.byval = !rec_Seventeen, llvm.noalias, llvm.noundef}{{.*}}) -> !s32i -// LLVM-CIR: define dso_local i32 @take_seventeen(ptr noalias noundef byval(%struct.Seventeen) align 8 %{{.+}}) -// LLVM-OGCG: define dso_local i32 @take_seventeen(ptr noundef byval(%struct.Seventeen) align 8 %{{.+}}) +// CIR: cir.func{{.*}} @take_seventeen(%arg0: !cir.ptr<!rec_Seventeen> {llvm.align = 8 : i64, llvm.byval = !rec_Seventeen, llvm.noundef}{{.*}}) -> !s32i +// LLVM: define dso_local i32 @take_seventeen(ptr noundef byval(%struct.Seventeen) align 8 %{{.+}}) // Packed and over-aligned at once, so the record carries a pad member and the // packed mark together. The misaligned int still decides it. int take_packed_ov(PackedOv v) { return v.i; } -// CIR: cir.func{{.*}} @take_packed_ov(%arg0: !cir.ptr<!rec_PackedOv> {llvm.align = 8 : i64, llvm.byval = !rec_PackedOv, llvm.noalias, llvm.noundef}{{.*}}) -> !s32i -// LLVM-CIR: define dso_local i32 @take_packed_ov(ptr noalias noundef byval(%struct.PackedOv) align 8 %{{.+}}) -// LLVM-OGCG: define dso_local i32 @take_packed_ov(ptr noundef byval(%struct.PackedOv) align 8 %{{.+}}) +// CIR: cir.func{{.*}} @take_packed_ov(%arg0: !cir.ptr<!rec_PackedOv> {llvm.align = 8 : i64, llvm.byval = !rec_PackedOv, llvm.noundef}{{.*}}) -> !s32i +// LLVM: define dso_local i32 @take_packed_ov(ptr noundef byval(%struct.PackedOv) align 8 %{{.+}}) // A packed member reaches the classifier through an enclosing record and // through an array element, neither of which is packed itself. The member @@ -185,14 +180,12 @@ int take_arr_packed(ArrPacked v) { return v.a[1].i; } int take_nest_nine(NestNine v) { return v.n.b; } int take_arr_nine(ArrNine v) { return v.n[0].b; } -// CIR: cir.func{{.*}} @take_nest_packed(%arg0: !cir.ptr<!rec_NestPacked> {llvm.align = 8 : i64, llvm.byval = !rec_NestPacked, llvm.noalias, llvm.noundef}{{.*}}) -> !s32i -// CIR: cir.func{{.*}} @take_arr_packed(%arg0: !cir.ptr<!rec_ArrPacked> {llvm.align = 8 : i64, llvm.byval = !rec_ArrPacked, llvm.noalias, llvm.noundef}{{.*}}) -> !s32i +// CIR: cir.func{{.*}} @take_nest_packed(%arg0: !cir.ptr<!rec_NestPacked> {llvm.align = 8 : i64, llvm.byval = !rec_NestPacked, llvm.noundef}{{.*}}) -> !s32i +// CIR: cir.func{{.*}} @take_arr_packed(%arg0: !cir.ptr<!rec_ArrPacked> {llvm.align = 8 : i64, llvm.byval = !rec_ArrPacked, llvm.noundef}{{.*}}) -> !s32i // CIR: cir.func{{.*}} @take_nest_nine(%arg0: !u64i{{.*}}, %arg1: !s8i{{.*}}) -> !s32i // CIR: cir.func{{.*}} @take_arr_nine(%arg0: !u64i{{.*}}, %arg1: !s8i{{.*}}) -> !s32i -// LLVM-CIR: define dso_local i32 @take_nest_packed(ptr noalias noundef byval(%struct.NestPacked) align 8 %{{.+}}) -// LLVM-OGCG: define dso_local i32 @take_nest_packed(ptr noundef byval(%struct.NestPacked) align 8 %{{.+}}) -// LLVM-CIR: define dso_local i32 @take_arr_packed(ptr noalias noundef byval(%struct.ArrPacked) align 8 %{{.+}}) -// LLVM-OGCG: define dso_local i32 @take_arr_packed(ptr noundef byval(%struct.ArrPacked) align 8 %{{.+}}) +// LLVM: define dso_local i32 @take_nest_packed(ptr noundef byval(%struct.NestPacked) align 8 %{{.+}}) +// LLVM: define dso_local i32 @take_arr_packed(ptr noundef byval(%struct.ArrPacked) align 8 %{{.+}}) // LLVM: define dso_local i32 @take_nest_nine(i64 %{{.+}}, i8 %{{.+}}) // LLVM: define dso_local i32 @take_arr_nine(i64 %{{.+}}, i8 %{{.+}}) @@ -206,6 +199,5 @@ int take_upacked(UPacked v) { return v.i; } // #pragma pack reaches the same layout as the attribute. int take_pragma_packed(PragmaPacked v) { return v.i; } -// CIR: cir.func{{.*}} @take_pragma_packed(%arg0: !cir.ptr<!rec_PragmaPacked> {llvm.align = 8 : i64, llvm.byval = !rec_PragmaPacked, llvm.noalias, llvm.noundef}{{.*}}) -> !s32i -// LLVM-CIR: define dso_local i32 @take_pragma_packed(ptr noalias noundef byval(%struct.PragmaPacked) align 8 %{{.+}}) -// LLVM-OGCG: define dso_local i32 @take_pragma_packed(ptr noundef byval(%struct.PragmaPacked) align 8 %{{.+}}) +// CIR: cir.func{{.*}} @take_pragma_packed(%arg0: !cir.ptr<!rec_PragmaPacked> {llvm.align = 8 : i64, llvm.byval = !rec_PragmaPacked, llvm.noundef}{{.*}}) -> !s32i +// LLVM: define dso_local i32 @take_pragma_packed(ptr noundef byval(%struct.PragmaPacked) align 8 %{{.+}}) diff --git a/clang/test/CIR/CodeGen/call-conv-lowering-x86_64-padded.c b/clang/test/CIR/CodeGen/call-conv-lowering-x86_64-padded.c index 414343cbaf544..65f50b41c4d5b 100644 --- a/clang/test/CIR/CodeGen/call-conv-lowering-x86_64-padded.c +++ b/clang/test/CIR/CodeGen/call-conv-lowering-x86_64-padded.c @@ -1,9 +1,9 @@ // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir -emit-cir %s -o %t.cir // RUN: FileCheck --check-prefix=CIR --input-file=%t.cir %s // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir -emit-llvm %s -o %t-cir.ll -// RUN: FileCheck --check-prefixes=LLVM,LLVM-CIR --input-file=%t-cir.ll %s +// RUN: FileCheck --check-prefix=LLVM --input-file=%t-cir.ll %s // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm %s -o %t.ll -// RUN: FileCheck --check-prefixes=LLVM,LLVM-OGCG --input-file=%t.ll %s +// RUN: FileCheck --check-prefix=LLVM --input-file=%t.ll %s typedef struct { int x; } __attribute__((aligned(8))) HalfPad; typedef struct { int x; } __attribute__((aligned(16))) OvInt; @@ -93,12 +93,9 @@ TwoFloat ret_twof(float v) { TwoFloat t = {v, v}; return t; } int take_big(BigPad b) { return b.b; } BigPad ret_big(int v) { BigPad b = {0, v}; return b; } -// CIR: cir.func{{.*}} @take_big(%arg0: !cir.ptr<!rec_BigPad> {llvm.align = 16 : i64, llvm.byval = !rec_BigPad, llvm.noalias, llvm.noundef} loc{{.*}}) -> !s32i +// CIR: cir.func{{.*}} @take_big(%arg0: !cir.ptr<!rec_BigPad> {llvm.align = 16 : i64, llvm.byval = !rec_BigPad, llvm.noundef} loc{{.*}}) -> !s32i // CIR: cir.func{{.*}} @ret_big(%arg0: !cir.ptr<!rec_BigPad> {llvm.align = 16 : i64, llvm.dead_on_unwind, llvm.noalias, llvm.sret = !rec_BigPad, llvm.writable} loc{{.*}}, %arg1: !s32i {llvm.noundef} loc{{.*}}) -// CIR emits noalias on a byval argument where classic does not, here and -// wherever else this file splits a byval line by backend. -// LLVM-CIR: define dso_local i32 @take_big(ptr noalias noundef byval(%struct.BigPad) align 16 %{{.+}}) -// LLVM-OGCG: define dso_local i32 @take_big(ptr noundef byval(%struct.BigPad) align 16 %{{.+}}) +// LLVM: define dso_local i32 @take_big(ptr noundef byval(%struct.BigPad) align 16 %{{.+}}) // LLVM: define dso_local void @ret_big(ptr dead_on_unwind noalias writable sret(%struct.BigPad) align 16 %{{.+}}, i32 noundef %{{.+}}) // A padded member keeps its register coercion, while two of them outgrow two @@ -107,10 +104,9 @@ int take_nest(NestOv n) { return n.o.x; } int take_arr(ArrOv a) { return a.a[1].x; } // CIR: cir.func{{.*}} @take_nest(%arg0: !s32i loc{{.*}}) -> !s32i -// CIR: cir.func{{.*}} @take_arr(%arg0: !cir.ptr<!rec_ArrOv> {llvm.align = 16 : i64, llvm.byval = !rec_ArrOv, llvm.noalias, llvm.noundef} loc{{.*}}) -> !s32i +// CIR: cir.func{{.*}} @take_arr(%arg0: !cir.ptr<!rec_ArrOv> {llvm.align = 16 : i64, llvm.byval = !rec_ArrOv, llvm.noundef} loc{{.*}}) -> !s32i // LLVM: define dso_local i32 @take_nest(i32 %{{.+}}) -// LLVM-CIR: define dso_local i32 @take_arr(ptr noalias noundef byval(%struct.ArrOv) align 16 %{{.+}}) -// LLVM-OGCG: define dso_local i32 @take_arr(ptr noundef byval(%struct.ArrOv) align 16 %{{.+}}) +// LLVM: define dso_local i32 @take_arr(ptr noundef byval(%struct.ArrOv) align 16 %{{.+}}) // The empty member contributes no field and does not shift the int. int take_pwe(PadWithEmpty p) { return p.i; } diff --git a/clang/test/CIR/CodeGen/call-conv-lowering-x86_64-variadic.c b/clang/test/CIR/CodeGen/call-conv-lowering-x86_64-variadic.c index 6c00e8bfa8634..c7d3d4aa8c335 100644 --- a/clang/test/CIR/CodeGen/call-conv-lowering-x86_64-variadic.c +++ b/clang/test/CIR/CodeGen/call-conv-lowering-x86_64-variadic.c @@ -66,21 +66,21 @@ int call_small(Pair2 p, Pair16 q) { return vf(p, q); } // Larger than two eightbytes is MEMORY regardless of register availability. int call_big(Pair2 p, Big b) { return vf(p, b); } -// CIR-LABEL: cir.func {{.*}}@call_big(%arg0: !u64i loc({{.+}}), %arg1: !cir.ptr<!rec_Big> {llvm.align = 8 : i64, llvm.byval = !rec_Big, llvm.noalias, llvm.noundef} loc({{.+}})) -> !s32i +// CIR-LABEL: cir.func {{.*}}@call_big(%arg0: !u64i loc({{.+}}), %arg1: !cir.ptr<!rec_Big> {llvm.align = 8 : i64, llvm.byval = !rec_Big, llvm.noundef} loc({{.+}})) -> !s32i // CIR: %{{[0-9]+}} = cir.load %arg1 : !cir.ptr<!rec_Big>, !rec_Big // CIR: %[[PV:[0-9]+]] = cir.load %{{[0-9]+}} : !cir.ptr<!u64i>, !u64i // CIR-NEXT: %[[COPY:[0-9]+]] = cir.alloca "byval" align(8) : !cir.ptr<!rec_Big> // CIR-NEXT: cir.store %{{[0-9]+}}, %[[COPY]] : !rec_Big, !cir.ptr<!rec_Big> -// CIR-NEXT: %{{[0-9]+}} = cir.call @vf(%[[PV]], %[[COPY]]) : (!u64i, !cir.ptr<!rec_Big> {llvm.align = 8 : i64, llvm.byval = !rec_Big, llvm.noalias, llvm.noundef}) -> !s32i +// CIR-NEXT: %{{[0-9]+}} = cir.call @vf(%[[PV]], %[[COPY]]) : (!u64i, !cir.ptr<!rec_Big> {llvm.align = 8 : i64, llvm.byval = !rec_Big, llvm.noundef}) -> !s32i // CIR copies the incoming byval slot before forwarding it. OGCG does not. // LLVM-CIR-LABEL: define dso_local i32 @call_big( -// LLVM-CIR-SAME: i64 %[[P:[0-9a-zA-Z._]+]], ptr noalias noundef byval(%struct.Big) align 8 %[[B:[0-9a-zA-Z._]+]]) +// LLVM-CIR-SAME: i64 %[[P:[0-9a-zA-Z._]+]], ptr noundef byval(%struct.Big) align 8 %[[B:[0-9a-zA-Z._]+]]) // LLVM-CIR: %{{[0-9a-zA-Z._]+}} = load %struct.Big, ptr %[[B]], align 8 // LLVM-CIR: %[[PV:[0-9a-zA-Z._]+]] = load i64, ptr %{{[0-9a-zA-Z._]+}}, align 8 // LLVM-CIR-NEXT: %[[COPY:[0-9a-zA-Z._]+]] = alloca %struct.Big, align 8 // LLVM-CIR-NEXT: store %struct.Big %{{[0-9a-zA-Z._]+}}, ptr %[[COPY]], align 8 -// LLVM-CIR-NEXT: %{{[0-9a-zA-Z._]+}} = call i32 (i64, ...) @vf(i64 %[[PV]], ptr noalias noundef byval(%struct.Big) align 8 %[[COPY]]) +// LLVM-CIR-NEXT: %{{[0-9a-zA-Z._]+}} = call i32 (i64, ...) @vf(i64 %[[PV]], ptr noundef byval(%struct.Big) align 8 %[[COPY]]) // LLVM-OGCG-LABEL: define dso_local i32 @call_big( // LLVM-OGCG-SAME: i64 %[[P:[0-9a-zA-Z._]+]], ptr noundef byval(%struct.Big) align 8 %[[B:[0-9a-zA-Z._]+]]) @@ -94,7 +94,7 @@ int call_exhausted(Pair2 p, long a, long b, long c, long d, Pair16 q) { return vf(p, a, b, c, d, q); } -// CIR-LABEL: cir.func {{.*}}@call_exhausted(%arg0: !u64i loc({{.+}}), %arg1: !s64i {llvm.noundef} loc({{.+}}), %arg2: !s64i {llvm.noundef} loc({{.+}}), %arg3: !s64i {llvm.noundef} loc({{.+}}), %arg4: !s64i {llvm.noundef} loc({{.+}}), %arg5: !cir.ptr<!rec_Pair16> {llvm.align = 8 : i64, llvm.byval = !rec_Pair16, llvm.noalias, llvm.noundef} loc({{.+}})) -> !s32i +// CIR-LABEL: cir.func {{.*}}@call_exhausted(%arg0: !u64i loc({{.+}}), %arg1: !s64i {llvm.noundef} loc({{.+}}), %arg2: !s64i {llvm.noundef} loc({{.+}}), %arg3: !s64i {llvm.noundef} loc({{.+}}), %arg4: !s64i {llvm.noundef} loc({{.+}}), %arg5: !cir.ptr<!rec_Pair16> {llvm.align = 8 : i64, llvm.byval = !rec_Pair16, llvm.noundef} loc({{.+}})) -> !s32i // CIR: cir.store %arg1, %[[AS:[0-9]+]] : !s64i, !cir.ptr<!s64i> // CIR: cir.store %arg2, %[[BS:[0-9]+]] : !s64i, !cir.ptr<!s64i> // CIR: cir.store %arg3, %[[CS:[0-9]+]] : !s64i, !cir.ptr<!s64i> @@ -106,10 +106,10 @@ int call_exhausted(Pair2 p, long a, long b, long c, long d, Pair16 q) { // CIR: %[[PV:[0-9]+]] = cir.load %{{[0-9]+}} : !cir.ptr<!u64i>, !u64i // CIR-NEXT: %[[COPY:[0-9]+]] = cir.alloca "byval" align(8) : !cir.ptr<!rec_Pair16> // CIR-NEXT: cir.store %{{[0-9]+}}, %[[COPY]] : !rec_Pair16, !cir.ptr<!rec_Pair16> -// CIR-NEXT: %{{[0-9]+}} = cir.call @vf(%[[PV]], %[[AV]], %[[BV]], %[[CV]], %[[DV]], %[[COPY]]) : (!u64i, !s64i {llvm.noundef}, !s64i {llvm.noundef}, !s64i {llvm.noundef}, !s64i {llvm.noundef}, !cir.ptr<!rec_Pair16> {llvm.align = 8 : i64, llvm.byval = !rec_Pair16, llvm.noalias, llvm.noundef}) -> !s32i +// CIR-NEXT: %{{[0-9]+}} = cir.call @vf(%[[PV]], %[[AV]], %[[BV]], %[[CV]], %[[DV]], %[[COPY]]) : (!u64i, !s64i {llvm.noundef}, !s64i {llvm.noundef}, !s64i {llvm.noundef}, !s64i {llvm.noundef}, !cir.ptr<!rec_Pair16> {llvm.align = 8 : i64, llvm.byval = !rec_Pair16, llvm.noundef}) -> !s32i // LLVM-CIR-LABEL: define dso_local i32 @call_exhausted( -// LLVM-CIR-SAME: i64 %[[P:[0-9a-zA-Z._]+]], i64 noundef %[[A:[0-9a-zA-Z._]+]], i64 noundef %[[B:[0-9a-zA-Z._]+]], i64 noundef %[[C:[0-9a-zA-Z._]+]], i64 noundef %[[D:[0-9a-zA-Z._]+]], ptr noalias noundef byval(%struct.Pair16) align 8 %[[Q:[0-9a-zA-Z._]+]]) +// LLVM-CIR-SAME: i64 %[[P:[0-9a-zA-Z._]+]], i64 noundef %[[A:[0-9a-zA-Z._]+]], i64 noundef %[[B:[0-9a-zA-Z._]+]], i64 noundef %[[C:[0-9a-zA-Z._]+]], i64 noundef %[[D:[0-9a-zA-Z._]+]], ptr noundef byval(%struct.Pair16) align 8 %[[Q:[0-9a-zA-Z._]+]]) // LLVM-OGCG-LABEL: define dso_local i32 @call_exhausted( // LLVM-OGCG-SAME: i64 %[[P:[0-9a-zA-Z._]+]], i64 noundef %[[A:[0-9a-zA-Z._]+]], i64 noundef %[[B:[0-9a-zA-Z._]+]], i64 noundef %[[C:[0-9a-zA-Z._]+]], i64 noundef %[[D:[0-9a-zA-Z._]+]], ptr noundef byval(%struct.Pair16) align 8 %[[Q:[0-9a-zA-Z._]+]]) // LLVM: store i64 %[[A]], ptr %[[AS:[0-9a-zA-Z._]+]], align 8 @@ -123,7 +123,7 @@ int call_exhausted(Pair2 p, long a, long b, long c, long d, Pair16 q) { // LLVM-CIR: %[[PV:[0-9a-zA-Z._]+]] = load i64, ptr %{{[0-9a-zA-Z._]+}}, align 8 // LLVM-CIR-NEXT: %[[COPY:[0-9a-zA-Z._]+]] = alloca %struct.Pair16, align 8 // LLVM-CIR-NEXT: store %struct.Pair16 %{{[0-9a-zA-Z._]+}}, ptr %[[COPY]], align 8 -// LLVM-CIR-NEXT: %{{[0-9a-zA-Z._]+}} = call i32 (i64, ...) @vf(i64 %[[PV]], i64 noundef %[[AV]], i64 noundef %[[BV]], i64 noundef %[[CV]], i64 noundef %[[DV]], ptr noalias noundef byval(%struct.Pair16) align 8 %[[COPY]]) +// LLVM-CIR-NEXT: %{{[0-9a-zA-Z._]+}} = call i32 (i64, ...) @vf(i64 %[[PV]], i64 noundef %[[AV]], i64 noundef %[[BV]], i64 noundef %[[CV]], i64 noundef %[[DV]], ptr noundef byval(%struct.Pair16) align 8 %[[COPY]]) // LLVM-OGCG: %[[PV:[0-9a-zA-Z._]+]] = load i64, ptr %{{[0-9a-zA-Z._]+}}, align 4 // LLVM-OGCG-NEXT: %{{[0-9a-zA-Z._]+}} = call i32 (i64, ...) @vf(i64 %[[PV]], i64 noundef %[[AV]], i64 noundef %[[BV]], i64 noundef %[[CV]], i64 noundef %[[DV]], ptr noundef byval(%struct.Pair16) align 8 %[[Q]]) @@ -177,20 +177,20 @@ int call_wide(Pair2 p, Wide w) { return vf(p, w); } // memory, and the 128-bit member keeps the slot at 16-byte alignment. int call_wide_char(Pair2 p, WideChar w) { return vf(p, w); } -// CIR-LABEL: cir.func {{.*}}@call_wide_char(%arg0: !u64i loc({{.+}}), %arg1: !cir.ptr<!rec_WideChar> {llvm.align = 16 : i64, llvm.byval = !rec_WideChar, llvm.noalias, llvm.noundef} loc({{.+}})) -> !s32i +// CIR-LABEL: cir.func {{.*}}@call_wide_char(%arg0: !u64i loc({{.+}}), %arg1: !cir.ptr<!rec_WideChar> {llvm.align = 16 : i64, llvm.byval = !rec_WideChar, llvm.noundef} loc({{.+}})) -> !s32i // CIR: %{{[0-9]+}} = cir.load %arg1 : !cir.ptr<!rec_WideChar>, !rec_WideChar // CIR: %[[PV:[0-9]+]] = cir.load %{{[0-9]+}} : !cir.ptr<!u64i>, !u64i // CIR-NEXT: %[[COPY:[0-9]+]] = cir.alloca "byval" align(16) : !cir.ptr<!rec_WideChar> // CIR-NEXT: cir.store %{{[0-9]+}}, %[[COPY]] : !rec_WideChar, !cir.ptr<!rec_WideChar> -// CIR-NEXT: %{{[0-9]+}} = cir.call @vf(%[[PV]], %[[COPY]]) : (!u64i, !cir.ptr<!rec_WideChar> {llvm.align = 16 : i64, llvm.byval = !rec_WideChar, llvm.noalias, llvm.noundef}) -> !s32i +// CIR-NEXT: %{{[0-9]+}} = cir.call @vf(%[[PV]], %[[COPY]]) : (!u64i, !cir.ptr<!rec_WideChar> {llvm.align = 16 : i64, llvm.byval = !rec_WideChar, llvm.noundef}) -> !s32i // LLVM-CIR-LABEL: define dso_local i32 @call_wide_char( -// LLVM-CIR-SAME: i64 %[[P:[0-9a-zA-Z._]+]], ptr noalias noundef byval(%struct.WideChar) align 16 %[[W:[0-9a-zA-Z._]+]]) +// LLVM-CIR-SAME: i64 %[[P:[0-9a-zA-Z._]+]], ptr noundef byval(%struct.WideChar) align 16 %[[W:[0-9a-zA-Z._]+]]) // LLVM-CIR: %{{[0-9a-zA-Z._]+}} = load %struct.WideChar, ptr %[[W]], align 16 // LLVM-CIR: %[[PV:[0-9a-zA-Z._]+]] = load i64, ptr %{{[0-9a-zA-Z._]+}}, align 8 // LLVM-CIR-NEXT: %[[COPY:[0-9a-zA-Z._]+]] = alloca %struct.WideChar, align 16 // LLVM-CIR-NEXT: store %struct.WideChar %{{[0-9a-zA-Z._]+}}, ptr %[[COPY]], align 16 -// LLVM-CIR-NEXT: %{{[0-9a-zA-Z._]+}} = call i32 (i64, ...) @vf(i64 %[[PV]], ptr noalias noundef byval(%struct.WideChar) align 16 %[[COPY]]) +// LLVM-CIR-NEXT: %{{[0-9a-zA-Z._]+}} = call i32 (i64, ...) @vf(i64 %[[PV]], ptr noundef byval(%struct.WideChar) align 16 %[[COPY]]) // LLVM-OGCG-LABEL: define dso_local i32 @call_wide_char( // LLVM-OGCG-SAME: i64 %[[P:[0-9a-zA-Z._]+]], ptr noundef byval(%struct.WideChar) align 16 %[[W:[0-9a-zA-Z._]+]]) diff --git a/clang/test/CIR/CodeGen/call-conv-lowering-x86_64-zero-width-bitfield.c b/clang/test/CIR/CodeGen/call-conv-lowering-x86_64-zero-width-bitfield.c index 62c16aff0daf5..a672b731403a3 100644 --- a/clang/test/CIR/CodeGen/call-conv-lowering-x86_64-zero-width-bitfield.c +++ b/clang/test/CIR/CodeGen/call-conv-lowering-x86_64-zero-width-bitfield.c @@ -199,9 +199,8 @@ void take_union(ZeroWidthUnion u) {} // Past two eightbytes the record goes to memory, where the widened coerce type // no longer applies. void take_too_big(TooBig b) {} -// CIR: cir.func{{.*}} @take_too_big(%arg0: !cir.ptr<!rec_TooBig> {llvm.align = 8 : i64, llvm.byval = !rec_TooBig, llvm.noalias, llvm.noundef} -// LLVM-CIR: define{{.*}} void @take_too_big(ptr noalias noundef byval(%struct.TooBig) align 8 %{{.+}}) -// LLVM-OGCG: define{{.*}} void @take_too_big(ptr noundef byval(%struct.TooBig) align 8 %{{.+}}) +// CIR: cir.func{{.*}} @take_too_big(%arg0: !cir.ptr<!rec_TooBig> {llvm.align = 8 : i64, llvm.byval = !rec_TooBig, llvm.noundef} +// LLVM: define{{.*}} void @take_too_big(ptr noundef byval(%struct.TooBig) align 8 %{{.+}}) Tail ret_tail(void) { Tail t = {3}; return t; } // CIR: cir.func{{.*}} @ret_tail() -> !u64i diff --git a/clang/test/CIR/CodeGen/call-conv-lowering-x86_64.c b/clang/test/CIR/CodeGen/call-conv-lowering-x86_64.c index d3ba0ebb2a9b0..ce1b406130d2c 100644 --- a/clang/test/CIR/CodeGen/call-conv-lowering-x86_64.c +++ b/clang/test/CIR/CodeGen/call-conv-lowering-x86_64.c @@ -84,13 +84,11 @@ Big ret_big(void) { Big b = {1, 2, 3, 4}; return b; } // CIR: cir.func {{.*}}@ret_big(%arg0: !cir.ptr<!rec_Big> {{.*}}llvm.sret = !rec_Big{{.*}}) // LLVM: define dso_local void @ret_big(ptr dead_on_unwind noalias writable sret(%struct.Big) align 8 %{{.+}}) -// Large struct passed byval. CIR also emits noalias on byval; OGCG only does -// so under -fpass-by-value-is-noalias. +// Large struct passed byval. void take_big(Big b) { (void)b; } // CIR: cir.func {{.*}}@take_big(%arg0: !cir.ptr<!rec_Big> {{.*}}llvm.byval = !rec_Big{{.*}}) -// LLVM-CIR: define dso_local void @take_big(ptr noalias noundef byval(%struct.Big) align 8 %{{.+}}) -// LLVM-OGCG: define dso_local void @take_big(ptr noundef byval(%struct.Big) align 8 %{{.+}}) +// LLVM: define dso_local void @take_big(ptr noundef byval(%struct.Big) align 8 %{{.+}}) // Union members all start at offset zero, so a 4-byte union takes one INTEGER // eightbyte and coerces to i32. @@ -118,21 +116,18 @@ UIntFloat ret_union(int a) { UIntFloat u; u.i = a; return u; } // CIR: cir.func {{.*}}@ret_union(%arg0: !s32i {{.*}}) -> !s32i // LLVM: define dso_local i32 @ret_union(i32 noundef %{{.+}}) -// A union too large for registers is passed byval, with the same noalias -// divergence as a large struct. +// A union too large for registers is passed byval. void take_union_big(UBig u) { (void)u; } // CIR: cir.func {{.*}}@take_union_big(%arg0: !cir.ptr<!rec_UBig> {{.*}}llvm.byval = !rec_UBig{{.*}}) -// LLVM-CIR: define dso_local void @take_union_big(ptr noalias noundef byval(%union.UBig) align 8 %{{.+}}) -// LLVM-OGCG: define dso_local void @take_union_big(ptr noundef byval(%union.UBig) align 8 %{{.+}}) +// LLVM: define dso_local void @take_union_big(ptr noundef byval(%union.UBig) align 8 %{{.+}}) // The byval alignment follows the union's declared alignment, not the alignment // its members imply, which is 1 here. void take_union_big_over_aligned(UBigOverAligned u) { (void)u; } // CIR: cir.func {{.*}}@take_union_big_over_aligned(%arg0: !cir.ptr<!rec_UBigOverAligned> {{.*}}llvm.align = 32 : i64{{.*}}llvm.byval = !rec_UBigOverAligned{{.*}}) -// LLVM-CIR: define dso_local void @take_union_big_over_aligned(ptr noalias noundef byval(%union.UBigOverAligned) align 32 %{{.+}}) -// LLVM-OGCG: define dso_local void @take_union_big_over_aligned(ptr noundef byval(%union.UBigOverAligned) align 32 %{{.+}}) +// LLVM: define dso_local void @take_union_big_over_aligned(ptr noundef byval(%union.UBigOverAligned) align 32 %{{.+}}) void call_union(UIntFloat u) { take_union(u); } @@ -147,11 +142,9 @@ void call_union_big_over_aligned(UBigOverAligned u) { // CIR: cir.func {{.*}}@call_union_big_over_aligned(%arg0: !cir.ptr<!rec_UBigOverAligned> {{.*}}llvm.align = 32 : i64{{.*}}) // CIR: cir.call @take_union_big_over_aligned(%{{.+}}) : (!cir.ptr<!rec_UBigOverAligned> {{.*}}llvm.align = 32 : i64{{.*}}) -> () -// LLVM-CIR: define dso_local void @call_union_big_over_aligned(ptr noalias noundef byval(%union.UBigOverAligned) align 32 %{{.+}}) +// LLVM: define dso_local void @call_union_big_over_aligned(ptr noundef byval(%union.UBigOverAligned) align 32 %{{.+}}) // LLVM-CIR: alloca %union.UBigOverAligned, align 32 -// LLVM-CIR: call void @take_union_big_over_aligned(ptr noalias noundef byval(%union.UBigOverAligned) align 32 %{{.+}}) -// LLVM-OGCG: define dso_local void @call_union_big_over_aligned(ptr noundef byval(%union.UBigOverAligned) align 32 %{{.+}}) -// LLVM-OGCG: call void @take_union_big_over_aligned(ptr noundef byval(%union.UBigOverAligned) align 32 %{{.+}}) +// LLVM: call void @take_union_big_over_aligned(ptr noundef byval(%union.UBigOverAligned) align 32 %{{.+}}) // The declared alignment reaches the sret slot of an indirect return too, not // just a byval argument. @@ -168,8 +161,7 @@ typedef struct { char c[32]; } __attribute__((aligned(32))) SOverAligned; void take_struct_over_aligned(SOverAligned s) { (void)s; } // CIR: cir.func {{.*}}@take_struct_over_aligned(%arg0: !cir.ptr<!rec_SOverAligned> {{.*}}llvm.align = 32 : i64{{.*}}llvm.byval = !rec_SOverAligned{{.*}}) -// LLVM-CIR: define dso_local void @take_struct_over_aligned(ptr noalias noundef byval(%struct.SOverAligned) align 32 %{{.+}}) -// LLVM-OGCG: define dso_local void @take_struct_over_aligned(ptr noundef byval(%struct.SOverAligned) align 32 %{{.+}}) +// LLVM: define dso_local void @take_struct_over_aligned(ptr noundef byval(%struct.SOverAligned) align 32 %{{.+}}) // A half occupies one SSE eightbyte. _Float16 sse_half(_Float16 h) { return h; } @@ -201,8 +193,7 @@ typedef struct { long double l; } SLongDouble; SLongDouble ret_long_double_struct(SLongDouble s) { return s; } // CIR: cir.func {{.*}}@ret_long_double_struct(%arg0: !cir.ptr<!rec_SLongDouble> {{.*}}llvm.byval = !rec_SLongDouble{{.*}}) -> !cir.f80 -// LLVM-CIR: define dso_local x86_fp80 @ret_long_double_struct(ptr noalias noundef byval(%struct.SLongDouble) align 16 %{{.+}}) -// LLVM-OGCG: define dso_local x86_fp80 @ret_long_double_struct(ptr noundef byval(%struct.SLongDouble) align 16 %{{.+}}) +// LLVM: define dso_local x86_fp80 @ret_long_double_struct(ptr noundef byval(%struct.SLongDouble) align 16 %{{.+}}) // A union holding a long double is accepted because the long double spans the // union's declared size. @@ -210,16 +201,14 @@ typedef union { long double l; int i; } ULongDouble; void take_union_long_double(ULongDouble u) { (void)u; } // CIR: cir.func {{.*}}@take_union_long_double(%arg0: !cir.ptr<!rec_ULongDouble> {{.*}}llvm.byval = !rec_ULongDouble{{.*}}) -// LLVM-CIR: define dso_local void @take_union_long_double(ptr noalias noundef byval(%union.ULongDouble) align 16 %{{.+}}) -// LLVM-OGCG: define dso_local void @take_union_long_double(ptr noundef byval(%union.ULongDouble) align 16 %{{.+}}) +// LLVM: define dso_local void @take_union_long_double(ptr noundef byval(%union.ULongDouble) align 16 %{{.+}}) // A _Complex of quads exceeds two eightbytes and goes to memory both ways, so // the sret and byval pointees here are a _Complex rather than a record. _Complex __float128 complex_quad(_Complex __float128 z) { return z; } // CIR: cir.func {{.*}}@complex_quad(%arg0: !cir.ptr<!cir.complex<!cir.f128>> {{.*}}llvm.sret = !cir.complex<!cir.f128>{{.*}}, %arg1: !cir.ptr<!cir.complex<!cir.f128>> {{.*}}llvm.byval = !cir.complex<!cir.f128>{{.*}}) -// LLVM-CIR: define dso_local void @complex_quad(ptr dead_on_unwind noalias writable sret({ fp128, fp128 }) align 16 %{{[^,)]+}}, ptr noalias noundef byval({ fp128, fp128 }) align 16 %{{[^,)]+}}) -// LLVM-OGCG: define dso_local void @complex_quad(ptr dead_on_unwind noalias writable sret({ fp128, fp128 }) align 16 %{{[^,)]+}}, ptr noundef byval({ fp128, fp128 }) align 16 %{{[^,)]+}}) +// LLVM: define dso_local void @complex_quad(ptr dead_on_unwind noalias writable sret({ fp128, fp128 }) align 16 %{{[^,)]+}}, ptr noundef byval({ fp128, fp128 }) align 16 %{{[^,)]+}}) // Both halves of a _Complex float share one SSE eightbyte, so it coerces to // the two-element vector that eightbyte holds. @@ -246,8 +235,7 @@ _Complex int complex_int(_Complex int c) { return c; } _Complex long double complex_long_double(_Complex long double c) { return c; } // CIR: cir.func {{.*}}@complex_long_double(%arg0: !cir.ptr<!cir.complex<!cir.long_double<!cir.f80>>> {{.*}}llvm.byval = !cir.complex<!cir.long_double<!cir.f80>>{{.*}}) -> ![[X87PAIR]] -// LLVM-CIR: define dso_local { x86_fp80, x86_fp80 } @complex_long_double(ptr noalias noundef byval({ x86_fp80, x86_fp80 }) align 16 %{{.+}}) -// LLVM-OGCG: define dso_local { x86_fp80, x86_fp80 } @complex_long_double(ptr noundef byval({ x86_fp80, x86_fp80 }) align 16 %{{.+}}) +// LLVM: define dso_local { x86_fp80, x86_fp80 } @complex_long_double(ptr noundef byval({ x86_fp80, x86_fp80 }) align 16 %{{.+}}) // A _Complex of 16-bit floats fits one eightbyte, so it coerces to the // two-element vector of that format. @@ -338,8 +326,7 @@ typedef double v1d __attribute__((vector_size(8))); void take_v1d(v1d v) { (void)v; } // CIR: cir.func {{.*}}@take_v1d(%arg0: !cir.ptr<!cir.vector<1 x !cir.double>> {{.*}}llvm.align = 8 : i64{{.*}}llvm.byval = !cir.vector<1 x !cir.double>{{.*}}) -// LLVM-CIR: define dso_local void @take_v1d(ptr noalias noundef byval(<1 x double>) align 8 %{{[^,)]+}}) -// LLVM-OGCG: define dso_local void @take_v1d(ptr noundef byval(<1 x double>) align 8 %{{[^,)]+}}) +// LLVM: define dso_local void @take_v1d(ptr noundef byval(<1 x double>) align 8 %{{[^,)]+}}) // A _Complex reaches the classifier as a record member too, not just on its // own, so these cover the field walk rather than the top-level mapping. diff --git a/clang/test/CIR/CodeGen/call.c b/clang/test/CIR/CodeGen/call.c index 4a78bb25d506c..ebc811b7a2aa4 100644 --- a/clang/test/CIR/CodeGen/call.c +++ b/clang/test/CIR/CodeGen/call.c @@ -75,14 +75,13 @@ void f7(void) { // CIR: %[[B:.+]] = cir.load align(4) %{{.+}} : !cir.ptr<!rec_Big>, !rec_Big // CIR-NEXT: %[[SLOT:.+]] = cir.alloca "byval" align(8) : !cir.ptr<!rec_Big> // CIR-NEXT: cir.store %[[B]], %[[SLOT]] : !rec_Big, !cir.ptr<!rec_Big> -// CIR-NEXT: cir.call @f5(%[[SLOT]]) : (!cir.ptr<!rec_Big> {llvm.align = 8 : i64, llvm.byval = !rec_Big, llvm.noalias, llvm.noundef}) -> () +// CIR-NEXT: cir.call @f5(%[[SLOT]]) : (!cir.ptr<!rec_Big> {llvm.align = 8 : i64, llvm.byval = !rec_Big, llvm.noundef}) -> () // LLVM-LABEL: define{{.*}} void @f7(){{.*}} { // LLVM: %[[B:.+]] = load %struct.Big, ptr %{{.+}}, align 4 // LLVM-NEXT: %[[SLOT:.+]] = alloca %struct.Big, align 8 // LLVM-NEXT: store %struct.Big %[[B]], ptr %[[SLOT]], align 4 -// TODO(cir): CIR adds noalias to a byval argument where classic does not. -// LLVM-NEXT: call void @f5(ptr noalias noundef byval(%struct.Big) align 8 %[[SLOT]]) +// LLVM-NEXT: call void @f5(ptr noundef byval(%struct.Big) align 8 %[[SLOT]]) // OGCG-LABEL: define{{.*}} void @f7() #0 { // OGCG: %[[B:.+]] = alloca %struct.Big, align 8 diff --git a/clang/test/CIR/CodeGen/complex-libcall-abi.c b/clang/test/CIR/CodeGen/complex-libcall-abi.c index 937eb20a6dc22..b7d52c6508a70 100644 --- a/clang/test/CIR/CodeGen/complex-libcall-abi.c +++ b/clang/test/CIR/CodeGen/complex-libcall-abi.c @@ -63,9 +63,8 @@ long double _Complex divld(long double _Complex a, long double _Complex b) { // CIR-LABEL: cir.func {{.*}}@divld // CIR: cir.call @__divxc3({{.*}}) : (!cir.long_double<!cir.f80>, !cir.long_double<!cir.f80>, !cir.long_double<!cir.f80>, !cir.long_double<!cir.f80>) -> [[REC_LD]]{{[^0-9]}} -// An x87 pair is passed indirectly, and CIR marks those byval slots noalias. -// LLVMCIR: define dso_local { x86_fp80, x86_fp80 } @divld(ptr noalias noundef byval({ x86_fp80, x86_fp80 }) align 16 %{{.+}}, ptr noalias noundef byval({ x86_fp80, x86_fp80 }) align 16 %{{.+}}) -// OGCG: define dso_local { x86_fp80, x86_fp80 } @divld(ptr noundef byval({ x86_fp80, x86_fp80 }) align 16 %{{.+}}, ptr noundef byval({ x86_fp80, x86_fp80 }) align 16 %{{.+}}) +// An x87 pair is passed indirectly. +// LLVM: define dso_local { x86_fp80, x86_fp80 } @divld(ptr noundef byval({ x86_fp80, x86_fp80 }) align 16 %{{.+}}, ptr noundef byval({ x86_fp80, x86_fp80 }) align 16 %{{.+}}) // LLVMCIR: call { x86_fp80, x86_fp80 } @__divxc3(x86_fp80 %{{.+}}, x86_fp80 %{{.+}}, x86_fp80 %{{.+}}, x86_fp80 %{{.+}}) // OGCG: call { x86_fp80, x86_fp80 } @__divxc3(x86_fp80 noundef %{{.+}}, x86_fp80 noundef %{{.+}}, x86_fp80 noundef %{{.+}}, x86_fp80 noundef %{{.+}}) diff --git a/clang/test/CIR/Transforms/abi-lowering/byval-sret-arg-attr-lowering.cir b/clang/test/CIR/Transforms/abi-lowering/byval-sret-arg-attr-lowering.cir index 97d579a19095b..7f6a3ffb9d857 100644 --- a/clang/test/CIR/Transforms/abi-lowering/byval-sret-arg-attr-lowering.cir +++ b/clang/test/CIR/Transforms/abi-lowering/byval-sret-arg-attr-lowering.cir @@ -42,7 +42,7 @@ module attributes { } // CHECK: cir.func{{.*}} @takes_big(%{{.*}}: !cir.ptr<!rec_Big> {{{.*}}llvm.byval = !rec_Big{{.*}}}) - // LLVM: define void @takes_big(ptr noalias noundef byval(%struct.Big) align 8 %{{.+}}) + // LLVM: define void @takes_big(ptr noundef byval(%struct.Big) align 8 %{{.+}}) // The sret return attribute is converted the same way. cir.func @ret_big() -> !rec_Big attributes { test_classify = #sret_ret } { @@ -71,7 +71,7 @@ module attributes { } // LLVM: define void @caller(%struct.Big %{{.+}}) - // LLVM: call void @takes_big(ptr noalias noundef byval(%struct.Big) align 8 %{{.+}}) + // LLVM: call void @takes_big(ptr noundef byval(%struct.Big) align 8 %{{.+}}) // A caller of an sret function carries the sret attribute on the call // operand; its type payload is converted as well. diff --git a/clang/test/CIR/Transforms/abi-lowering/indirect-byval.cir b/clang/test/CIR/Transforms/abi-lowering/indirect-byval.cir index c3cf6c32c2005..58a096826a8ea 100644 --- a/clang/test/CIR/Transforms/abi-lowering/indirect-byval.cir +++ b/clang/test/CIR/Transforms/abi-lowering/indirect-byval.cir @@ -74,9 +74,7 @@ module attributes { #dlti.dl_entry<i64, dense<64>: vector<2xi64>>> } { - // The byval arg becomes a pointer with llvm.byval, llvm.align, llvm.noalias, - // and llvm.noundef. A load is inserted at entry so the body sees the - // original value type. + // A load is inserted at entry so the body sees the original value type. cir.func @takes_big(%arg0: !rec_Big) -> !s32i attributes { test_classify = #byval_arg } { %r = cir.const #cir.int<0> : !s32i @@ -85,14 +83,11 @@ module attributes { // CHECK: cir.func{{.*}} @takes_big(%[[ARG:.*]]: !cir.ptr<!rec_Big> // CHECK-SAME: llvm.align = 8 : i64 - // CHECK-SAME: llvm.byval = !rec_Big - // CHECK-SAME: llvm.noalias - // CHECK-SAME: llvm.noundef + // CHECK-SAME: llvm.byval = !rec_Big, llvm.noundef // CHECK: %{{.*}} = cir.load %[[ARG]] : !cir.ptr<!rec_Big>, !rec_Big // CHECK-NEXT: %{{.*}} = cir.const #cir.int<0> : !s32i - // byval composes with an Extend return: the pointer parameter carries all - // four byval attrs and the return value carries llvm.signext. + // byval composes with an Extend return. cir.func @takes_big_ext(%arg0: !rec_Big) -> !s32i attributes { test_classify = #byval_arg_ext_return } { %r = cir.const #cir.int<0> : !s32i @@ -100,9 +95,7 @@ module attributes { } // CHECK: cir.func{{.*}} @takes_big_ext(%{{.*}}: !cir.ptr<!rec_Big> - // CHECK-SAME: llvm.byval = !rec_Big - // CHECK-SAME: llvm.noalias - // CHECK-SAME: llvm.noundef + // CHECK-SAME: llvm.byval = !rec_Big, llvm.noundef // CHECK-SAME: ) -> (!s32i {llvm.signext}) // byval composes with an Ignored second argument: the ignored arg is dropped @@ -114,9 +107,7 @@ module attributes { } // CHECK: cir.func{{.*}} @takes_big_ignore(%{{.*}}: !cir.ptr<!rec_Big> - // CHECK-SAME: llvm.byval = !rec_Big - // CHECK-SAME: llvm.noalias - // CHECK-SAME: llvm.noundef + // CHECK-SAME: llvm.byval = !rec_Big, llvm.noundef // CHECK-SAME: ) -> !s32i // CHECK-NOT: !s32i {{.*}}!s32i @@ -125,13 +116,9 @@ module attributes { attributes { test_classify = #byval_arg } // CHECK: cir.func{{.*}} @takes_big_decl(!cir.ptr<!rec_Big> - // CHECK-SAME: llvm.byval = !rec_Big - // CHECK-SAME: llvm.noalias - // CHECK-SAME: llvm.noundef + // CHECK-SAME: llvm.byval = !rec_Big, llvm.noundef - // Caller: byval argument is copied into a fresh alloca; the pointer is - // passed with llvm.byval, llvm.noalias, and llvm.noundef on the call - // operand, matching classic CodeGen's -fpass-by-value-is-noalias output. + // Caller: byval argument is copied into a fresh alloca. cir.func @caller(%s: !rec_Big) -> !s32i attributes { test_classify = #passthrough } { %r = cir.call @takes_big(%s) : (!rec_Big) -> !s32i @@ -142,9 +129,7 @@ module attributes { // CHECK: %[[SLOT:.*]] = cir.alloca "byval" align(8) : !cir.ptr<!rec_Big> // CHECK-NEXT: cir.store %[[S]], %[[SLOT]] : !rec_Big, !cir.ptr<!rec_Big> // CHECK-NEXT: %{{.*}} = cir.call @takes_big(%[[SLOT]]) : - // CHECK-SAME: llvm.byval = !rec_Big - // CHECK-SAME: llvm.noalias - // CHECK-SAME: llvm.noundef + // CHECK-SAME: llvm.byval = !rec_Big, llvm.noundef // A body that actually uses the byval arg value: the existing use in // cir.return is rerouted through the load inserted at entry. @@ -154,9 +139,7 @@ module attributes { } // CHECK: cir.func{{.*}} @takes_big_uses_arg(%[[PTR:.*]]: !cir.ptr<!rec_Big> - // CHECK-SAME: llvm.byval = !rec_Big - // CHECK-SAME: llvm.noalias - // CHECK-SAME: llvm.noundef + // CHECK-SAME: llvm.byval = !rec_Big, llvm.noundef // CHECK: %[[LOADED:.*]] = cir.load %[[PTR]] : !cir.ptr<!rec_Big>, !rec_Big // CHECK-NEXT: cir.return %[[LOADED]] : !rec_Big @@ -167,16 +150,12 @@ module attributes { cir.return %b : !rec_Big } - // Both byval slots carry the full attribute set. Match in appearance order. + // Match the two slots in appearance order. // CHECK: cir.func{{.*}} @two_byval( // CHECK-SAME: !cir.ptr<!rec_Big> - // CHECK-SAME: llvm.byval = !rec_Big - // CHECK-SAME: llvm.noalias - // CHECK-SAME: llvm.noundef + // CHECK-SAME: llvm.byval = !rec_Big, llvm.noundef // CHECK-SAME: !cir.ptr<!rec_Big> - // CHECK-SAME: llvm.byval = !rec_Big - // CHECK-SAME: llvm.noalias - // CHECK-SAME: llvm.noundef + // CHECK-SAME: llvm.byval = !rec_Big, llvm.noundef cir.func @caller_two(%s: !rec_Big, %t: !rec_Big) -> !rec_Big attributes { test_classify = #passthrough } { @@ -190,17 +169,12 @@ module attributes { // CHECK-NEXT: %[[B:.*]] = cir.alloca "byval" align(8) : !cir.ptr<!rec_Big> // CHECK-NEXT: cir.store %{{.*}}, %[[B]] : !rec_Big, !cir.ptr<!rec_Big> // CHECK-NEXT: %{{.*}} = cir.call @two_byval(%[[A]], %[[B]]) : - // CHECK-SAME: llvm.byval = !rec_Big - // CHECK-SAME: llvm.noalias - // CHECK-SAME: llvm.noundef + // CHECK-SAME: llvm.byval = !rec_Big, llvm.noundef // CHECK-SAME: !cir.ptr<!rec_Big> - // CHECK-SAME: llvm.byval = !rec_Big - // CHECK-SAME: llvm.noalias - // CHECK-SAME: llvm.noundef + // CHECK-SAME: llvm.byval = !rec_Big, llvm.noundef // sret return + byval arg: the sret pointer is prepended at slot 0 and the - // byval arg shifts to slot 1 (sretOffset = 1). The byval slot carries all - // four byval attrs; the sret slot carries its own standard set. + // byval arg shifts to slot 1 (sretOffset = 1). cir.func @byval_and_sret(%arg0: !rec_Big) -> !rec_Big attributes { test_classify = #sret_byval } { %0 = cir.alloca "__retval" align(8) : !cir.ptr<!rec_Big> @@ -213,14 +187,12 @@ module attributes { // CHECK: cir.func{{.*}} @byval_and_sret( // CHECK-SAME: llvm.sret = !rec_Big // CHECK-SAME: !cir.ptr<!rec_Big> - // CHECK-SAME: llvm.byval = !rec_Big - // CHECK-SAME: llvm.noalias - // CHECK-SAME: llvm.noundef + // CHECK-SAME: llvm.byval = !rec_Big, llvm.noundef // CHECK-NOT: -> !rec_Big // CHECK: cir.store %{{.*}}, %{{.*}} : !rec_Big, !cir.ptr<!rec_Big> // CHECK: cir.return - // byref callee: llvm.byref without noalias/noundef. CIRGen spills the + // byref callee: llvm.byref without noundef. CIRGen spills the // by-value param into a local alloca; the rewriter rewires that alloca to // the incoming pointer (no entry load / byte-copy). cir.func @takes_big_byref(%arg0: !rec_Big) -> !rec_Big @@ -270,7 +242,7 @@ module attributes { } // CHECK: cir.func{{.*}} @takes_big_byval_field(%[[PTR:.*]]: !cir.ptr<!rec_Big> - // CHECK-SAME: llvm.byval = !rec_Big + // CHECK-SAME: llvm.byval = !rec_Big, llvm.noundef // CHECK: %[[LOADED:.*]] = cir.load %[[PTR]] : !cir.ptr<!rec_Big>, !rec_Big // CHECK: %[[SLOT:.*]] = cir.alloca "arg0" align(8) init : !cir.ptr<!rec_Big> // CHECK: cir.store %[[LOADED]], %[[SLOT]] : !rec_Big, !cir.ptr<!rec_Big> diff --git a/clang/test/CIR/Transforms/abi-lowering/indirect-call-test-target.cir b/clang/test/CIR/Transforms/abi-lowering/indirect-call-test-target.cir index 943ed8b3bb261..ab71eac35a9e0 100644 --- a/clang/test/CIR/Transforms/abi-lowering/indirect-call-test-target.cir +++ b/clang/test/CIR/Transforms/abi-lowering/indirect-call-test-target.cir @@ -34,8 +34,6 @@ module attributes { // CHECK: %[[SLOT:.*]] = cir.alloca "byval" align(8) : !cir.ptr<!rec_Big> // CHECK: %[[CAST:.*]] = cir.cast bitcast %[[FP]] : !cir.ptr<!cir.func<(!rec_Big) -> !s64i>> -> !cir.ptr<!cir.func<(!cir.ptr<!rec_Big>) -> !s64i>> // CHECK: %{{.*}} = cir.call %[[CAST]](%[[SLOT]]) : (!cir.ptr<!cir.func<(!cir.ptr<!rec_Big>) -> !s64i>>, !cir.ptr<!rec_Big> - // CHECK-SAME: llvm.byval = !rec_Big - // CHECK-SAME: llvm.noalias - // CHECK-SAME: llvm.noundef + // CHECK-SAME: llvm.byval = !rec_Big, llvm.noundef } diff --git a/clang/test/CIR/Transforms/abi-lowering/indirect-call.cir b/clang/test/CIR/Transforms/abi-lowering/indirect-call.cir index c6b16630ad5a6..eca64c5975ea1 100644 --- a/clang/test/CIR/Transforms/abi-lowering/indirect-call.cir +++ b/clang/test/CIR/Transforms/abi-lowering/indirect-call.cir @@ -89,7 +89,7 @@ module attributes { // CHECK: %[[SLOT:.*]] = cir.alloca "byval" align(8) : !cir.ptr<!rec_Big> // CHECK: cir.store %{{.+}}, %[[SLOT]] : !rec_Big, !cir.ptr<!rec_Big> // CHECK: %[[CAST:.*]] = cir.cast bitcast %arg0 : !cir.ptr<!cir.func<(!rec_Big) -> !s64i>> -> !cir.ptr<!cir.func<(!cir.ptr<!rec_Big>) -> !s64i>> - // CHECK: cir.call %[[CAST]](%[[SLOT]]) : (!cir.ptr<!cir.func<(!cir.ptr<!rec_Big>) -> !s64i>>, !cir.ptr<!rec_Big> {llvm.align = 8 : i64, llvm.byval = !rec_Big, llvm.noalias, llvm.noundef}) -> !s64i + // CHECK: cir.call %[[CAST]](%[[SLOT]]) : (!cir.ptr<!cir.func<(!cir.ptr<!rec_Big>) -> !s64i>>, !cir.ptr<!rec_Big> {llvm.align = 8 : i64, llvm.byval = !rec_Big, llvm.noundef}) -> !s64i // Indirect call returning a large struct: an sret pointer slot is prepended // and the callee is bitcast to the void-returning sret signature. diff --git a/clang/test/CIR/Transforms/abi-lowering/x86_64-bitint.cir b/clang/test/CIR/Transforms/abi-lowering/x86_64-bitint.cir index 4a77b2746b818..1a8f491fc9e7d 100644 --- a/clang/test/CIR/Transforms/abi-lowering/x86_64-bitint.cir +++ b/clang/test/CIR/Transforms/abi-lowering/x86_64-bitint.cir @@ -763,12 +763,12 @@ module attributes { // CHECK-LABEL: cir.func{{.*}} @take_o( // CHECK-SAME: %arg0: !cir.ptr<!rec_O> {llvm.align = 8 : i64 - // CHECK-SAME: , llvm.byval = !rec_O, llvm.noalias, llvm.noundef}) + // CHECK-SAME: , llvm.byval = !rec_O, llvm.noundef}) // CHECK-NEXT: %{{[0-9]+}} = cir.load %arg0 : !cir.ptr<!rec_O>, !rec_O // CHECK-NEXT: cir.return // LLVM-LABEL: define void @take_o( - // LLVM-SAME: ptr noalias noundef byval(%struct.O) align 8 %[[ARG:[0-9]+]]) + // LLVM-SAME: ptr noundef byval(%struct.O) align 8 %[[ARG:[0-9]+]]) // LLVM-NEXT: %{{[0-9]+}} = load %struct.O, ptr %[[ARG]] // LLVM-NEXT: ret void @@ -804,12 +804,12 @@ module attributes { // CHECK-LABEL: cir.func{{.*}} @take_arr( // CHECK-SAME: %arg0: !cir.ptr<!rec_Arr> {llvm.align = 8 : i64 - // CHECK-SAME: , llvm.byval = !rec_Arr, llvm.noalias, llvm.noundef}) + // CHECK-SAME: , llvm.byval = !rec_Arr, llvm.noundef}) // CHECK-NEXT: %{{[0-9]+}} = cir.load %arg0 : !cir.ptr<!rec_Arr>, !rec_Arr // CHECK-NEXT: cir.return // LLVM-LABEL: define void @take_arr( - // LLVM-SAME: ptr noalias noundef byval(%struct.Arr) align 8 %[[ARG:[0-9]+]]) + // LLVM-SAME: ptr noundef byval(%struct.Arr) align 8 %[[ARG:[0-9]+]]) // LLVM-NEXT: %{{[0-9]+}} = load %struct.Arr, ptr %[[ARG]] // LLVM-NEXT: ret void } diff --git a/clang/test/CIR/Transforms/abi-lowering/x86_64-complex.cir b/clang/test/CIR/Transforms/abi-lowering/x86_64-complex.cir index 200f42398850d..5a148609a6bb8 100644 --- a/clang/test/CIR/Transforms/abi-lowering/x86_64-complex.cir +++ b/clang/test/CIR/Transforms/abi-lowering/x86_64-complex.cir @@ -72,4 +72,4 @@ module attributes { // LLVM: define { double, double } @cdouble(double %{{.+}}, double %{{.+}}) // LLVM: define i32 @cshort(i32 %{{.+}}) // LLVM: define i64 @cint(i64 %{{.+}}) -// LLVM: define { x86_fp80, x86_fp80 } @clongdouble(ptr noalias noundef byval({ x86_fp80, x86_fp80 }) align 16 %{{.+}}) +// LLVM: define { x86_fp80, x86_fp80 } @clongdouble(ptr noundef byval({ x86_fp80, x86_fp80 }) align 16 %{{.+}}) diff --git a/clang/test/CIR/Transforms/abi-lowering/x86_64-empty-class.cir b/clang/test/CIR/Transforms/abi-lowering/x86_64-empty-class.cir index 6a0dddc601f5a..277ec1c2fc453 100644 --- a/clang/test/CIR/Transforms/abi-lowering/x86_64-empty-class.cir +++ b/clang/test/CIR/Transforms/abi-lowering/x86_64-empty-class.cir @@ -225,8 +225,8 @@ module attributes { cir.return %arg1 : !s32i } - // CHECK: cir.func{{.*}} @take_empty_big(%arg0: !cir.ptr<!rec_EBig> {llvm.align = 32 : i64, llvm.byval = !rec_EBig, llvm.noalias, llvm.noundef}, %arg1: !s32i) -> !s32i - // LLVM: define i32 @take_empty_big(ptr noalias noundef byval(%struct.EBig) align 32 %{{.*}}, i32 %{{.*}}) + // CHECK: cir.func{{.*}} @take_empty_big(%arg0: !cir.ptr<!rec_EBig> {llvm.align = 32 : i64, llvm.byval = !rec_EBig, llvm.noundef}, %arg1: !s32i) -> !s32i + // LLVM: define i32 @take_empty_big(ptr noundef byval(%struct.EBig) align 32 %{{.*}}, i32 %{{.*}}) // The same record returned uses sret at that alignment. cir.func @ret_empty_big() -> !rec_EBig { diff --git a/clang/test/CIR/Transforms/abi-lowering/x86_64-struct-indirect.cir b/clang/test/CIR/Transforms/abi-lowering/x86_64-struct-indirect.cir index 95609d59b4f35..bc75ab74b445f 100644 --- a/clang/test/CIR/Transforms/abi-lowering/x86_64-struct-indirect.cir +++ b/clang/test/CIR/Transforms/abi-lowering/x86_64-struct-indirect.cir @@ -30,7 +30,7 @@ module attributes { cir.return %2 : !s64i } - // CHECK: cir.func{{.*}} @take_big(%arg0: !cir.ptr<!rec_Big> {llvm.align = 8 : i64, llvm.byval = !rec_Big, llvm.noalias, llvm.noundef}) -> !s64i + // CHECK: cir.func{{.*}} @take_big(%arg0: !cir.ptr<!rec_Big> {llvm.align = 8 : i64, llvm.byval = !rec_Big, llvm.noundef}) -> !s64i // CHECK: %[[VAL:.*]] = cir.load %arg0 : !cir.ptr<!rec_Big>, !rec_Big // CHECK: %[[LOCAL:.*]] = cir.alloca "b" {{.*}} : !cir.ptr<!rec_Big> // CHECK: cir.store %[[VAL]], %[[LOCAL]] : !rec_Big, !cir.ptr<!rec_Big> @@ -60,7 +60,7 @@ module attributes { cir.return } - // CHECK: cir.func{{.*}} @take_big128(%arg0: !cir.ptr<!rec_Big128> {llvm.align = 16 : i64, llvm.byval = !rec_Big128, llvm.noalias, llvm.noundef}) + // CHECK: cir.func{{.*}} @take_big128(%arg0: !cir.ptr<!rec_Big128> {llvm.align = 16 : i64, llvm.byval = !rec_Big128, llvm.noundef}) cir.func @ret_big128() -> !rec_Big128 { %0 = cir.alloca "r" align(16) : !cir.ptr<!rec_Big128> diff --git a/clang/test/CIR/Transforms/abi-lowering/x86_64-struct-padded.cir b/clang/test/CIR/Transforms/abi-lowering/x86_64-struct-padded.cir index ccfd8aa218d6f..07b7a45d97cc9 100644 --- a/clang/test/CIR/Transforms/abi-lowering/x86_64-struct-padded.cir +++ b/clang/test/CIR/Transforms/abi-lowering/x86_64-struct-padded.cir @@ -72,7 +72,7 @@ module attributes { cir.return } - // CHECK: cir.func{{.*}} @take_big(%arg0: !cir.ptr<!rec_Big> {llvm.align = 16 : i64, llvm.byval = !rec_Big, llvm.noalias, llvm.noundef}) + // CHECK: cir.func{{.*}} @take_big(%arg0: !cir.ptr<!rec_Big> {llvm.align = 16 : i64, llvm.byval = !rec_Big, llvm.noundef}) // A record the caller must destroy is passed by reference rather than copied, // so it takes byref instead of byval even though the size rule is the same. diff --git a/clang/test/CIR/Transforms/abi-lowering/x86_64-union.cir b/clang/test/CIR/Transforms/abi-lowering/x86_64-union.cir index 8f457bc95f0f9..0e3d3860e879c 100644 --- a/clang/test/CIR/Transforms/abi-lowering/x86_64-union.cir +++ b/clang/test/CIR/Transforms/abi-lowering/x86_64-union.cir @@ -182,7 +182,7 @@ module attributes { cir.return } - // CHECK: cir.func{{.*}} @take_big(%arg0: !cir.ptr<!rec_UBig> {llvm.align = 8 : i64, llvm.byval = !rec_UBig, llvm.noalias, llvm.noundef}) + // CHECK: cir.func{{.*}} @take_big(%arg0: !cir.ptr<!rec_UBig> {llvm.align = 8 : i64, llvm.byval = !rec_UBig, llvm.noundef}) // CHECK: %{{.*}} = cir.load %arg0 : !cir.ptr<!rec_UBig>, !rec_UBig // The byval alignment comes from the record's declared alignment, which the @@ -192,7 +192,7 @@ module attributes { cir.return } - // CHECK: cir.func{{.*}} @take_big_over_aligned(%arg0: !cir.ptr<!rec_UBigOverAligned> {llvm.align = 32 : i64, llvm.byval = !rec_UBigOverAligned, llvm.noalias, llvm.noundef}) + // CHECK: cir.func{{.*}} @take_big_over_aligned(%arg0: !cir.ptr<!rec_UBigOverAligned> {llvm.align = 32 : i64, llvm.byval = !rec_UBigOverAligned, llvm.noundef}) // The same declared-alignment source feeds every accepted record, not just // unions: an over-aligned STRUCT gets the same byval alignment fix, since @@ -201,7 +201,7 @@ module attributes { cir.return } - // CHECK: cir.func{{.*}} @take_struct_over_aligned(%arg0: !cir.ptr<!rec_SOverAligned> {llvm.align = 32 : i64, llvm.byval = !rec_SOverAligned, llvm.noalias, llvm.noundef}) + // CHECK: cir.func{{.*}} @take_struct_over_aligned(%arg0: !cir.ptr<!rec_SOverAligned> {llvm.align = 32 : i64, llvm.byval = !rec_SOverAligned, llvm.noundef}) // A union with no members classifies Ignore and is dropped from the // signature. @@ -298,7 +298,7 @@ module attributes { cir.return } - // CHECK: cir.func{{.*}} @take_big_empty_int(%arg0: !cir.ptr<!rec_UBigEmptyInt> {llvm.align = 32 : i64, llvm.byval = !rec_UBigEmptyInt, llvm.noalias, llvm.noundef}) + // CHECK: cir.func{{.*}} @take_big_empty_int(%arg0: !cir.ptr<!rec_UBigEmptyInt> {llvm.align = 32 : i64, llvm.byval = !rec_UBigEmptyInt, llvm.noundef}) // More than one empty member is skipped the same way. cir.func @take_two_empty(%arg0: !rec_UTwoEmpty) { @@ -426,7 +426,7 @@ module attributes { cir.return %1 : !rec_UBig } - // CHECK: cir.func{{.*}} @ret_big(%arg0: !cir.ptr<!rec_UBig> {llvm.align = 1 : i64, llvm.dead_on_unwind, llvm.noalias, llvm.sret = !rec_UBig, llvm.writable}, %arg1: !cir.ptr<!rec_UBig> {llvm.align = 8 : i64, llvm.byval = !rec_UBig, llvm.noalias, llvm.noundef}) + // CHECK: cir.func{{.*}} @ret_big(%arg0: !cir.ptr<!rec_UBig> {llvm.align = 1 : i64, llvm.dead_on_unwind, llvm.noalias, llvm.sret = !rec_UBig, llvm.writable}, %arg1: !cir.ptr<!rec_UBig> {llvm.align = 8 : i64, llvm.byval = !rec_UBig, llvm.noundef}) // CHECK: %[[VAL:.*]] = cir.load %arg1 : !cir.ptr<!rec_UBig>, !rec_UBig // CHECK: cir.store %[[VAL]], %arg0 : !rec_UBig, !cir.ptr<!rec_UBig> @@ -471,9 +471,9 @@ module attributes { // LLVM: define void @take_three(i24 %{{.+}}) // LLVM: define void @take_narrow_storage(i64 %{{.+}}) // LLVM: define void @take_two_eightbytes(i64 %{{.+}}, i64 %{{.+}}) -// LLVM: define void @take_big(ptr noalias noundef byval(%union.UBig) align 8 %{{.+}}) -// LLVM: define void @take_big_over_aligned(ptr noalias noundef byval(%union.UBigOverAligned) align 32 %{{.+}}) -// LLVM: define void @take_struct_over_aligned(ptr noalias noundef byval(%struct.SOverAligned) align 32 %{{.+}}) +// LLVM: define void @take_big(ptr noundef byval(%union.UBig) align 8 %{{.+}}) +// LLVM: define void @take_big_over_aligned(ptr noundef byval(%union.UBigOverAligned) align 32 %{{.+}}) +// LLVM: define void @take_struct_over_aligned(ptr noundef byval(%struct.SOverAligned) align 32 %{{.+}}) // LLVM: define void @take_empty() // LLVM: define void @ret_empty() // LLVM: define void @take_empty_int(i32 %{{.+}}) @@ -484,7 +484,7 @@ module attributes { // LLVM: define void @take_empty_bytes(i64 %{{.+}}) // LLVM: define void @take_arr_empty(i8 %{{.+}}) // LLVM: define void @take_arr8_empty(i8 %{{.+}}) -// LLVM: define void @take_big_empty_int(ptr noalias noundef byval(%union.UBigEmptyInt) align 32 %{{.+}}) +// LLVM: define void @take_big_empty_int(ptr noundef byval(%union.UBigEmptyInt) align 32 %{{.+}}) // LLVM: define void @take_two_empty(i32 %{{.+}}) // LLVM: define void @take_empty_unnamed_bits() // LLVM: define void @take_empty_floats(<2 x float> %{{.+}}) @@ -499,7 +499,7 @@ module attributes { // LLVM: define void @take_no_regs(ptr byref(%union.UNoRegs) align 4 %{{.+}}) // LLVM: define void @take_struct_with_union(i64 %{{.+}}) // LLVM: define i32 @ret_int_float(i32 %{{.+}}) -// LLVM: define void @ret_big(ptr dead_on_unwind noalias writable sret(%union.UBig) align 1 %{{.+}}, ptr noalias noundef byval(%union.UBig) align 8 %{{.+}}) +// LLVM: define void @ret_big(ptr dead_on_unwind noalias writable sret(%union.UBig) align 1 %{{.+}}, ptr noundef byval(%union.UBig) align 8 %{{.+}}) // LLVM: define void @call_int_float(i32 %{{.+}}) // LLVM: call void @take_int_float(i32 %{{.+}}) // LLVM: define void @call_two_eightbytes(i64 %{{.+}}, i64 %{{.+}}) diff --git a/clang/test/CIR/Transforms/abi-lowering/x86_64-variadic-call.cir b/clang/test/CIR/Transforms/abi-lowering/x86_64-variadic-call.cir index f0cb16463c8d5..80303dbdee129 100644 --- a/clang/test/CIR/Transforms/abi-lowering/x86_64-variadic-call.cir +++ b/clang/test/CIR/Transforms/abi-lowering/x86_64-variadic-call.cir @@ -86,7 +86,7 @@ module attributes { // CHECK: cir.func{{.*}} @pass_two_exhausted(%arg0: !cir.ptr<!s8i>, %arg1: !s32i, %arg2: !s64i, %arg3: !s64i) // CHECK: %[[SLOT:.*]] = cir.alloca "byval" align(8) : !cir.ptr<!rec_Two> - // CHECK: cir.call @variadic(%arg0, %arg1, %arg1, %arg1, %arg1, %arg1, %[[SLOT]]) : (!cir.ptr<!s8i>, !s32i, !s32i, !s32i, !s32i, !s32i, !cir.ptr<!rec_Two> {llvm.align = 8 : i64, llvm.byval = !rec_Two, llvm.noalias, llvm.noundef}) -> !s32i + // CHECK: cir.call @variadic(%arg0, %arg1, %arg1, %arg1, %arg1, %arg1, %[[SLOT]]) : (!cir.ptr<!s8i>, !s32i, !s32i, !s32i, !s32i, !s32i, !cir.ptr<!rec_Two> {llvm.align = 8 : i64, llvm.byval = !rec_Two, llvm.noundef}) -> !s32i // A record larger than two eightbytes is memory class no matter how many // registers are free. @@ -95,9 +95,9 @@ module attributes { cir.return } - // CHECK: cir.func{{.*}} @pass_big(%arg0: !cir.ptr<!s8i>, %arg1: !cir.ptr<!rec_Big> {llvm.align = 8 : i64, llvm.byval = !rec_Big, llvm.noalias, llvm.noundef}) + // CHECK: cir.func{{.*}} @pass_big(%arg0: !cir.ptr<!s8i>, %arg1: !cir.ptr<!rec_Big> {llvm.align = 8 : i64, llvm.byval = !rec_Big, llvm.noundef}) // CHECK: %[[BSLOT:.*]] = cir.alloca "byval" align(8) : !cir.ptr<!rec_Big> - // CHECK: cir.call @variadic(%arg0, %[[BSLOT]]) : (!cir.ptr<!s8i>, !cir.ptr<!rec_Big> {llvm.align = 8 : i64, llvm.byval = !rec_Big, llvm.noalias, llvm.noundef}) -> !s32i + // CHECK: cir.call @variadic(%arg0, %[[BSLOT]]) : (!cir.ptr<!s8i>, !cir.ptr<!rec_Big> {llvm.align = 8 : i64, llvm.byval = !rec_Big, llvm.noundef}) -> !s32i // An empty record occupies no register and is dropped, without displacing // the argument behind it. @@ -129,8 +129,8 @@ module attributes { cir.return } - // CHECK: cir.func{{.*}} @pass_wide_vector(%arg0: !cir.ptr<!s8i>, %arg1: !cir.ptr<!cir.vector<8 x !cir.float>> {llvm.align = 32 : i64, llvm.byval = !cir.vector<8 x !cir.float>, llvm.noalias, llvm.noundef}) - // CHECK: cir.call @variadic(%arg0, %{{.*}}) : (!cir.ptr<!s8i>, !cir.ptr<!cir.vector<8 x !cir.float>> {llvm.align = 32 : i64, llvm.byval = !cir.vector<8 x !cir.float>, llvm.noalias, llvm.noundef}) -> !s32i + // CHECK: cir.func{{.*}} @pass_wide_vector(%arg0: !cir.ptr<!s8i>, %arg1: !cir.ptr<!cir.vector<8 x !cir.float>> {llvm.align = 32 : i64, llvm.byval = !cir.vector<8 x !cir.float>, llvm.noundef}) + // CHECK: cir.call @variadic(%arg0, %{{.*}}) : (!cir.ptr<!s8i>, !cir.ptr<!cir.vector<8 x !cir.float>> {llvm.align = 32 : i64, llvm.byval = !cir.vector<8 x !cir.float>, llvm.noundef}) -> !s32i // A declared parameter is coerced the same way whether or not the call also // passes ellipsis arguments. @@ -209,10 +209,10 @@ module attributes { // LLVM: call i32 (ptr, ...) @variadic(ptr %{{[^,)]+}}, i64 %{{[^,)]+}}, i64 %{{[^,)]+}}) // LLVM: define void @pass_two_exhausted(ptr %{{[^,)]+}}, i32 %{{[^,)]+}}, i64 %{{[^,)]+}}, i64 %{{[^,)]+}}) -// LLVM: call i32 (ptr, ...) @variadic(ptr %{{[^,)]+}}, i32 %{{[^,)]+}}, i32 %{{[^,)]+}}, i32 %{{[^,)]+}}, i32 %{{[^,)]+}}, i32 %{{[^,)]+}}, ptr noalias noundef byval(%struct.Two) align 8 %{{[^,)]+}}) +// LLVM: call i32 (ptr, ...) @variadic(ptr %{{[^,)]+}}, i32 %{{[^,)]+}}, i32 %{{[^,)]+}}, i32 %{{[^,)]+}}, i32 %{{[^,)]+}}, i32 %{{[^,)]+}}, ptr noundef byval(%struct.Two) align 8 %{{[^,)]+}}) -// LLVM: define void @pass_big(ptr %{{[^,)]+}}, ptr noalias noundef byval(%struct.Big) align 8 %{{[^,)]+}}) -// LLVM: call i32 (ptr, ...) @variadic(ptr %{{[^,)]+}}, ptr noalias noundef byval(%struct.Big) align 8 %{{[^,)]+}}) +// LLVM: define void @pass_big(ptr %{{[^,)]+}}, ptr noundef byval(%struct.Big) align 8 %{{[^,)]+}}) +// LLVM: call i32 (ptr, ...) @variadic(ptr %{{[^,)]+}}, ptr noundef byval(%struct.Big) align 8 %{{[^,)]+}}) // LLVM: define void @pass_empty(ptr %{{[^,)]+}}, i32 %{{[^,)]+}}) // LLVM: call i32 (ptr, ...) @variadic(ptr %{{[^,)]+}}, i32 %{{[^,)]+}}) @@ -220,8 +220,8 @@ module attributes { // LLVM: define void @pass_all_float(ptr %{{[^,)]+}}, <2 x float> %{{[^,)]+}}) // LLVM: call i32 (ptr, ...) @variadic(ptr %{{[^,)]+}}, <2 x float> %{{[^,)]+}}) -// LLVM: define void @pass_wide_vector(ptr %{{[^,)]+}}, ptr noalias noundef byval(<8 x float>) align 32 %{{[^,)]+}}) -// LLVM: call i32 (ptr, ...) @variadic(ptr %{{[^,)]+}}, ptr noalias noundef byval(<8 x float>) align 32 %{{[^,)]+}}) +// LLVM: define void @pass_wide_vector(ptr %{{[^,)]+}}, ptr noundef byval(<8 x float>) align 32 %{{[^,)]+}}) +// LLVM: call i32 (ptr, ...) @variadic(ptr %{{[^,)]+}}, ptr noundef byval(<8 x float>) align 32 %{{[^,)]+}}) // LLVM: define void @pass_declared_coerced(i64 %{{[^,)]+}}, i32 %{{[^,)]+}}) // LLVM: call i32 (i64, ...) @variadic_pair(i64 %{{[^,)]+}}, i32 %{{[^,)]+}}) diff --git a/clang/test/CIR/Transforms/abi-lowering/x86_64-vector.cir b/clang/test/CIR/Transforms/abi-lowering/x86_64-vector.cir index b1aa989585e10..0c1d41808c9de 100644 --- a/clang/test/CIR/Transforms/abi-lowering/x86_64-vector.cir +++ b/clang/test/CIR/Transforms/abi-lowering/x86_64-vector.cir @@ -117,7 +117,7 @@ module attributes { // LLVM: define <4 x float> @v128(<4 x float> %{{[^,)]+}}) // LLVM: define double @v64(double %{{[^,)]+}}) // LLVM: define i32 @v32(i32 %{{[^,)]+}}) -// LLVM: define void @v256(ptr noalias noundef byval(<8 x float>) align 32 %{{[^,)]+}}) +// LLVM: define void @v256(ptr noundef byval(<8 x float>) align 32 %{{[^,)]+}}) // LLVM: define void @take_ff(<2 x float> %{{[^,)]+}}) // LLVM: define <2 x float> @ret_ff() // LLVM: define void @take_farr(<2 x float> %{{[^,)]+}}) diff --git a/clang/test/CIR/Transforms/abi-lowering/x86_64-vptr.cir b/clang/test/CIR/Transforms/abi-lowering/x86_64-vptr.cir index 2f0497680e1fa..37d16e3f1013e 100644 --- a/clang/test/CIR/Transforms/abi-lowering/x86_64-vptr.cir +++ b/clang/test/CIR/Transforms/abi-lowering/x86_64-vptr.cir @@ -188,8 +188,8 @@ module attributes { cir.return } - // CHECK: cir.func{{.*}} @take_vp_big(%arg0: !cir.ptr<!rec_VPBig> {llvm.align = 8 : i64, llvm.byval = !rec_VPBig, llvm.noalias, llvm.noundef}) - // LLVM: define void @take_vp_big(ptr noalias noundef byval(%struct.VPBig) align 8 %{{[^,)]+}}) + // CHECK: cir.func{{.*}} @take_vp_big(%arg0: !cir.ptr<!rec_VPBig> {llvm.align = 8 : i64, llvm.byval = !rec_VPBig, llvm.noundef}) + // LLVM: define void @take_vp_big(ptr noundef byval(%struct.VPBig) align 8 %{{[^,)]+}}) // Returned at that size it uses sret instead. cir.func @ret_vp_big() -> !rec_VPBig { diff --git a/clang/test/CIR/Transforms/abi-lowering/x86_64-wide-floats.cir b/clang/test/CIR/Transforms/abi-lowering/x86_64-wide-floats.cir index 6e65569c08cc3..61ef20c3ebbff 100644 --- a/clang/test/CIR/Transforms/abi-lowering/x86_64-wide-floats.cir +++ b/clang/test/CIR/Transforms/abi-lowering/x86_64-wide-floats.cir @@ -72,4 +72,4 @@ module attributes { // LLVM: define fp128 @quad(fp128 %{{.+}}) // LLVM: define x86_fp80 @x87(x86_fp80 %{{.+}}) // LLVM: define x86_fp80 @raw_f80(x86_fp80 %{{.+}}) -// LLVM: define void @take_sld(ptr noalias noundef byval(%struct.SLD) align 16 %{{.+}}) +// LLVM: define void @take_sld(ptr noundef byval(%struct.SLD) align 16 %{{.+}}) _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
