Author: Chaitanya Date: 2026-11-14T08:46:10+05:30 New Revision: 949c1c61b3ab4559a610e93211dbf0f3e8ae6aa8
URL: https://github.com/llvm/llvm-project/commit/949c1c61b3ab4559a610e93211dbf0f3e8ae6aa8 DIFF: https://github.com/llvm/llvm-project/commit/949c1c61b3ab4559a610e93211dbf0f3e8ae6aa8.diff LOG: [CIR] Flatten unions passed Direct in CallConvLowering (#241201) Summary: - On AMDGPU, a union wider than 64 bits is passed Direct with no coerce type. - OGCG passes it as its LLVM type's fields, storage member and tail padding while CIR passed whole union. Example: ` typedef union { int a[3]; double d; } u_pad_t;` ` void arg_u_pad(u_pad_t u) {}` ` OGCG: @arg_u_pad(double, [8 x i8])` ` CIR: @arg_u_pad(%union.u_pad_t)` - This patch flattens such a union the same way. Returns stay the union, as in OGCG. - A flattened field stored into a packed slot now uses the slot's alignment. A packed union's double was stored at `align 8` into an `align 1` slot, which is now fixed to use `align 1`. Relates to: https://github.com/llvm/llvm-project/issues/220471 Assisted by: claude opus 5.5 Added: clang/test/CIR/Transforms/abi-lowering/amdgpu-union.cir Modified: clang/lib/CIR/Dialect/Transforms/CIRABIClassifier.cpp clang/lib/CIR/Dialect/Transforms/TargetLowering/CIRABIRewriteContext.cpp Removed: ################################################################################ diff --git a/clang/lib/CIR/Dialect/Transforms/CIRABIClassifier.cpp b/clang/lib/CIR/Dialect/Transforms/CIRABIClassifier.cpp index 82f4788e6077c..b0f9b980aa87a 100644 --- a/clang/lib/CIR/Dialect/Transforms/CIRABIClassifier.cpp +++ b/clang/lib/CIR/Dialect/Transforms/CIRABIClassifier.cpp @@ -582,10 +582,12 @@ convertDirectArgInfo(const llvm::abi::ArgInfo &info, MLIRContext *ctx, const llvm::abi::Type *coercedAbiTy = info.getCoerceToType(); if (!coercedAbiTy) { - // A struct the classifier allows to be flattened is coerced to its own - // type, so that its fields are passed as separate arguments. + // A record the classifier allows to be flattened is coerced to its own + // type, so that its fields are passed as separate arguments. A union is + // flattened as its LLVM type, the storage member and the tail padding. auto recTy = dyn_cast<cir::RecordType>(origTy); - if (recTy && recTy.isStruct() && info.getCanBeFlattened()) + if (recTy && (recTy.isStruct() || recTy.isUnion()) && + info.getCanBeFlattened()) return passCoerced(recTy, /*offset=*/0); // A _Complex is flattened the same way, as its {real, imag} pair. if (auto complexTy = dyn_cast<cir::ComplexType>(origTy); @@ -780,9 +782,11 @@ CIRABIClassifierCommon::classifySignature( return mlir::failure(); } // The classifier passes a transparent union as its first member, and - // names no coerce type when it passes that member as its own type. + // names no coerce type when it passes that member as its own type. The + // union is then left unchanged or coerced to itself above. auto recTy = dyn_cast<cir::RecordType>(origArg); - if (ac->kind == ArgKind::Direct && !ac->coercedType && recTy && + if (ac->kind == ArgKind::Direct && recTy && + (!ac->coercedType || ac->coercedType == recTy) && recordIsTransparentUnion(modOp, recTy)) ac->coercedType = recTy.getMembers().front(); ac->neededIntRegs = argInfo.getNeededIntRegs(); diff --git a/clang/lib/CIR/Dialect/Transforms/TargetLowering/CIRABIRewriteContext.cpp b/clang/lib/CIR/Dialect/Transforms/TargetLowering/CIRABIRewriteContext.cpp index c31da3709b408..ed36a6180dd67 100644 --- a/clang/lib/CIR/Dialect/Transforms/TargetLowering/CIRABIRewriteContext.cpp +++ b/clang/lib/CIR/Dialect/Transforms/TargetLowering/CIRABIRewriteContext.cpp @@ -85,6 +85,20 @@ cir::PointerType getIndirectPtrTy(mlir::Type pointee, return getPtrTyInAddrSpace(pointee, ac.indirectAddrSpace); } +/// The struct a union is flattened as: its storage member, then its tail +/// padding if it has any. This matches the union's LLVM type. +cir::StructType getUnionFlattenType(cir::UnionType unionTy, + const mlir::DataLayout &dl) { + SmallVector<mlir::Type, 2> fields; + if (mlir::Type storage = unionTy.getUnionStorageType(dl)) + fields.push_back(storage); + if (mlir::Type padding = unionTy.getPadding()) + fields.push_back(padding); + return cir::StructType::get(unionTy.getContext(), fields, unionTy.getPacked(), + /*is_class=*/false, + cir::RecordType::getAllDataKinds(fields)); +} + /// Return the coerced RecordType for a Direct classification that should be /// flattened into individual scalar arguments, or a null type if the /// classification does not call for flattening. @@ -92,13 +106,17 @@ cir::PointerType getIndirectPtrTy(mlir::Type pointee, /// Flattening applies when all four conditions hold: /// 1. The classification is Direct with a non-null coercedType. /// 2. canFlatten is set. -/// 3. The coercedType is a struct (not a union). +/// 3. The coercedType is a struct, or a union, which is flattened as the +/// struct getUnionFlattenType returns. /// 4. The struct has at least one field. A struct of one field is passed as /// that field. -cir::RecordType getFlattenedCoercedType(const ArgClassification &ac) { +cir::RecordType getFlattenedCoercedType(const ArgClassification &ac, + const mlir::DataLayout &dl) { if (ac.kind != ArgKind::Direct || !ac.coercedType || !ac.canFlatten) return {}; auto recTy = dyn_cast<cir::RecordType>(ac.coercedType); + if (auto unionTy = dyn_cast_if_present<cir::UnionType>(recTy)) + recTy = getUnionFlattenType(unionTy, dl); if (!recTy || !recTy.isStruct() || recTy.getMembers().empty()) return {}; return recTy; @@ -120,11 +138,10 @@ bool isRecordExtend(const ArgClassification &ac, mlir::Type origTy) { /// (struct flattening) arguments. /// The sret return pointer, when present, is prepended by /// rewriteFunctionDefinition rather than here. -mlir::LogicalResult -buildNewArgTypes(ArrayRef<mlir::Type> oldArgTypes, - const FunctionClassification &fc, - SmallVectorImpl<mlir::Type> &newArgTypes, - function_ref<mlir::InFlightDiagnostic()> emitError) { +mlir::LogicalResult buildNewArgTypes( + ArrayRef<mlir::Type> oldArgTypes, const FunctionClassification &fc, + SmallVectorImpl<mlir::Type> &newArgTypes, const mlir::DataLayout &dl, + function_ref<mlir::InFlightDiagnostic()> emitError) { assert(newArgTypes.empty() && "expected an empty output vector"); newArgTypes.reserve(oldArgTypes.size()); for (auto [idx, ac] : llvm::enumerate(fc.argInfos)) { @@ -133,7 +150,7 @@ buildNewArgTypes(ArrayRef<mlir::Type> oldArgTypes, case ArgKind::Direct: // Direct with canFlatten and a struct coerced type: push one wire type // per field of the coerced struct rather than the struct itself. - if (cir::RecordType flatTy = getFlattenedCoercedType(ac)) { + if (cir::RecordType flatTy = getFlattenedCoercedType(ac, dl)) { llvm::append_range(newArgTypes, flatTy.getMembers()); } else { // Direct with a coerced type: the lowered signature uses the coerced @@ -289,7 +306,7 @@ mlir::ArrayAttr updateArgAttrs(mlir::MLIRContext *ctx, mlir::ModuleOp module, builder.getI64IntegerAttr(ac.directAlign->value())); existing = attrs.getDictionary(ctx); } - if (cir::RecordType flatTy = getFlattenedCoercedType(ac)) { + if (cir::RecordType flatTy = getFlattenedCoercedType(ac, dl)) { // Direct + canFlatten: as in classic CodeGen, each flattened field // carries the attributes of the argument it came from. newArgAttrs.append(flatTy.getNumElements(), existing); @@ -1248,7 +1265,7 @@ insertArgCoercion(mlir::FunctionOpInterface funcOp, mlir::BlockArgument blockArg = entry.getArgument(blockArgIdx); - if (cir::RecordType flatTy = getFlattenedCoercedType(ac)) { + if (cir::RecordType flatTy = getFlattenedCoercedType(ac, dl)) { // Direct + canFlatten: the coerced type is a struct whose fields are // passed as separate arguments. As in the Expand path, the single block // arg becomes N scalar block args, and each is stored straight into a @@ -1292,6 +1309,11 @@ insertArgCoercion(mlir::FunctionOpInterface funcOp, flattenOps.insert(fieldPtr); auto storeOp = cir::StoreOp::create( builder, loc, entry.getArgument(blockArgIdx + f), fieldPtr); + // A packed slot can be less aligned than the field's own type. + uint64_t fieldAlign = + llvm::MinAlign(slot.getAlignment(), flatTy.getElementOffset(dl, f)); + if (fieldAlign < dl.getTypeABIAlignment(fieldTy)) + storeOp.setAlignment(fieldAlign); flattenOps.insert(storeOp); } @@ -1945,7 +1967,7 @@ mlir::LogicalResult CIRABIRewriteContext::rewriteFunctionDefinition( "CIR functions return zero or one value"); SmallVector<mlir::Type> newArgTypes; - if (mlir::failed(buildNewArgTypes(oldArgTypes, fc, newArgTypes, + if (mlir::failed(buildNewArgTypes(oldArgTypes, fc, newArgTypes, dl, [&]() { return funcOp.emitOpError(); }))) return mlir::failure(); @@ -2026,7 +2048,7 @@ mlir::LogicalResult CIRABIRewriteContext::rewriteFunctionDefinition( entry.eraseArgument(blockArgIdx); continue; } - if (cir::RecordType flatTy = getFlattenedCoercedType(ac)) + if (cir::RecordType flatTy = getFlattenedCoercedType(ac, dl)) blockArgIdx += flatTy.getNumElements(); else if (ac.kind == ArgKind::Expand) blockArgIdx += cast<cir::RecordType>(oldArgTypes[i]).getNumElements(); @@ -2167,7 +2189,7 @@ CIRABIRewriteContext::rewriteCallSite(mlir::Operation *callOp, if (ac.kind == ArgKind::Ignore) continue; mlir::Value arg = argOperands[idx]; - if (cir::RecordType flatTy = getFlattenedCoercedType(ac)) { + if (cir::RecordType flatTy = getFlattenedCoercedType(ac, dl)) { // Direct + canFlatten: pass one scalar call argument per field of the // ABI-coerced struct. A non-atomic record load is read in place or // through a copy of its storage, as emitCoercedRecordLoad decides, and diff --git a/clang/test/CIR/Transforms/abi-lowering/amdgpu-union.cir b/clang/test/CIR/Transforms/abi-lowering/amdgpu-union.cir new file mode 100644 index 0000000000000..70d2495a39afe --- /dev/null +++ b/clang/test/CIR/Transforms/abi-lowering/amdgpu-union.cir @@ -0,0 +1,286 @@ +// RUN: cir-opt %s -cir-call-conv-lowering=target=amdgpu | FileCheck %s + +// A union wider than 64 bits is passed Direct with no coerce type. The +// argument is passed as the union's LLVM type, its storage member and then its +// tail padding. A return is not flattened and stays the union. + +!s8i = !cir.int<s, 8> +!s32i = !cir.int<s, 32> +!s64i = !cir.int<s, 64> +!u8i = !cir.int<u, 8> +!rec_u_pad_t = !cir.union<"u_pad_t" {data !cir.array<!s32i x 3>, data !cir.double}, padding = {!cir.array<!u8i x 8>}> +!rec_u_one_t = !cir.union<"u_one_t" {data !cir.float}> +!rec_u_dl_t = !cir.union<"u_dl_t" {data !cir.array<!cir.double x 2>, data !cir.array<!s64i x 2>}> +!rec_u_packed_t = !cir.union<"u_packed_t" packed {data !cir.array<!s8i x 13>, data !cir.double}, padding = {!cir.array<!u8i x 5>}> +!rec_inner = !cir.struct<"inner" {data !cir.double, data !s32i}> +!rec_u_nest_t = !cir.union<"u_nest_t" {data !rec_inner, data !cir.array<!s8i x 24>}, padding = {!cir.array<!u8i x 8>}> + +// CHECK-DAG: ![[DL_FLAT:rec_anon_struct[0-9]*]] = !cir.struct<{data !cir.array<!cir.double x 2>}> +// CHECK-DAG: ![[FLAT:rec_anon_struct[0-9]*]] = !cir.struct<{data !cir.double, data !cir.array<!u8i x 8>}> +// CHECK-DAG: ![[PACKED_FLAT:rec_anon_struct[0-9]*]] = !cir.struct<packed {data !cir.double, data !cir.array<!u8i x 5>}> +// CHECK-DAG: ![[NEST_FLAT:rec_anon_struct[0-9]*]] = !cir.struct<{data !rec_inner, data !cir.array<!u8i x 8>}> + +module attributes { + dlti.dl_spec = #dlti.dl_spec< + #dlti.dl_entry<i32, dense<32>: vector<2xi64>>, + #dlti.dl_entry<i64, dense<64>: vector<2xi64>>, + #dlti.dl_entry<f64, dense<64>: vector<2xi64>>, + #dlti.dl_entry<"dlti.alloca_memory_space", 5 : ui64>> +} { + + // The double storage member and the 8 padding bytes are passed separately. + cir.func @arg_u_pad(%arg0: !rec_u_pad_t) requires_call_conv_lowering { + %0 = cir.alloca "u" align(8) init : !cir.ptr<!rec_u_pad_t, target_address_space(5)> + %1 = cir.cast address_space %0 : !cir.ptr<!rec_u_pad_t, target_address_space(5)> -> !cir.ptr<!rec_u_pad_t> + cir.store %arg0, %1 : !rec_u_pad_t, !cir.ptr<!rec_u_pad_t> + cir.return + } + + // CHECK: cir.func @arg_u_pad(%[[STORAGE:[^:]+]]: !cir.double, %[[PAD:[^:]+]]: !cir.array<!u8i x 8>) { + // CHECK-NEXT: %[[COERCE:.*]] = cir.alloca "coerce" align(8) : !cir.ptr<![[FLAT]], target_address_space(5)> + // CHECK-NEXT: %[[F0:.*]] = cir.get_member %[[COERCE]][0] {name = ""} : !cir.ptr<![[FLAT]], target_address_space(5)> -> !cir.ptr<!cir.double, target_address_space(5)> + // CHECK-NEXT: cir.store %[[STORAGE]], %[[F0]] : !cir.double, !cir.ptr<!cir.double, target_address_space(5)> + // CHECK-NEXT: %[[F1:.*]] = cir.get_member %[[COERCE]][1] {name = ""} : !cir.ptr<![[FLAT]], target_address_space(5)> -> !cir.ptr<!cir.array<!u8i x 8>, target_address_space(5)> + // CHECK-NEXT: cir.store %[[PAD]], %[[F1]] : !cir.array<!u8i x 8>, !cir.ptr<!cir.array<!u8i x 8>, target_address_space(5)> + // CHECK-NEXT: %[[AS_UNION:.*]] = cir.cast bitcast %[[COERCE]] : !cir.ptr<![[FLAT]], target_address_space(5)> -> !cir.ptr<!rec_u_pad_t, target_address_space(5)> + // CHECK-NEXT: %[[U:.*]] = cir.alloca "u" align(8) init : !cir.ptr<!rec_u_pad_t, target_address_space(5)> + // CHECK-NEXT: %[[U_CAST:.*]] = cir.cast address_space %[[U]] : !cir.ptr<!rec_u_pad_t, target_address_space(5)> -> !cir.ptr<!rec_u_pad_t> + // CHECK-NEXT: cir.copy %[[AS_UNION]] align(8) to %[[U_CAST]] align(8) : !cir.ptr<!rec_u_pad_t, target_address_space(5)>, !cir.ptr<!rec_u_pad_t> + // CHECK-NEXT: cir.return + + // The caller passes the storage member and the padding bytes. + cir.func @call_u_pad(%arg0: !rec_u_pad_t) requires_call_conv_lowering { + %0 = cir.alloca "u" align(8) init : !cir.ptr<!rec_u_pad_t, target_address_space(5)> + %1 = cir.cast address_space %0 : !cir.ptr<!rec_u_pad_t, target_address_space(5)> -> !cir.ptr<!rec_u_pad_t> + cir.store %arg0, %1 : !rec_u_pad_t, !cir.ptr<!rec_u_pad_t> + %2 = cir.load align(8) %1 : !cir.ptr<!rec_u_pad_t>, !rec_u_pad_t + cir.call @arg_u_pad(%2) : (!rec_u_pad_t) -> () + cir.return + } + + // CHECK: cir.func @call_u_pad(%[[STORAGE:[^:]+]]: !cir.double, %[[PAD:[^:]+]]: !cir.array<!u8i x 8>) { + // CHECK-NEXT: %[[COERCE:.*]] = cir.alloca "coerce" align(8) : !cir.ptr<![[FLAT]], target_address_space(5)> + // CHECK-NEXT: %[[F0:.*]] = cir.get_member %[[COERCE]][0] {name = ""} : !cir.ptr<![[FLAT]], target_address_space(5)> -> !cir.ptr<!cir.double, target_address_space(5)> + // CHECK-NEXT: cir.store %[[STORAGE]], %[[F0]] : !cir.double, !cir.ptr<!cir.double, target_address_space(5)> + // CHECK-NEXT: %[[F1:.*]] = cir.get_member %[[COERCE]][1] {name = ""} : !cir.ptr<![[FLAT]], target_address_space(5)> -> !cir.ptr<!cir.array<!u8i x 8>, target_address_space(5)> + // CHECK-NEXT: cir.store %[[PAD]], %[[F1]] : !cir.array<!u8i x 8>, !cir.ptr<!cir.array<!u8i x 8>, target_address_space(5)> + // CHECK-NEXT: %[[AS_UNION:.*]] = cir.cast bitcast %[[COERCE]] : !cir.ptr<![[FLAT]], target_address_space(5)> -> !cir.ptr<!rec_u_pad_t, target_address_space(5)> + // CHECK-NEXT: %[[U:.*]] = cir.alloca "u" align(8) init : !cir.ptr<!rec_u_pad_t, target_address_space(5)> + // CHECK-NEXT: %[[U_CAST:.*]] = cir.cast address_space %[[U]] : !cir.ptr<!rec_u_pad_t, target_address_space(5)> -> !cir.ptr<!rec_u_pad_t> + // CHECK-NEXT: cir.copy %[[AS_UNION]] align(8) to %[[U_CAST]] align(8) : !cir.ptr<!rec_u_pad_t, target_address_space(5)>, !cir.ptr<!rec_u_pad_t> + // CHECK-NEXT: %[[U_FLAT:.*]] = cir.cast bitcast %[[U_CAST]] : !cir.ptr<!rec_u_pad_t> -> !cir.ptr<![[FLAT]]> + // CHECK-NEXT: %[[U_F0:.*]] = cir.get_member %[[U_FLAT]][0] {name = ""} : !cir.ptr<![[FLAT]]> -> !cir.ptr<!cir.double> + // CHECK-NEXT: %[[ARG_STORAGE:.*]] = cir.load align(8) %[[U_F0]] : !cir.ptr<!cir.double>, !cir.double + // CHECK-NEXT: %[[U_F1:.*]] = cir.get_member %[[U_FLAT]][1] {name = ""} : !cir.ptr<![[FLAT]]> -> !cir.ptr<!cir.array<!u8i x 8>> + // CHECK-NEXT: %[[ARG_PAD:.*]] = cir.load align(8) %[[U_F1]] : !cir.ptr<!cir.array<!u8i x 8>>, !cir.array<!u8i x 8> + // CHECK-NEXT: cir.call @arg_u_pad(%[[ARG_STORAGE]], %[[ARG_PAD]]) : (!cir.double, !cir.array<!u8i x 8>) -> () + // CHECK-NEXT: cir.return + + // The argument is flattened, but the return stays the union. + cir.func @ret_u_pad(%arg0: !rec_u_pad_t) -> !rec_u_pad_t requires_call_conv_lowering { + %0 = cir.alloca "__retval" align(8) : !cir.ptr<!rec_u_pad_t, target_address_space(5)> + %1 = cir.alloca "u" align(8) init : !cir.ptr<!rec_u_pad_t, target_address_space(5)> + %2 = cir.cast address_space %1 : !cir.ptr<!rec_u_pad_t, target_address_space(5)> -> !cir.ptr<!rec_u_pad_t> + %3 = cir.cast address_space %0 : !cir.ptr<!rec_u_pad_t, target_address_space(5)> -> !cir.ptr<!rec_u_pad_t> + cir.store %arg0, %2 : !rec_u_pad_t, !cir.ptr<!rec_u_pad_t> + cir.copy %2 align(8) to %3 align(8) : !cir.ptr<!rec_u_pad_t> + %4 = cir.load %0 : !cir.ptr<!rec_u_pad_t, target_address_space(5)>, !rec_u_pad_t + cir.return %4 : !rec_u_pad_t + } + + // CHECK: cir.func @ret_u_pad(%[[STORAGE:[^:]+]]: !cir.double, %[[PAD:[^:]+]]: !cir.array<!u8i x 8>) -> !rec_u_pad_t { + // CHECK-NEXT: %[[COERCE:.*]] = cir.alloca "coerce" align(8) : !cir.ptr<![[FLAT]], target_address_space(5)> + // CHECK-NEXT: %[[F0:.*]] = cir.get_member %[[COERCE]][0] {name = ""} : !cir.ptr<![[FLAT]], target_address_space(5)> -> !cir.ptr<!cir.double, target_address_space(5)> + // CHECK-NEXT: cir.store %[[STORAGE]], %[[F0]] : !cir.double, !cir.ptr<!cir.double, target_address_space(5)> + // CHECK-NEXT: %[[F1:.*]] = cir.get_member %[[COERCE]][1] {name = ""} : !cir.ptr<![[FLAT]], target_address_space(5)> -> !cir.ptr<!cir.array<!u8i x 8>, target_address_space(5)> + // CHECK-NEXT: cir.store %[[PAD]], %[[F1]] : !cir.array<!u8i x 8>, !cir.ptr<!cir.array<!u8i x 8>, target_address_space(5)> + // CHECK-NEXT: %[[AS_UNION:.*]] = cir.cast bitcast %[[COERCE]] : !cir.ptr<![[FLAT]], target_address_space(5)> -> !cir.ptr<!rec_u_pad_t, target_address_space(5)> + // CHECK-NEXT: %[[RETVAL:.*]] = cir.alloca "__retval" align(8) : !cir.ptr<!rec_u_pad_t, target_address_space(5)> + // CHECK-NEXT: %[[U:.*]] = cir.alloca "u" align(8) init : !cir.ptr<!rec_u_pad_t, target_address_space(5)> + // CHECK-NEXT: %[[U_CAST:.*]] = cir.cast address_space %[[U]] : !cir.ptr<!rec_u_pad_t, target_address_space(5)> -> !cir.ptr<!rec_u_pad_t> + // CHECK-NEXT: %[[RETVAL_CAST:.*]] = cir.cast address_space %[[RETVAL]] : !cir.ptr<!rec_u_pad_t, target_address_space(5)> -> !cir.ptr<!rec_u_pad_t> + // CHECK-NEXT: cir.copy %[[AS_UNION]] align(8) to %[[U_CAST]] align(8) : !cir.ptr<!rec_u_pad_t, target_address_space(5)>, !cir.ptr<!rec_u_pad_t> + // CHECK-NEXT: cir.copy %[[U_CAST]] align(8) to %[[RETVAL_CAST]] align(8) : !cir.ptr<!rec_u_pad_t> + // CHECK-NEXT: %[[RET:.*]] = cir.load %[[RETVAL]] : !cir.ptr<!rec_u_pad_t, target_address_space(5)>, !rec_u_pad_t + // CHECK-NEXT: cir.return %[[RET]] : !rec_u_pad_t + + // A union of one member is passed as that member. + cir.func @arg_u_one(%arg0: !rec_u_one_t) requires_call_conv_lowering { + %0 = cir.alloca "u" align(4) init : !cir.ptr<!rec_u_one_t, target_address_space(5)> + %1 = cir.cast address_space %0 : !cir.ptr<!rec_u_one_t, target_address_space(5)> -> !cir.ptr<!rec_u_one_t> + cir.store %arg0, %1 : !rec_u_one_t, !cir.ptr<!rec_u_one_t> + cir.return + } + + // CHECK: cir.func @arg_u_one(%[[ARG:.*]]: !cir.float) { + // CHECK-NEXT: %[[COERCE:.*]] = cir.alloca "coerce" align(4) : !cir.ptr<!cir.float, target_address_space(5)> + // CHECK-NEXT: cir.store %[[ARG]], %[[COERCE]] : !cir.float, !cir.ptr<!cir.float, target_address_space(5)> + // CHECK-NEXT: %[[AS_UNION:.*]] = cir.cast bitcast %[[COERCE]] : !cir.ptr<!cir.float, target_address_space(5)> -> !cir.ptr<!rec_u_one_t, target_address_space(5)> + // CHECK-NEXT: %[[U:.*]] = cir.alloca "u" align(4) init : !cir.ptr<!rec_u_one_t, target_address_space(5)> + // CHECK-NEXT: %[[U_CAST:.*]] = cir.cast address_space %[[U]] : !cir.ptr<!rec_u_one_t, target_address_space(5)> -> !cir.ptr<!rec_u_one_t> + // CHECK-NEXT: cir.copy %[[AS_UNION]] align(4) to %[[U_CAST]] align(4) : !cir.ptr<!rec_u_one_t, target_address_space(5)>, !cir.ptr<!rec_u_one_t> + // CHECK-NEXT: cir.return + + // The members tie, so the first is the storage member. With no padding the + // union is passed as that one member. + cir.func @arg_u_dl(%arg0: !rec_u_dl_t) requires_call_conv_lowering { + %0 = cir.alloca "u" align(8) init : !cir.ptr<!rec_u_dl_t, target_address_space(5)> + %1 = cir.cast address_space %0 : !cir.ptr<!rec_u_dl_t, target_address_space(5)> -> !cir.ptr<!rec_u_dl_t> + cir.store %arg0, %1 : !rec_u_dl_t, !cir.ptr<!rec_u_dl_t> + cir.return + } + + // CHECK: cir.func @arg_u_dl(%[[ARR:[^:]+]]: !cir.array<!cir.double x 2>) { + // CHECK-NEXT: %[[COERCE:.*]] = cir.alloca "coerce" align(8) : !cir.ptr<![[DL_FLAT]], target_address_space(5)> + // CHECK-NEXT: %[[F0:.*]] = cir.get_member %[[COERCE]][0] {name = ""} : !cir.ptr<![[DL_FLAT]], target_address_space(5)> -> !cir.ptr<!cir.array<!cir.double x 2>, target_address_space(5)> + // CHECK-NEXT: cir.store %[[ARR]], %[[F0]] : !cir.array<!cir.double x 2>, !cir.ptr<!cir.array<!cir.double x 2>, target_address_space(5)> + // CHECK-NEXT: %[[AS_UNION:.*]] = cir.cast bitcast %[[COERCE]] : !cir.ptr<![[DL_FLAT]], target_address_space(5)> -> !cir.ptr<!rec_u_dl_t, target_address_space(5)> + // CHECK-NEXT: %[[U:.*]] = cir.alloca "u" align(8) init : !cir.ptr<!rec_u_dl_t, target_address_space(5)> + // CHECK-NEXT: %[[U_CAST:.*]] = cir.cast address_space %[[U]] : !cir.ptr<!rec_u_dl_t, target_address_space(5)> -> !cir.ptr<!rec_u_dl_t> + // CHECK-NEXT: cir.copy %[[AS_UNION]] align(8) to %[[U_CAST]] align(8) : !cir.ptr<!rec_u_dl_t, target_address_space(5)>, !cir.ptr<!rec_u_dl_t> + // CHECK-NEXT: cir.return + + // A packed union is passed as its double and 5 padding bytes, stored at align 1. + cir.func @arg_u_packed(%arg0: !rec_u_packed_t) requires_call_conv_lowering { + %0 = cir.alloca "u" align(1) init : !cir.ptr<!rec_u_packed_t, target_address_space(5)> + %1 = cir.cast address_space %0 : !cir.ptr<!rec_u_packed_t, target_address_space(5)> -> !cir.ptr<!rec_u_packed_t> + cir.store %arg0, %1 : !rec_u_packed_t, !cir.ptr<!rec_u_packed_t> + cir.return + } + + // CHECK: cir.func @arg_u_packed(%[[STORAGE:[^:]+]]: !cir.double, %[[PAD:[^:]+]]: !cir.array<!u8i x 5>) { + // CHECK-NEXT: %[[COERCE:.*]] = cir.alloca "coerce" align(1) : !cir.ptr<![[PACKED_FLAT]], target_address_space(5)> + // CHECK-NEXT: %[[F0:.*]] = cir.get_member %[[COERCE]][0] {name = ""} : !cir.ptr<![[PACKED_FLAT]], target_address_space(5)> -> !cir.ptr<!cir.double, target_address_space(5)> + // CHECK-NEXT: cir.store align(1) %[[STORAGE]], %[[F0]] : !cir.double, !cir.ptr<!cir.double, target_address_space(5)> + // CHECK-NEXT: %[[F1:.*]] = cir.get_member %[[COERCE]][1] {name = ""} : !cir.ptr<![[PACKED_FLAT]], target_address_space(5)> -> !cir.ptr<!cir.array<!u8i x 5>, target_address_space(5)> + // CHECK-NEXT: cir.store %[[PAD]], %[[F1]] : !cir.array<!u8i x 5>, !cir.ptr<!cir.array<!u8i x 5>, target_address_space(5)> + // CHECK-NEXT: %[[AS_UNION:.*]] = cir.cast bitcast %[[COERCE]] : !cir.ptr<![[PACKED_FLAT]], target_address_space(5)> -> !cir.ptr<!rec_u_packed_t, target_address_space(5)> + // CHECK-NEXT: %[[U:.*]] = cir.alloca "u" align(1) init : !cir.ptr<!rec_u_packed_t, target_address_space(5)> + // CHECK-NEXT: %[[U_CAST:.*]] = cir.cast address_space %[[U]] : !cir.ptr<!rec_u_packed_t, target_address_space(5)> -> !cir.ptr<!rec_u_packed_t> + // CHECK-NEXT: cir.copy %[[AS_UNION]] align(1) to %[[U_CAST]] align(1) : !cir.ptr<!rec_u_packed_t, target_address_space(5)>, !cir.ptr<!rec_u_packed_t> + // CHECK-NEXT: cir.return + + // The caller reads both pieces of the packed union at align 1. + cir.func @call_u_packed(%arg0: !rec_u_packed_t) requires_call_conv_lowering { + %0 = cir.alloca "u" align(1) init : !cir.ptr<!rec_u_packed_t, target_address_space(5)> + %1 = cir.cast address_space %0 : !cir.ptr<!rec_u_packed_t, target_address_space(5)> -> !cir.ptr<!rec_u_packed_t> + cir.store %arg0, %1 : !rec_u_packed_t, !cir.ptr<!rec_u_packed_t> + %2 = cir.load align(1) %1 : !cir.ptr<!rec_u_packed_t>, !rec_u_packed_t + cir.call @arg_u_packed(%2) : (!rec_u_packed_t) -> () + cir.return + } + + // CHECK: cir.func @call_u_packed(%[[STORAGE:[^:]+]]: !cir.double, %[[PAD:[^:]+]]: !cir.array<!u8i x 5>) { + // CHECK-NEXT: %[[COERCE:.*]] = cir.alloca "coerce" align(1) : !cir.ptr<![[PACKED_FLAT]], target_address_space(5)> + // CHECK-NEXT: %[[F0:.*]] = cir.get_member %[[COERCE]][0] {name = ""} : !cir.ptr<![[PACKED_FLAT]], target_address_space(5)> -> !cir.ptr<!cir.double, target_address_space(5)> + // CHECK-NEXT: cir.store align(1) %[[STORAGE]], %[[F0]] : !cir.double, !cir.ptr<!cir.double, target_address_space(5)> + // CHECK-NEXT: %[[F1:.*]] = cir.get_member %[[COERCE]][1] {name = ""} : !cir.ptr<![[PACKED_FLAT]], target_address_space(5)> -> !cir.ptr<!cir.array<!u8i x 5>, target_address_space(5)> + // CHECK-NEXT: cir.store %[[PAD]], %[[F1]] : !cir.array<!u8i x 5>, !cir.ptr<!cir.array<!u8i x 5>, target_address_space(5)> + // CHECK-NEXT: %[[AS_UNION:.*]] = cir.cast bitcast %[[COERCE]] : !cir.ptr<![[PACKED_FLAT]], target_address_space(5)> -> !cir.ptr<!rec_u_packed_t, target_address_space(5)> + // CHECK-NEXT: %[[U:.*]] = cir.alloca "u" align(1) init : !cir.ptr<!rec_u_packed_t, target_address_space(5)> + // CHECK-NEXT: %[[U_CAST:.*]] = cir.cast address_space %[[U]] : !cir.ptr<!rec_u_packed_t, target_address_space(5)> -> !cir.ptr<!rec_u_packed_t> + // CHECK-NEXT: cir.copy %[[AS_UNION]] align(1) to %[[U_CAST]] align(1) : !cir.ptr<!rec_u_packed_t, target_address_space(5)>, !cir.ptr<!rec_u_packed_t> + // CHECK-NEXT: %[[U_FLAT:.*]] = cir.cast bitcast %[[U_CAST]] : !cir.ptr<!rec_u_packed_t> -> !cir.ptr<![[PACKED_FLAT]]> + // CHECK-NEXT: %[[U_F0:.*]] = cir.get_member %[[U_FLAT]][0] {name = ""} : !cir.ptr<![[PACKED_FLAT]]> -> !cir.ptr<!cir.double> + // CHECK-NEXT: %[[ARG_STORAGE:.*]] = cir.load align(1) %[[U_F0]] : !cir.ptr<!cir.double>, !cir.double + // CHECK-NEXT: %[[U_F1:.*]] = cir.get_member %[[U_FLAT]][1] {name = ""} : !cir.ptr<![[PACKED_FLAT]]> -> !cir.ptr<!cir.array<!u8i x 5>> + // CHECK-NEXT: %[[ARG_PAD:.*]] = cir.load align(1) %[[U_F1]] : !cir.ptr<!cir.array<!u8i x 5>>, !cir.array<!u8i x 5> + // CHECK-NEXT: cir.call @arg_u_packed(%[[ARG_STORAGE]], %[[ARG_PAD]]) : (!cir.double, !cir.array<!u8i x 5>) -> () + // CHECK-NEXT: cir.return + + // The storage member is a struct, passed whole, then the 8 padding bytes. + cir.func @arg_u_nest(%arg0: !rec_u_nest_t) requires_call_conv_lowering { + %0 = cir.alloca "u" align(8) init : !cir.ptr<!rec_u_nest_t, target_address_space(5)> + %1 = cir.cast address_space %0 : !cir.ptr<!rec_u_nest_t, target_address_space(5)> -> !cir.ptr<!rec_u_nest_t> + cir.store %arg0, %1 : !rec_u_nest_t, !cir.ptr<!rec_u_nest_t> + cir.return + } + + // CHECK: cir.func @arg_u_nest(%[[INNER:[^:]+]]: !rec_inner, %[[PAD:[^:]+]]: !cir.array<!u8i x 8>) { + // CHECK-NEXT: %[[COERCE:.*]] = cir.alloca "coerce" align(8) : !cir.ptr<![[NEST_FLAT]], target_address_space(5)> + // CHECK-NEXT: %[[F0:.*]] = cir.get_member %[[COERCE]][0] {name = ""} : !cir.ptr<![[NEST_FLAT]], target_address_space(5)> -> !cir.ptr<!rec_inner, target_address_space(5)> + // CHECK-NEXT: cir.store %[[INNER]], %[[F0]] : !rec_inner, !cir.ptr<!rec_inner, target_address_space(5)> + // CHECK-NEXT: %[[F1:.*]] = cir.get_member %[[COERCE]][1] {name = ""} : !cir.ptr<![[NEST_FLAT]], target_address_space(5)> -> !cir.ptr<!cir.array<!u8i x 8>, target_address_space(5)> + // CHECK-NEXT: cir.store %[[PAD]], %[[F1]] : !cir.array<!u8i x 8>, !cir.ptr<!cir.array<!u8i x 8>, target_address_space(5)> + // CHECK-NEXT: %[[AS_UNION:.*]] = cir.cast bitcast %[[COERCE]] : !cir.ptr<![[NEST_FLAT]], target_address_space(5)> -> !cir.ptr<!rec_u_nest_t, target_address_space(5)> + // CHECK-NEXT: %[[U:.*]] = cir.alloca "u" align(8) init : !cir.ptr<!rec_u_nest_t, target_address_space(5)> + // CHECK-NEXT: %[[U_CAST:.*]] = cir.cast address_space %[[U]] : !cir.ptr<!rec_u_nest_t, target_address_space(5)> -> !cir.ptr<!rec_u_nest_t> + // CHECK-NEXT: cir.copy %[[AS_UNION]] align(8) to %[[U_CAST]] align(8) : !cir.ptr<!rec_u_nest_t, target_address_space(5)>, !cir.ptr<!rec_u_nest_t> + // CHECK-NEXT: cir.return + + // Each union becomes two arguments, so x and b move to later positions. + cir.func @two(%arg0: !rec_u_pad_t, %arg1: !s32i, %arg2: !rec_u_pad_t) requires_call_conv_lowering { + %0 = cir.alloca "a" align(8) init : !cir.ptr<!rec_u_pad_t, target_address_space(5)> + %1 = cir.alloca "x" align(4) init : !cir.ptr<!s32i, target_address_space(5)> + %2 = cir.alloca "b" align(8) init : !cir.ptr<!rec_u_pad_t, target_address_space(5)> + cir.store %arg0, %0 : !rec_u_pad_t, !cir.ptr<!rec_u_pad_t, target_address_space(5)> + cir.store %arg1, %1 : !s32i, !cir.ptr<!s32i, target_address_space(5)> + cir.store %arg2, %2 : !rec_u_pad_t, !cir.ptr<!rec_u_pad_t, target_address_space(5)> + cir.return + } + + // CHECK: cir.func @two(%[[A_STORAGE:[^:]+]]: !cir.double, %[[A_PAD:[^:]+]]: !cir.array<!u8i x 8>, %[[X:[^:]+]]: !s32i, %[[B_STORAGE:[^:]+]]: !cir.double, %[[B_PAD:[^:]+]]: !cir.array<!u8i x 8>) { + // CHECK-NEXT: %[[B_COERCE:.*]] = cir.alloca "coerce" align(8) : !cir.ptr<![[FLAT]], target_address_space(5)> + // CHECK-NEXT: %[[B_F0:.*]] = cir.get_member %[[B_COERCE]][0] {name = ""} : !cir.ptr<![[FLAT]], target_address_space(5)> -> !cir.ptr<!cir.double, target_address_space(5)> + // CHECK-NEXT: cir.store %[[B_STORAGE]], %[[B_F0]] : !cir.double, !cir.ptr<!cir.double, target_address_space(5)> + // CHECK-NEXT: %[[B_F1:.*]] = cir.get_member %[[B_COERCE]][1] {name = ""} : !cir.ptr<![[FLAT]], target_address_space(5)> -> !cir.ptr<!cir.array<!u8i x 8>, target_address_space(5)> + // CHECK-NEXT: cir.store %[[B_PAD]], %[[B_F1]] : !cir.array<!u8i x 8>, !cir.ptr<!cir.array<!u8i x 8>, target_address_space(5)> + // CHECK-NEXT: %[[B_UNION:.*]] = cir.cast bitcast %[[B_COERCE]] : !cir.ptr<![[FLAT]], target_address_space(5)> -> !cir.ptr<!rec_u_pad_t, target_address_space(5)> + // CHECK-NEXT: %[[A_COERCE:.*]] = cir.alloca "coerce" align(8) : !cir.ptr<![[FLAT]], target_address_space(5)> + // CHECK-NEXT: %[[A_F0:.*]] = cir.get_member %[[A_COERCE]][0] {name = ""} : !cir.ptr<![[FLAT]], target_address_space(5)> -> !cir.ptr<!cir.double, target_address_space(5)> + // CHECK-NEXT: cir.store %[[A_STORAGE]], %[[A_F0]] : !cir.double, !cir.ptr<!cir.double, target_address_space(5)> + // CHECK-NEXT: %[[A_F1:.*]] = cir.get_member %[[A_COERCE]][1] {name = ""} : !cir.ptr<![[FLAT]], target_address_space(5)> -> !cir.ptr<!cir.array<!u8i x 8>, target_address_space(5)> + // CHECK-NEXT: cir.store %[[A_PAD]], %[[A_F1]] : !cir.array<!u8i x 8>, !cir.ptr<!cir.array<!u8i x 8>, target_address_space(5)> + // CHECK-NEXT: %[[A_UNION:.*]] = cir.cast bitcast %[[A_COERCE]] : !cir.ptr<![[FLAT]], target_address_space(5)> -> !cir.ptr<!rec_u_pad_t, target_address_space(5)> + // CHECK-NEXT: %[[A:.*]] = cir.alloca "a" align(8) init : !cir.ptr<!rec_u_pad_t, target_address_space(5)> + // CHECK-NEXT: %[[X_SLOT:.*]] = cir.alloca "x" align(4) init : !cir.ptr<!s32i, target_address_space(5)> + // CHECK-NEXT: %[[B:.*]] = cir.alloca "b" align(8) init : !cir.ptr<!rec_u_pad_t, target_address_space(5)> + // CHECK-NEXT: cir.copy %[[A_UNION]] align(8) to %[[A]] align(8) : !cir.ptr<!rec_u_pad_t, target_address_space(5)> + // CHECK-NEXT: cir.store %[[X]], %[[X_SLOT]] : !s32i, !cir.ptr<!s32i, target_address_space(5)> + // CHECK-NEXT: cir.copy %[[B_UNION]] align(8) to %[[B]] align(8) : !cir.ptr<!rec_u_pad_t, target_address_space(5)> + // CHECK-NEXT: cir.return + + // The caller passes a's pieces, then x, then b's pieces. + cir.func @call_two(%arg0: !rec_u_pad_t, %arg1: !rec_u_pad_t) requires_call_conv_lowering { + %0 = cir.alloca "a" align(8) init : !cir.ptr<!rec_u_pad_t, target_address_space(5)> + %1 = cir.alloca "b" align(8) init : !cir.ptr<!rec_u_pad_t, target_address_space(5)> + cir.store %arg0, %0 : !rec_u_pad_t, !cir.ptr<!rec_u_pad_t, target_address_space(5)> + cir.store %arg1, %1 : !rec_u_pad_t, !cir.ptr<!rec_u_pad_t, target_address_space(5)> + %2 = cir.load align(8) %0 : !cir.ptr<!rec_u_pad_t, target_address_space(5)>, !rec_u_pad_t + %3 = cir.const #cir.int<1> : !s32i + %4 = cir.load align(8) %1 : !cir.ptr<!rec_u_pad_t, target_address_space(5)>, !rec_u_pad_t + cir.call @two(%2, %3, %4) : (!rec_u_pad_t, !s32i, !rec_u_pad_t) -> () + cir.return + } + + // CHECK: cir.func @call_two(%[[A_STORAGE:[^:]+]]: !cir.double, %[[A_PAD:[^:]+]]: !cir.array<!u8i x 8>, %[[B_STORAGE:[^:]+]]: !cir.double, %[[B_PAD:[^:]+]]: !cir.array<!u8i x 8>) { + // CHECK-NEXT: %[[B_COERCE:.*]] = cir.alloca "coerce" align(8) : !cir.ptr<![[FLAT]], target_address_space(5)> + // CHECK-NEXT: %[[B_F0:.*]] = cir.get_member %[[B_COERCE]][0] {name = ""} : !cir.ptr<![[FLAT]], target_address_space(5)> -> !cir.ptr<!cir.double, target_address_space(5)> + // CHECK-NEXT: cir.store %[[B_STORAGE]], %[[B_F0]] : !cir.double, !cir.ptr<!cir.double, target_address_space(5)> + // CHECK-NEXT: %[[B_F1:.*]] = cir.get_member %[[B_COERCE]][1] {name = ""} : !cir.ptr<![[FLAT]], target_address_space(5)> -> !cir.ptr<!cir.array<!u8i x 8>, target_address_space(5)> + // CHECK-NEXT: cir.store %[[B_PAD]], %[[B_F1]] : !cir.array<!u8i x 8>, !cir.ptr<!cir.array<!u8i x 8>, target_address_space(5)> + // CHECK-NEXT: %[[B_UNION:.*]] = cir.cast bitcast %[[B_COERCE]] : !cir.ptr<![[FLAT]], target_address_space(5)> -> !cir.ptr<!rec_u_pad_t, target_address_space(5)> + // CHECK-NEXT: %[[A_COERCE:.*]] = cir.alloca "coerce" align(8) : !cir.ptr<![[FLAT]], target_address_space(5)> + // CHECK-NEXT: %[[A_F0:.*]] = cir.get_member %[[A_COERCE]][0] {name = ""} : !cir.ptr<![[FLAT]], target_address_space(5)> -> !cir.ptr<!cir.double, target_address_space(5)> + // CHECK-NEXT: cir.store %[[A_STORAGE]], %[[A_F0]] : !cir.double, !cir.ptr<!cir.double, target_address_space(5)> + // CHECK-NEXT: %[[A_F1:.*]] = cir.get_member %[[A_COERCE]][1] {name = ""} : !cir.ptr<![[FLAT]], target_address_space(5)> -> !cir.ptr<!cir.array<!u8i x 8>, target_address_space(5)> + // CHECK-NEXT: cir.store %[[A_PAD]], %[[A_F1]] : !cir.array<!u8i x 8>, !cir.ptr<!cir.array<!u8i x 8>, target_address_space(5)> + // CHECK-NEXT: %[[A_UNION:.*]] = cir.cast bitcast %[[A_COERCE]] : !cir.ptr<![[FLAT]], target_address_space(5)> -> !cir.ptr<!rec_u_pad_t, target_address_space(5)> + // CHECK-NEXT: %[[A:.*]] = cir.alloca "a" align(8) init : !cir.ptr<!rec_u_pad_t, target_address_space(5)> + // CHECK-NEXT: %[[B:.*]] = cir.alloca "b" align(8) init : !cir.ptr<!rec_u_pad_t, target_address_space(5)> + // CHECK-NEXT: cir.copy %[[A_UNION]] align(8) to %[[A]] align(8) : !cir.ptr<!rec_u_pad_t, target_address_space(5)> + // CHECK-NEXT: cir.copy %[[B_UNION]] align(8) to %[[B]] align(8) : !cir.ptr<!rec_u_pad_t, target_address_space(5)> + // CHECK-NEXT: %[[A_FLAT:.*]] = cir.cast bitcast %[[A]] : !cir.ptr<!rec_u_pad_t, target_address_space(5)> -> !cir.ptr<![[FLAT]], target_address_space(5)> + // CHECK-NEXT: %[[A_P0:.*]] = cir.get_member %[[A_FLAT]][0] {name = ""} : !cir.ptr<![[FLAT]], target_address_space(5)> -> !cir.ptr<!cir.double, target_address_space(5)> + // CHECK-NEXT: %[[A_ARG0:.*]] = cir.load align(8) %[[A_P0]] : !cir.ptr<!cir.double, target_address_space(5)>, !cir.double + // CHECK-NEXT: %[[A_P1:.*]] = cir.get_member %[[A_FLAT]][1] {name = ""} : !cir.ptr<![[FLAT]], target_address_space(5)> -> !cir.ptr<!cir.array<!u8i x 8>, target_address_space(5)> + // CHECK-NEXT: %[[A_ARG1:.*]] = cir.load align(8) %[[A_P1]] : !cir.ptr<!cir.array<!u8i x 8>, target_address_space(5)>, !cir.array<!u8i x 8> + // CHECK-NEXT: %[[ONE:.*]] = cir.const #cir.int<1> : !s32i + // CHECK-NEXT: %[[B_FLAT:.*]] = cir.cast bitcast %[[B]] : !cir.ptr<!rec_u_pad_t, target_address_space(5)> -> !cir.ptr<![[FLAT]], target_address_space(5)> + // CHECK-NEXT: %[[B_P0:.*]] = cir.get_member %[[B_FLAT]][0] {name = ""} : !cir.ptr<![[FLAT]], target_address_space(5)> -> !cir.ptr<!cir.double, target_address_space(5)> + // CHECK-NEXT: %[[B_ARG0:.*]] = cir.load align(8) %[[B_P0]] : !cir.ptr<!cir.double, target_address_space(5)>, !cir.double + // CHECK-NEXT: %[[B_P1:.*]] = cir.get_member %[[B_FLAT]][1] {name = ""} : !cir.ptr<![[FLAT]], target_address_space(5)> -> !cir.ptr<!cir.array<!u8i x 8>, target_address_space(5)> + // CHECK-NEXT: %[[B_ARG1:.*]] = cir.load align(8) %[[B_P1]] : !cir.ptr<!cir.array<!u8i x 8>, target_address_space(5)>, !cir.array<!u8i x 8> + // CHECK-NEXT: cir.call @two(%[[A_ARG0]], %[[A_ARG1]], %[[ONE]], %[[B_ARG0]], %[[B_ARG1]]) : (!cir.double, !cir.array<!u8i x 8>, !s32i, !cir.double, !cir.array<!u8i x 8>) -> () + // CHECK-NEXT: cir.return +} _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
