From 0d2d6cb8a06d90bbb1567222ce87d566e62e1fd3 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Thu, 17 Apr 2025 19:04:24 +0100 Subject: [PATCH 01/40] IRGen, LLVMPasses: Switch from obsoleted APIs to `llvm::getPointerAuthStableSipHash` Per d68f8b96b1ff39cfcfcad94d5b16d28adaf6b5d0 (llvm-project). --- lib/IRGen/GenPointerAuth.cpp | 7 ++++--- lib/LLVMPasses/LLVMMergeFunctions.cpp | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/IRGen/GenPointerAuth.cpp b/lib/IRGen/GenPointerAuth.cpp index 9d094032747be..42b78ecc01bbe 100644 --- a/lib/IRGen/GenPointerAuth.cpp +++ b/lib/IRGen/GenPointerAuth.cpp @@ -26,6 +26,7 @@ #include "swift/SIL/TypeLowering.h" #include "clang/CodeGen/CodeGenABITypes.h" #include "llvm/ADT/APInt.h" +#include "llvm/Support/SipHash.h" #include "llvm/Support/raw_ostream.h" using namespace swift; @@ -332,7 +333,7 @@ static llvm::ConstantInt *getDiscriminatorForHash(IRGenModule &IGM, static llvm::ConstantInt *getDiscriminatorForString(IRGenModule &IGM, StringRef string) { - uint64_t rawHash = clang::CodeGen::computeStableStringHash(string); + uint64_t rawHash = llvm::getPointerAuthStableSipHash(string); return getDiscriminatorForHash(IGM, rawHash); } @@ -590,7 +591,7 @@ static uint64_t getTypeHash(IRGenModule &IGM, CanSILFunctionType type) { hashStringForFunctionType( IGM, type, Out, genericSig.getCanonicalSignature().getGenericEnvironment()); - return clang::CodeGen::computeStableStringHash(Out.str()); + return llvm::getPointerAuthStableSipHash(Out.str()); } static uint64_t getYieldTypesHash(IRGenModule &IGM, CanSILFunctionType type) { @@ -629,7 +630,7 @@ static uint64_t getYieldTypesHash(IRGenModule &IGM, CanSILFunctionType type) { out << ":"; } - return clang::CodeGen::computeStableStringHash(out.str()); + return llvm::getPointerAuthStableSipHash(out.str()); } llvm::ConstantInt * diff --git a/lib/LLVMPasses/LLVMMergeFunctions.cpp b/lib/LLVMPasses/LLVMMergeFunctions.cpp index 3f53edfa891ad..122c947df19d2 100644 --- a/lib/LLVMPasses/LLVMMergeFunctions.cpp +++ b/lib/LLVMPasses/LLVMMergeFunctions.cpp @@ -30,7 +30,6 @@ #include "swift/Basic/Assertions.h" #include "swift/LLVMPasses/Passes.h" -#include "clang/AST/StableHash.h" #include "clang/Basic/PointerAuthOptions.h" #include "llvm/ADT/DenseSet.h" #include "llvm/ADT/FoldingSet.h" @@ -55,6 +54,7 @@ #include "llvm/Support/Debug.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/raw_ostream.h" +#include "llvm/Support/SipHash.h" #include "llvm/TargetParser/Triple.h" #include "llvm/Transforms/IPO.h" #include "llvm/Transforms/Utils/FunctionComparator.h" @@ -416,9 +416,10 @@ class SwiftMergeFunctions { if (auto *GO = dyn_cast(value)) concatenatedCalleeNames += GO->getName(); } - uint64_t rawHash = clang::getStableStringHash(concatenatedCalleeNames); + uint64_t hash = + llvm::getPointerAuthStableSipHash(concatenatedCalleeNames); IntegerType *discrTy = Type::getInt64Ty(Context); - discriminator = ConstantInt::get(discrTy, (rawHash % 0xFFFF) + 1); + discriminator = ConstantInt::get(discrTy, hash); } }; From f93aba0770e7ff73997d3afed2c1c50a765b2e05 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Thu, 17 Apr 2025 20:02:04 +0100 Subject: [PATCH 02/40] IRGen, LLVMPasses: Switch from obsoleted `nocapture` to `captures(none)` Per 29441e4f5fa5f5c7709f7cf180815ba97f611297 (llvm-project). --- lib/IRGen/CallEmission.h | 5 +- lib/IRGen/GenCall.cpp | 26 ++- lib/LLVMPasses/ARCEntryPointBuilder.h | 11 +- .../IRGen/differentiable_function.sil | 4 +- test/DebugInfo/ErrorVar.swift | 2 +- ...tributed_actor_accessor_thunks_32bit.swift | 14 +- ...tributed_actor_accessor_thunks_64bit.swift | 2 +- test/IRGen/abi_v7k.swift | 4 +- test/IRGen/abitypes_objc.swift | 34 ++-- test/IRGen/access_markers.sil | 4 +- test/IRGen/argument_attrs.sil | 24 +-- test/IRGen/async_dynamic_replacement.swift | 2 +- test/IRGen/big_types_corner_cases.sil | 28 +-- test/IRGen/big_types_corner_cases.swift | 38 ++-- test/IRGen/big_types_corner_cases_tiny.swift | 2 +- test/IRGen/big_types_tests.sil | 2 +- test/IRGen/builtin_pack_length.swift | 2 +- test/IRGen/builtins.swift | 18 +- test/IRGen/c_layout.sil | 8 +- test/IRGen/casts.sil | 2 +- test/IRGen/class_field_other_module.swift | 4 +- ...ormances_class_with_defaulted_method.swift | 2 +- test/IRGen/coroutine_accessors.swift | 4 +- ...outine_accessors_backdeploy_async_56.swift | 2 +- ...outine_accessors_backdeploy_async_57.swift | 2 +- test/IRGen/dependent_reabstraction.swift | 2 +- test/IRGen/enum.sil | 42 ++-- test/IRGen/enum_derived.swift | 4 +- test/IRGen/enum_future.sil | 42 ++-- test/IRGen/enum_resilience.swift | 2 +- test/IRGen/errors.sil | 6 +- test/IRGen/existentials_objc.sil | 4 +- test/IRGen/extern_c_abitypes.swift | 12 +- test/IRGen/fixlifetime.sil | 4 +- test/IRGen/function_param_convention.sil | 2 +- test/IRGen/function_types.sil | 4 +- test/IRGen/generic_casts.swift | 4 +- test/IRGen/generic_metatypes.swift | 2 +- test/IRGen/generic_metatypes_future.swift | 2 +- test/IRGen/generic_ternary.swift | 2 +- test/IRGen/indexing.sil | 6 +- test/IRGen/indirect_argument.sil | 36 ++-- test/IRGen/indirect_return.swift | 2 +- test/IRGen/inout_noalias.sil | 2 +- test/IRGen/lazy_multi_file.swift | 2 +- test/IRGen/lifetime.sil | 2 +- .../moveonly_split_module_source_deinit.swift | 2 +- test/IRGen/moveonly_value_functions.swift | 6 +- .../moveonly_value_functions_onone.swift | 8 +- test/IRGen/objc_block_storage.sil | 10 +- test/IRGen/objc_class_export.swift | 4 +- .../objc_generic_protocol_conformance.swift | 2 +- test/IRGen/objc_simd.sil | 6 +- test/IRGen/objc_structs.swift | 10 +- test/IRGen/objc_super.swift | 2 +- test/IRGen/partial_apply.sil | 20 +- test/IRGen/partial_apply_coro.sil | 56 ++--- test/IRGen/partial_apply_generic.swift | 2 +- test/IRGen/pre_specialize.swift | 8 +- test/IRGen/protocol_accessor_multifile.swift | 2 +- test/IRGen/protocol_resilience.sil | 10 +- test/IRGen/protocol_resilience_thunks.swift | 4 +- test/IRGen/same_type_constraints.swift | 2 +- test/IRGen/select_enum.sil | 2 +- test/IRGen/sil_generic_witness_methods.swift | 2 +- test/IRGen/sil_witness_methods.sil | 8 +- test/IRGen/sil_witness_tables.swift | 4 +- test/IRGen/struct_resilience.swift | 8 +- test/IRGen/struct_with_resilient_type.swift | 2 +- test/IRGen/typed_throws.sil | 24 +-- test/IRGen/typed_throws.swift | 8 +- test/IRGen/typed_throws_abi.swift | 192 +++++++++--------- test/IRGen/typed_throws_thunks.swift | 16 +- .../typelayout_based_value_witness.swift | 4 +- test/IRGen/unconditional_checked_cast.sil | 2 +- test/IRGen/witness_method.sil | 4 +- test/IRGen/yield_once_big.sil | 6 +- test/IRGen/yield_once_indirect.sil | 2 +- ...ional_conformance_basic_conformances.swift | 8 +- ...onformance_basic_conformances_future.swift | 8 +- .../conditional_conformance_subclass.swift | 4 +- ...ditional_conformance_subclass_future.swift | 4 +- .../conditional_conformance_with_assoc.swift | 4 +- ...tional_conformance_with_assoc_future.swift | 4 +- .../Interop/Cxx/class/method/inreg-sret.swift | 4 +- .../class/protocol-conformance-irgen.swift | 2 +- .../Cxx/class/returns-large-class-irgen.swift | 2 +- .../Cxx/extern-var/extern-var-irgen.swift | 2 +- .../inline-static-member-var-irgen.swift | 2 +- .../Interop/Cxx/static/static-var-irgen.swift | 2 +- .../stdlib/msvc-abi-use-vector-iterator.swift | 2 +- .../Cxx/templates/mangling-irgen.swift | 4 +- test/LLVMPasses/allocation-deletion.ll | 2 +- ...irt_witness_method_empty_conformance.swift | 2 +- test/SILOptimizer/eager_specialize.sil | 4 +- test/SILOptimizer/eager_specialize_ossa.sil | 4 +- 96 files changed, 473 insertions(+), 459 deletions(-) diff --git a/lib/IRGen/CallEmission.h b/lib/IRGen/CallEmission.h index 89ac2baa265f7..e6c6ac8b36ebd 100644 --- a/lib/IRGen/CallEmission.h +++ b/lib/IRGen/CallEmission.h @@ -152,11 +152,12 @@ class CallEmission { WitnessMetadata *witnessMetadata); virtual Address getCalleeErrorSlot(SILType errorType, bool isCalleeAsync) = 0; - void addFnAttribute(llvm::Attribute::AttrKind Attr); + void addFnAttribute(llvm::Attribute::AttrKind kind); void setIndirectReturnAddress(Address addr) { indirectReturnAddress = addr; } - void addParamAttribute(unsigned ParamIndex, llvm::Attribute::AttrKind Attr); + void addParamAttribute(unsigned paramIndex, llvm::Attribute::AttrKind kind); + void addParamAttribute(unsigned paramIndex, llvm::Attribute attr); void emitToMemory(Address addr, const LoadableTypeInfo &substResultTI, bool isOutlined); diff --git a/lib/IRGen/GenCall.cpp b/lib/IRGen/GenCall.cpp index 2a886a2cf6219..be7ada6d0ee73 100644 --- a/lib/IRGen/GenCall.cpp +++ b/lib/IRGen/GenCall.cpp @@ -317,7 +317,7 @@ static void addIndirectValueParameterAttributes(IRGenModule &IGM, // Bitwise takable value types are guaranteed not to capture // a pointer into itself. if (!addressable && ti.isBitwiseTakable(ResilienceExpansion::Maximal)) - b.addAttribute(llvm::Attribute::NoCapture); + b.addCapturesAttr(llvm::CaptureInfo::none()); // The parameter must reference dereferenceable memory of the type. addDereferenceableAttributeToBuilder(IGM, b, ti); @@ -330,7 +330,7 @@ static void addPackParameterAttributes(IRGenModule &IGM, unsigned argIndex) { llvm::AttrBuilder b(IGM.getLLVMContext()); // Pack parameter pointers can't alias. - // Note: they are not marked `nocapture` as one + // Note: they are not marked `captures(none)` as one // pack parameter could be a value type (e.g. a C++ type) // that captures its own pointer in itself. b.addAttribute(llvm::Attribute::NoAlias); @@ -357,7 +357,7 @@ static void addInoutParameterAttributes(IRGenModule &IGM, SILType paramSILType, // Bitwise takable value types are guaranteed not to capture // a pointer into itself. if (!addressable && ti.isBitwiseTakable(ResilienceExpansion::Maximal)) - b.addAttribute(llvm::Attribute::NoCapture); + b.addCapturesAttr(llvm::CaptureInfo::none()); // The inout must reference dereferenceable memory of the type. addDereferenceableAttributeToBuilder(IGM, b, ti); @@ -411,7 +411,7 @@ static void addIndirectResultAttributes(IRGenModule &IGM, // Bitwise takable value types are guaranteed not to capture // a pointer into itself. if (typeInfo.isBitwiseTakable(ResilienceExpansion::Maximal)) - b.addAttribute(llvm::Attribute::NoCapture); + b.addCapturesAttr(llvm::CaptureInfo::none()); if (allowSRet) { assert(storageType); b.addStructRetAttr(storageType); @@ -530,7 +530,7 @@ void IRGenModule::addSwiftErrorAttributes(llvm::AttributeList &attrs, // The error result should not be aliased, captured, or pointed at invalid // addresses regardless. b.addAttribute(llvm::Attribute::NoAlias); - b.addAttribute(llvm::Attribute::NoCapture); + b.addCapturesAttr(llvm::CaptureInfo::none()); b.addDereferenceableAttr(getPointerSize().getValue()); attrs = attrs.addParamAttributes(this->getLLVMContext(), argIndex, b); @@ -2854,7 +2854,9 @@ class SyncCallEmission final : public CallEmission { } } Args[--LastArgWritten] = errorResultSlot.getAddress(); - addParamAttribute(LastArgWritten, llvm::Attribute::NoCapture); + addParamAttribute(LastArgWritten, llvm::Attribute::getWithCaptureInfo( + IGF.IGM.getLLVMContext(), + llvm::CaptureInfo::none())); IGF.IGM.addSwiftErrorAttributes(CurCallee.getMutableAttributes(), LastArgWritten); @@ -5577,14 +5579,20 @@ void CallEmission::setArgs(Explosion &adjusted, bool isOutlined, } } -void CallEmission::addFnAttribute(llvm::Attribute::AttrKind attr) { +void CallEmission::addFnAttribute(llvm::Attribute::AttrKind kind) { assert(state == State::Emitting); auto &attrs = CurCallee.getMutableAttributes(); - attrs = attrs.addFnAttribute(IGF.IGM.getLLVMContext(), attr); + attrs = attrs.addFnAttribute(IGF.IGM.getLLVMContext(), kind); } void CallEmission::addParamAttribute(unsigned paramIndex, - llvm::Attribute::AttrKind attr) { + llvm::Attribute::AttrKind kind) { + addParamAttribute(paramIndex, + llvm::Attribute::get(IGF.IGM.getLLVMContext(), kind)); +} + +void CallEmission::addParamAttribute(unsigned paramIndex, + llvm::Attribute attr) { assert(state == State::Emitting); auto &attrs = CurCallee.getMutableAttributes(); attrs = attrs.addParamAttribute(IGF.IGM.getLLVMContext(), paramIndex, attr); diff --git a/lib/LLVMPasses/ARCEntryPointBuilder.h b/lib/LLVMPasses/ARCEntryPointBuilder.h index 6811d8c405b0a..33290a95d7471 100644 --- a/lib/LLVMPasses/ARCEntryPointBuilder.h +++ b/lib/LLVMPasses/ARCEntryPointBuilder.h @@ -252,11 +252,16 @@ class ARCEntryPointBuilder { auto *ObjectPtrTy = getObjectPtrTy(); auto &M = getModule(); - auto AttrList = AttributeList::get(M.getContext(), 1, Attribute::NoCapture); - AttrList = AttrList.addFnAttribute(M.getContext(), Attribute::NoUnwind); + auto &C = M.getContext(); + + AttributeList AttrList; + AttrList = AttrList.addFnAttribute(C, Attribute::NoUnwind); + AttrList = AttrList.addParamAttribute( + C, 0, Attribute::getWithCaptureInfo(C, llvm::CaptureInfo::none())); + CheckUnowned = cast( M.getOrInsertFunction("swift_checkUnowned", AttrList, - Type::getVoidTy(M.getContext()), ObjectPtrTy) + Type::getVoidTy(C), ObjectPtrTy) .getCallee()); if (llvm::Triple(M.getTargetTriple()).isOSBinFormatCOFF() && !llvm::Triple(M.getTargetTriple()).isOSCygMing()) diff --git a/test/AutoDiff/IRGen/differentiable_function.sil b/test/AutoDiff/IRGen/differentiable_function.sil index 9acbeef82cd5a..d347d801b5112 100644 --- a/test/AutoDiff/IRGen/differentiable_function.sil +++ b/test/AutoDiff/IRGen/differentiable_function.sil @@ -33,7 +33,7 @@ bb0: return %result : $@differentiable(reverse) @callee_guaranteed (Float) -> Float } -// CHECK-LABEL: define{{.*}}test_form_diff_func(ptr noalias nocapture sret(<{ %swift.function, %swift.function, %swift.function }>) +// CHECK-LABEL: define{{.*}}test_form_diff_func(ptr noalias captures(none) sret(<{ %swift.function, %swift.function, %swift.function }>) // CHECK-SAME: [[OUT:%.*]]) // CHECK: [[OUT_ORIG:%.*]] = getelementptr{{.*}}[[OUT]], i32 0, i32 0 // CHECK: [[OUT_ORIG_FN:%.*]] = getelementptr{{.*}}[[OUT_ORIG]], i32 0, i32 0 @@ -60,7 +60,7 @@ bb0(%0 : $@differentiable(reverse) @callee_guaranteed (Float) -> Float): return %result : $(@callee_guaranteed (Float) -> Float, @callee_guaranteed (Float) -> (Float, @owned @callee_guaranteed (Float) -> Float), @callee_guaranteed (Float) -> (Float, @owned @callee_guaranteed (Float) -> Float)) } -// CHECK-LABEL: define{{.*}}@test_extract_components(ptr noalias nocapture sret(<{ %swift.function, %swift.function, %swift.function }>) +// CHECK-LABEL: define{{.*}}@test_extract_components(ptr noalias captures(none) sret(<{ %swift.function, %swift.function, %swift.function }>) // CHECK-SAME: [[OUT:%.*]], ptr{{.*}}[[IN:%.*]]) // CHECK: [[ORIG:%.*]] = getelementptr{{.*}}[[IN]], i32 0, i32 0 // CHECK: [[ORIG_FN_ADDR:%.*]] = getelementptr{{.*}}[[ORIG]], i32 0, i32 0 diff --git a/test/DebugInfo/ErrorVar.swift b/test/DebugInfo/ErrorVar.swift index 75c7fccf7a13f..3025b9931ed43 100644 --- a/test/DebugInfo/ErrorVar.swift +++ b/test/DebugInfo/ErrorVar.swift @@ -14,7 +14,7 @@ func simple(_ placeholder: Int64) throws -> () { // CHECK: define {{.*}}void @"$s8ErrorVar6simpleyys5Int64VKF"( // CHECK-SAME: i64 // CHECK-SAME: %swift.refcounted* {{.*}}swiftself - // CHECK-SAME: %swift.error** noalias nocapture dereferenceable(4) + // CHECK-SAME: %swift.error** noalias captures(none) dereferenceable(4) // CHECK: #dbg_declare // CHECK: #dbg_declare({{.*}}, ![[ERROR:[0-9]+]], !DIExpression(DW_OP_deref) // CHECK-DAG: ![[ERRTY:.*]] = !DICompositeType({{.*}}identifier: "$ss5Error_pD" diff --git a/test/Distributed/distributed_actor_accessor_thunks_32bit.swift b/test/Distributed/distributed_actor_accessor_thunks_32bit.swift index ce84f48c868ea..3ea45ea4d043d 100644 --- a/test/Distributed/distributed_actor_accessor_thunks_32bit.swift +++ b/test/Distributed/distributed_actor_accessor_thunks_32bit.swift @@ -94,7 +94,7 @@ public distributed actor MyOtherActor { // CHECK: define hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC7simple1yySiYaKFTE" -// CHECK: define linkonce_odr hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC7simple1yySiYaKFTETF"(%swift.context* swiftasync %0, %swift.opaque* nocapture %1, i8* %2, i8* %3, {{.*}}, %T27distributed_actor_accessors7MyActorC* [[ACTOR:%.*]], %swift.type* [[DECODER_TYPE:%.*]], i8** [[DECODER_PROTOCOL_WITNESS:%.*]]) +// CHECK: define linkonce_odr hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC7simple1yySiYaKFTETF"(%swift.context* swiftasync %0, %swift.opaque* captures(none) %1, i8* %2, i8* %3, {{.*}}, %T27distributed_actor_accessors7MyActorC* [[ACTOR:%.*]], %swift.type* [[DECODER_TYPE:%.*]], i8** [[DECODER_PROTOCOL_WITNESS:%.*]]) /// Read the current offset and cast an element to `Int` @@ -119,7 +119,7 @@ public distributed actor MyOtherActor { // CHECK: missing-witness1: // CHECK-NEXT: call void @llvm.trap() // CHECK-NEXT: unreachable -// CHECK: call swiftcc void @"$s27FakeDistributedActorSystems0A17InvocationDecoderC18decodeNextArgumentxyKSeRzSERzlF"(%swift.opaque* noalias nocapture sret(%swift.opaque) [[ARG_0_RES_SLOT]], %swift.type* %arg_type, i8** [[ENCODABLE_WITNESS]], i8** [[DECODABLE_WITNESS]], %T27FakeDistributedActorSystems0A17InvocationDecoderC* swiftself [[DECODER]], %swift.error** noalias nocapture dereferenceable(4) %swifterror) +// CHECK: call swiftcc void @"$s27FakeDistributedActorSystems0A17InvocationDecoderC18decodeNextArgumentxyKSeRzSERzlF"(%swift.opaque* noalias captures(none) sret(%swift.opaque) [[ARG_0_RES_SLOT]], %swift.type* %arg_type, i8** [[ENCODABLE_WITNESS]], i8** [[DECODABLE_WITNESS]], %T27FakeDistributedActorSystems0A17InvocationDecoderC* swiftself [[DECODER]], %swift.error** noalias captures(none) dereferenceable(4) %swifterror) // CHECK: store %swift.error* null, %swift.error** %swifterror // CHECK-NEXT: [[ARG_0_VAL_ADDR:%.*]] = bitcast i8* [[ARG_0_VALUE_BUF]] to %TSi* @@ -196,7 +196,7 @@ public distributed actor MyOtherActor { // CHECK: define hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC7simple3ySiSSYaKFTE" /// !!! in `simple3` interesting bits are: argument value extraction (because string is exploded into N arguments) and call to distributed thunk -// CHECK: define linkonce_odr hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC7simple3ySiSSYaKFTETF"(%swift.context* swiftasync %0, %swift.opaque* nocapture [[ARG_DECODER:%.*]], i8* [[ARG_TYPES:%.*]], i8* [[RESULT_BUFF:%.*]], i8* [[SUBS:%.*]], i8* [[WITNESS_TABLES:%.*]], i32 [[NUM_WITNESS_TABLES:%.*]], %T27distributed_actor_accessors7MyActorC* [[ACTOR]], %swift.type* [[DECODER_TYPE:%.*]], i8** [[DECODER_PROTOCOL_WITNESS:%.*]]) +// CHECK: define linkonce_odr hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC7simple3ySiSSYaKFTETF"(%swift.context* swiftasync %0, %swift.opaque* captures(none) [[ARG_DECODER:%.*]], i8* [[ARG_TYPES:%.*]], i8* [[RESULT_BUFF:%.*]], i8* [[SUBS:%.*]], i8* [[WITNESS_TABLES:%.*]], i32 [[NUM_WITNESS_TABLES:%.*]], %T27distributed_actor_accessors7MyActorC* [[ACTOR]], %swift.type* [[DECODER_TYPE:%.*]], i8** [[DECODER_PROTOCOL_WITNESS:%.*]]) // CHECK: [[TYPED_RESULT_BUFF:%.*]] = bitcast i8* [[RESULT_BUFF]] to %TSi* @@ -260,7 +260,7 @@ public distributed actor MyOtherActor { // CHECK: define hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC16single_case_enumyAA7SimpleEOAFYaKFTE" -// CHECK: define linkonce_odr hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC16single_case_enumyAA7SimpleEOAFYaKFTETF"(%swift.context* swiftasync %0, %swift.opaque* nocapture [[ARG_DECODER:%.*]], i8* [[ARG_TYPES:%.*]], i8* [[RESULT_BUFF:%.*]], i8* [[SUBS:%.*]], i8* [[WITNESS_TABLES:%.*]], i32 [[NUM_WITNESS_TABLES:%.*]], %T27distributed_actor_accessors7MyActorC* [[ACTOR]], %swift.type* [[DECODER_TYPE]], %swift.type* [[ACTOR_TYPE]], i8** [[DECODER_PROTOCOL_WITNESS:%.*]]) +// CHECK: define linkonce_odr hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC16single_case_enumyAA7SimpleEOAFYaKFTETF"(%swift.context* swiftasync %0, %swift.opaque* captures(none) [[ARG_DECODER:%.*]], i8* [[ARG_TYPES:%.*]], i8* [[RESULT_BUFF:%.*]], i8* [[SUBS:%.*]], i8* [[WITNESS_TABLES:%.*]], i32 [[NUM_WITNESS_TABLES:%.*]], %T27distributed_actor_accessors7MyActorC* [[ACTOR]], %swift.type* [[DECODER_TYPE]], %swift.type* [[ACTOR_TYPE]], i8** [[DECODER_PROTOCOL_WITNESS:%.*]]) /// Let's check that the call doesn't have any arguments and returns nothing. @@ -307,7 +307,7 @@ public distributed actor MyOtherActor { // CHECK: define hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC7complexyAA11LargeStructVSaySiG_AA3ObjCSSSgAFtYaKFTE" -// CHECK: define linkonce_odr hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC7complexyAA11LargeStructVSaySiG_AA3ObjCSSSgAFtYaKFTETF"(%swift.context* swiftasync {{.*}}, %swift.opaque* nocapture [[ARG_DECODER:%.*]], i8* [[ARG_TYPES:%.*]], i8* [[RESULT_BUFF:%.*]], i8* [[SUBS:%.*]], i8* [[WITNESS_TABLES:%.*]], i32 [[NUM_WITNESS_TABLES:%.*]], %T27distributed_actor_accessors7MyActorC* [[ACTOR]], %swift.type* [[DECODER_TYPE:%.*]], %swift.type* [[ACTOR_TYPE]], i8** [[DECODER_PROTOCOL_WITNESS:%.*]]) +// CHECK: define linkonce_odr hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC7complexyAA11LargeStructVSaySiG_AA3ObjCSSSgAFtYaKFTETF"(%swift.context* swiftasync {{.*}}, %swift.opaque* captures(none) [[ARG_DECODER:%.*]], i8* [[ARG_TYPES:%.*]], i8* [[RESULT_BUFF:%.*]], i8* [[SUBS:%.*]], i8* [[WITNESS_TABLES:%.*]], i32 [[NUM_WITNESS_TABLES:%.*]], %T27distributed_actor_accessors7MyActorC* [[ACTOR]], %swift.type* [[DECODER_TYPE:%.*]], %swift.type* [[ACTOR_TYPE]], i8** [[DECODER_PROTOCOL_WITNESS:%.*]]) /// First, let's check that all of the different argument types here are loaded correctly. @@ -366,7 +366,7 @@ public distributed actor MyOtherActor { /// ---> Accessor for `genericArgs` -// CHECK: define linkonce_odr hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC11genericArgsyyx_Sayq_GtYaKSeRzSERzSeR_SER_r0_lFTETF"(%swift.context* swiftasync %0, %swift.opaque* nocapture [[ARG_DECODER:%.*]], i8* [[ARG_TYPES:%.*]], i8* [[RESULT_BUF:%.*]], i8* [[GENERIC_SUBS:%.*]], i8* [[WITNESS_TABLES:%.*]], i32 [[NUM_WITNESS_TABLES:%.*]], %T27distributed_actor_accessors7MyActorC* [[ACTOR:%.*]], %swift.type* [[DECODER_TYPE:%.*]], %swift.type* [[ACTOR_TYPE]], i8** [[DECODER_PROTOCOL_WITNESS:%.*]]) +// CHECK: define linkonce_odr hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC11genericArgsyyx_Sayq_GtYaKSeRzSERzSeR_SER_r0_lFTETF"(%swift.context* swiftasync %0, %swift.opaque* captures(none) [[ARG_DECODER:%.*]], i8* [[ARG_TYPES:%.*]], i8* [[RESULT_BUF:%.*]], i8* [[GENERIC_SUBS:%.*]], i8* [[WITNESS_TABLES:%.*]], i32 [[NUM_WITNESS_TABLES:%.*]], %T27distributed_actor_accessors7MyActorC* [[ACTOR:%.*]], %swift.type* [[DECODER_TYPE:%.*]], %swift.type* [[ACTOR_TYPE]], i8** [[DECODER_PROTOCOL_WITNESS:%.*]]) /// ---> Load `T` @@ -422,7 +422,7 @@ public distributed actor MyOtherActor { /// Let's check that there is argument decoding since parameter list is empty -// CHECK: define linkonce_odr hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors12MyOtherActorC5emptyyyYaKFTETF"(%swift.context* swiftasync {{.*}}, %swift.opaque* nocapture [[ARG_DECODER:%.*]], i8* [[ARG_TYPES:%.*]], i8* [[RESULT_BUFF:%.*]], i8* [[SUBS:%.*]], i8* [[WITNESS_TABLES:%.*]], i32 [[NUM_WITNESS_TABLES:%.*]], %T27distributed_actor_accessors12MyOtherActorC* {{.*}}, %swift.type* [[DECODER_TYPE:%.*]], %swift.type* [[ACTOR_TYPE]], i8** [[DECODER_PROTOCOL_WITNESS:%.*]]) +// CHECK: define linkonce_odr hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors12MyOtherActorC5emptyyyYaKFTETF"(%swift.context* swiftasync {{.*}}, %swift.opaque* captures(none) [[ARG_DECODER:%.*]], i8* [[ARG_TYPES:%.*]], i8* [[RESULT_BUFF:%.*]], i8* [[SUBS:%.*]], i8* [[WITNESS_TABLES:%.*]], i32 [[NUM_WITNESS_TABLES:%.*]], %T27distributed_actor_accessors12MyOtherActorC* {{.*}}, %swift.type* [[DECODER_TYPE:%.*]], %swift.type* [[ACTOR_TYPE]], i8** [[DECODER_PROTOCOL_WITNESS:%.*]]) // CHECK-NEXT: entry: // CHECK-NEXT: {{.*}} = alloca %swift.context* // CHECK-NEXT: %swifterror = alloca %swift.error* diff --git a/test/Distributed/distributed_actor_accessor_thunks_64bit.swift b/test/Distributed/distributed_actor_accessor_thunks_64bit.swift index ac91f313d20e0..f3651319e07d1 100644 --- a/test/Distributed/distributed_actor_accessor_thunks_64bit.swift +++ b/test/Distributed/distributed_actor_accessor_thunks_64bit.swift @@ -116,7 +116,7 @@ public distributed actor MyOtherActor { // CHECK: missing-witness1: // CHECK-NEXT: call void @llvm.trap() // CHECK-NEXT: unreachable -// CHECK: call swiftcc void @"$s27FakeDistributedActorSystems0A17InvocationDecoderC18decodeNextArgumentxyKSeRzSERzlF"(ptr noalias sret(%swift.opaque) [[ARG_0_VALUE_BUF]], ptr %arg_type, ptr [[ENCODABLE_WITNESS]], ptr [[DECODABLE_WITNESS]], ptr swiftself [[DECODER]], ptr noalias nocapture swifterror dereferenceable(8) %swifterror) +// CHECK: call swiftcc void @"$s27FakeDistributedActorSystems0A17InvocationDecoderC18decodeNextArgumentxyKSeRzSERzlF"(ptr noalias sret(%swift.opaque) [[ARG_0_VALUE_BUF]], ptr %arg_type, ptr [[ENCODABLE_WITNESS]], ptr [[DECODABLE_WITNESS]], ptr swiftself [[DECODER]], ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) // CHECK: store ptr null, ptr %swifterror // CHECK-NEXT: %._value = getelementptr inbounds %TSi, ptr [[ARG_0_VALUE_BUF]], i32 0, i32 0 diff --git a/test/IRGen/abi_v7k.swift b/test/IRGen/abi_v7k.swift index cec49c0801a88..e2e5bd766650e 100644 --- a/test/IRGen/abi_v7k.swift +++ b/test/IRGen/abi_v7k.swift @@ -296,7 +296,7 @@ func testRet3() -> MyRect2 { } // Returning tuple?: (Int x 6)? -// CHECK-LABEL: define hidden swiftcc void @"$s8test_v7k7minMax2{{.*}}"(ptr noalias nocapture sret({{.*}}) %0, i32 %1, i32 %2) +// CHECK-LABEL: define hidden swiftcc void @"$s8test_v7k7minMax2{{.*}}"(ptr noalias captures(none) sret({{.*}}) %0, i32 %1, i32 %2) // V7K-LABEL: _$s8test_v7k7minMax2 // We will indirectly return an optional with the address in r0, input parameters will be in r1 and r2 // V7K: str r0, [sp, [[IDX:#[0-9]+]]] @@ -324,7 +324,7 @@ func minMax2(x : Int, y : Int) -> (min: Int, max: Int, min2: Int, max2: Int, min } // Returning struct?: {Int x 6}? -// CHECK-LABEL: define hidden swiftcc void @"$s8test_v7k7minMax3{{.*}}"(ptr noalias nocapture sret({{.*}}) %0, i32 %1, i32 %2) +// CHECK-LABEL: define hidden swiftcc void @"$s8test_v7k7minMax3{{.*}}"(ptr noalias captures(none) sret({{.*}}) %0, i32 %1, i32 %2) // V7K-LABEL: _$s8test_v7k7minMax3 struct Ret { var min:Int diff --git a/test/IRGen/abitypes_objc.swift b/test/IRGen/abitypes_objc.swift index 3bf060dd3a650..d3eb9f8793739 100644 --- a/test/IRGen/abitypes_objc.swift +++ b/test/IRGen/abitypes_objc.swift @@ -27,20 +27,20 @@ class Foo { // x86_64-macosx: define internal { <2 x float>, <2 x float> } @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(ptr %0, ptr %1) {{[#0-9]*}} { // x86_64-ios: define hidden swiftcc { float, float, float, float } @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}F"(ptr swiftself %0) {{.*}} { // x86_64-ios: define internal { <2 x float>, <2 x float> } @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(ptr %0, ptr %1) {{[#0-9]*}} { - // i386-ios: define hidden swiftcc void @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}F"(ptr noalias nocapture sret({{.*}}) %0, ptr swiftself %1) {{.*}} { - // i386-ios: define internal void @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(ptr noalias nocapture sret({{.*}}) %0, ptr %1, ptr %2) {{[#0-9]*}} { + // i386-ios: define hidden swiftcc void @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}F"(ptr noalias captures(none) sret({{.*}}) %0, ptr swiftself %1) {{.*}} { + // i386-ios: define internal void @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(ptr noalias captures(none) sret({{.*}}) %0, ptr %1, ptr %2) {{[#0-9]*}} { // armv7-ios: define hidden swiftcc { float, float, float, float } @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}F"(ptr swiftself %0) {{.*}} { - // armv7-ios: define internal void @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(ptr noalias nocapture sret({{.*}}) %0, ptr %1, ptr %2) {{[#0-9]*}} { + // armv7-ios: define internal void @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(ptr noalias captures(none) sret({{.*}}) %0, ptr %1, ptr %2) {{[#0-9]*}} { // armv7s-ios: define hidden swiftcc { float, float, float, float } @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}F"(ptr swiftself %0) {{.*}} { - // armv7s-ios: define internal void @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(ptr noalias nocapture sret({{.*}}) %0, ptr %1, ptr %2) {{[#0-9]*}} { + // armv7s-ios: define internal void @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(ptr noalias captures(none) sret({{.*}}) %0, ptr %1, ptr %2) {{[#0-9]*}} { // arm64-ios: define hidden swiftcc { float, float, float, float } @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}F"(ptr swiftself %0) {{.*}} { // arm64-ios: define internal [[ARM64_MYRECT]] @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(ptr %0, ptr %1) {{[#0-9]*}} { // x86_64-tvos: define hidden swiftcc { float, float, float, float } @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}F"(ptr swiftself %0) {{.*}} { // x86_64-tvos: define internal { <2 x float>, <2 x float> } @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(ptr %0, ptr %1) {{[#0-9]*}} { // arm64-tvos: define hidden swiftcc { float, float, float, float } @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}F"(ptr swiftself %0) {{.*}} { // arm64-tvos: define internal [[ARM64_MYRECT]] @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(ptr %0, ptr %1) {{[#0-9]*}} { - // i386-watchos: define hidden swiftcc void @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}F"(ptr noalias nocapture sret({{.*}}) %0, ptr swiftself %1) {{.*}} { - // i386-watchos: define internal void @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(ptr noalias nocapture sret({{.*}}) %0, ptr %1, ptr %2) {{[#0-9]*}} { + // i386-watchos: define hidden swiftcc void @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}F"(ptr noalias captures(none) sret({{.*}}) %0, ptr swiftself %1) {{.*}} { + // i386-watchos: define internal void @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(ptr noalias captures(none) sret({{.*}}) %0, ptr %1, ptr %2) {{[#0-9]*}} { // armv7k-watchos: define hidden swiftcc { float, float, float, float } @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}F"(ptr swiftself %0) {{.*}} { // armv7k-watchos: define internal [[ARMV7K_MYRECT]] @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(ptr %0, ptr %1) {{[#0-9]*}} { // armv64_32-watchos: define hidden swiftcc { float, float, float, float } @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}F"(ptr swiftself %0) {{.*}} { @@ -157,7 +157,7 @@ class Foo { // armv7-ios: define hidden swiftcc float @"$s8abitypes3FooC4barc{{[_0-9a-zA-Z]*}}F"(ptr %0, ptr swiftself %1) {{.*}} { // armv7-ios: [[RESULT:%.*]] = alloca [[RECTTYPE:%.*MyRect.*]], align 4 // armv7-ios: load ptr, ptr @"\01L_selector(newRect)", align 4 - // armv7-ios: call void @objc_msgSend_stret(ptr noalias nocapture sret({{.*}}) %call.aggresult + // armv7-ios: call void @objc_msgSend_stret(ptr noalias captures(none) sret({{.*}}) %call.aggresult // armv7-ios: [[GEP1:%.*]] = getelementptr inbounds [[RECTTYPE]], ptr [[RESULT]], i32 0, i32 1 // armv7-ios: [[GEP2:%.*]] = getelementptr inbounds {{.*}}, ptr [[GEP1]], i32 0, i32 0 // armv7-ios: [[RETVAL:%.*]] = load float, ptr [[GEP2]], align 4 @@ -167,7 +167,7 @@ class Foo { // armv7s-ios: define hidden swiftcc float @"$s8abitypes3FooC4barc{{[_0-9a-zA-Z]*}}F"(ptr %0, ptr swiftself %1) {{.*}} { // armv7s-ios: [[RESULT:%.*]] = alloca [[RECTTYPE:%.*MyRect.*]], align 4 // armv7s-ios: load ptr, ptr @"\01L_selector(newRect)", align 4 - // armv7s-ios: call void @objc_msgSend_stret(ptr noalias nocapture sret({{.*}}) %call.aggresult + // armv7s-ios: call void @objc_msgSend_stret(ptr noalias captures(none) sret({{.*}}) %call.aggresult // armv7s-ios: [[GEP1:%.*]] = getelementptr inbounds [[RECTTYPE]], ptr [[RESULT]], i32 0, i32 1 // armv7s-ios: [[GEP2:%.*]] = getelementptr inbounds {{.*}}, ptr [[GEP1]], i32 0, i32 0 // armv7s-ios: [[RETVAL:%.*]] = load float, ptr [[GEP2]], align 4 @@ -185,7 +185,7 @@ class Foo { } // x86_64-macosx: define hidden swiftcc { double, double, double } @"$s8abitypes3FooC3baz{{[_0-9a-zA-Z]*}}F"(ptr swiftself %0) {{.*}} { - // x86_64-macosx: define internal void @"$s8abitypes3FooC3baz{{[_0-9a-zA-Z]*}}FTo"(ptr noalias nocapture sret({{.*}}) %0, ptr %1, ptr %2) {{[#0-9]*}} { + // x86_64-macosx: define internal void @"$s8abitypes3FooC3baz{{[_0-9a-zA-Z]*}}FTo"(ptr noalias captures(none) sret({{.*}}) %0, ptr %1, ptr %2) {{[#0-9]*}} { @objc dynamic func baz() -> Trio { return Trio(i: 1.0, j: 2.0, k: 3.0) } @@ -480,17 +480,17 @@ class Foo { return g.invert(b) } - // x86_64-macosx: define hidden swiftcc void @"$s8abitypes3FooC10throwsTestyySbKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) {{.*}} { + // x86_64-macosx: define hidden swiftcc void @"$s8abitypes3FooC10throwsTestyySbKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) {{.*}} { // x86_64-macosx: [[SEL:%[0-9]+]] = load ptr, ptr @"\01L_selector(negateThrowing:error:)", align 8 // x86_64-macosx: call signext i8 @objc_msgSend(ptr {{%[0-9]+}}, ptr [[SEL]], i8 signext {{%[0-9]+}}, ptr {{%[0-9]+}}) // x86_64-macosx: } - // x86_64-ios: define hidden swiftcc void @"$s8abitypes3FooC10throwsTestyySbKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) {{.*}} { + // x86_64-ios: define hidden swiftcc void @"$s8abitypes3FooC10throwsTestyySbKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) {{.*}} { // x86_64-ios: [[SEL:%[0-9]+]] = load ptr, ptr @"\01L_selector(negateThrowing:error:)", align 8 // x86_64-ios: call zeroext i1 @objc_msgSend(ptr {{%[0-9]+}}, ptr [[SEL]], i1 zeroext {{%[0-9]+}}, ptr {{%[0-9]+}}) // x86_64-ios: } - // i386-ios: define hidden swiftcc void @"$s8abitypes3FooC10throwsTestyySbKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture dereferenceable(4) %2) {{.*}} { + // i386-ios: define hidden swiftcc void @"$s8abitypes3FooC10throwsTestyySbKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) dereferenceable(4) %2) {{.*}} { // i386-ios: [[SEL:%[0-9]+]] = load ptr, ptr @"\01L_selector(negateThrowing:error:)", align 4 // i386-ios: call signext i8 @objc_msgSend(ptr {{%[0-9]+}}, ptr [[SEL]], i8 signext {{%[0-9]+}}, ptr {{%[0-9]+}}) // i386-ios: } @@ -547,18 +547,18 @@ class Foo { } // arm64-ios: define hidden swiftcc { i64, i64, i64, i64 } @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}F"(ptr %0, i64 %1, i64 %2, i64 %3, i64 %4, ptr swiftself %5) {{.*}} { - // arm64-ios: define internal void @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}FTo"(ptr noalias nocapture sret({{.*}}) %0, ptr %1, ptr %2, ptr %3, ptr %4) {{[#0-9]*}} { + // arm64-ios: define internal void @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}FTo"(ptr noalias captures(none) sret({{.*}}) %0, ptr %1, ptr %2, ptr %3, ptr %4) {{[#0-9]*}} { // // arm64e-ios: define hidden swiftcc { i64, i64, i64, i64 } @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}F"(ptr %0, i64 %1, i64 %2, i64 %3, i64 %4, ptr swiftself %5) {{.*}} { - // arm64e-ios: define internal void @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}FTo"(ptr noalias nocapture sret({{.*}}) %0, ptr %1, ptr %2, ptr %3, ptr %4) {{.*}} { + // arm64e-ios: define internal void @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}FTo"(ptr noalias captures(none) sret({{.*}}) %0, ptr %1, ptr %2, ptr %3, ptr %4) {{.*}} { // // arm64-tvos: define hidden swiftcc { i64, i64, i64, i64 } @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}F"(ptr %0, i64 %1, i64 %2, i64 %3, i64 %4, ptr swiftself %5) {{.*}} { - // arm64-tvos: define internal void @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}FTo"(ptr noalias nocapture sret({{.*}}) %0, ptr %1, ptr %2, ptr %3, ptr %4) {{[#0-9]*}} { + // arm64-tvos: define internal void @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}FTo"(ptr noalias captures(none) sret({{.*}}) %0, ptr %1, ptr %2, ptr %3, ptr %4) {{[#0-9]*}} { // arm64-macosx: define hidden swiftcc { i64, i64, i64, i64 } @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}F"(ptr %0, i64 %1, i64 %2, i64 %3, i64 %4, ptr swiftself %5) {{.*}} { - // arm64-macosx: define internal void @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}FTo"(ptr noalias nocapture sret({{.*}}) %0, ptr %1, ptr %2, ptr %3, ptr %4) {{.*}} { + // arm64-macosx: define internal void @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}FTo"(ptr noalias captures(none) sret({{.*}}) %0, ptr %1, ptr %2, ptr %3, ptr %4) {{.*}} { // // arm64-watchos: define hidden swiftcc { i64, i64, i64, i64 } @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}F"(ptr %0, i64 %1, i64 %2, i64 %3, i64 %4, ptr swiftself %5) {{.*}} { - // arm64-watchos: define internal void @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}FTo"(ptr noalias nocapture sret({{.*}}) %0, ptr %1, ptr %2, ptr %3, ptr %4) {{[#0-9]*}} { + // arm64-watchos: define internal void @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}FTo"(ptr noalias captures(none) sret({{.*}}) %0, ptr %1, ptr %2, ptr %3, ptr %4) {{[#0-9]*}} { @objc dynamic func callJustReturn(_ r: StructReturns, with v: BigStruct) -> BigStruct { return r.justReturn(v) } diff --git a/test/IRGen/access_markers.sil b/test/IRGen/access_markers.sil index 0fe492f18343f..f551ad00bc2be 100644 --- a/test/IRGen/access_markers.sil +++ b/test/IRGen/access_markers.sil @@ -95,13 +95,13 @@ sil @testPairedBox : $(@guaranteed { var () }) -> () { bb0(%0 : ${ var () }): // CHECK: entry: %2 = project_box %0 : ${ var () }, 0 - // CHECK-NEXT: call {{.*}}void @writeEmptyTuple(ptr nocapture undef) + // CHECK-NEXT: call {{.*}}void @writeEmptyTuple(ptr captures(none) undef) %3 = begin_access [modify] [dynamic] %2 : $*() %write_fn = function_ref @writeEmptyTuple : $@convention(thin) (@inout ()) -> () apply %write_fn(%3) : $@convention(thin) (@inout ()) -> () end_access %3 : $*() - // CHECK-NEXT: call {{.*}}void @readEmptyTuple(ptr noalias nocapture undef) + // CHECK-NEXT: call {{.*}}void @readEmptyTuple(ptr noalias captures(none) undef) %5 = begin_access [read] [dynamic] %2 : $*() %read_fn = function_ref @readEmptyTuple : $@convention(thin) (@in_guaranteed ()) -> () apply %read_fn(%5) : $@convention(thin) (@in_guaranteed ()) -> () diff --git a/test/IRGen/argument_attrs.sil b/test/IRGen/argument_attrs.sil index ee82eb7eb4ddb..905842f443816 100644 --- a/test/IRGen/argument_attrs.sil +++ b/test/IRGen/argument_attrs.sil @@ -4,49 +4,49 @@ import Builtin struct Huge { var x, y, z, w, a, b, c, d, e, f: Builtin.Int32 } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @arguments_in_def(ptr nocapture dereferenceable(4) %0, ptr noalias nocapture dereferenceable(4) %1, ptr noalias nocapture dereferenceable(4) %2, ptr noalias nocapture dereferenceable(40) %3, ptr noalias %4, ptr noalias nocapture %5, ptr %T) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @arguments_in_def(ptr captures(none) dereferenceable(4) %0, ptr noalias captures(none) dereferenceable(4) %1, ptr noalias captures(none) dereferenceable(4) %2, ptr noalias captures(none) dereferenceable(40) %3, ptr noalias %4, ptr noalias captures(none) %5, ptr %T) sil @arguments_in_def : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> () { entry(%1 : $*Builtin.Int32, %2 : $*Builtin.Int32, %3 : $*Builtin.Int32, %4 : $Huge, %5 : $*T, %6 : $*()): - // CHECK: call swiftcc void @arguments_in_decl(ptr nocapture dereferenceable(4) {{%.*}}, ptr noalias nocapture dereferenceable(4) {{%.*}}, ptr noalias nocapture dereferenceable(4) {{%.*}}, ptr noalias nocapture dereferenceable(40) {{%.*}}, ptr noalias {{%.*}}, ptr noalias nocapture {{%.*}}, ptr %T) + // CHECK: call swiftcc void @arguments_in_decl(ptr captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(40) {{%.*}}, ptr noalias {{%.*}}, ptr noalias captures(none) {{%.*}}, ptr %T) %f = function_ref @arguments_in_decl : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> () %x = apply %f(%1, %2, %3, %4, %5, %6) : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> () - // CHECK: call swiftcc void @arguments_in_def(ptr nocapture dereferenceable(4) {{%.*}}, ptr noalias nocapture dereferenceable(4) {{%.*}}, ptr noalias nocapture dereferenceable(4) {{%.*}}, ptr noalias nocapture dereferenceable(40) {{%.*}}, ptr noalias {{%.*}}, ptr noalias nocapture {{%.*}}, ptr %T) + // CHECK: call swiftcc void @arguments_in_def(ptr captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(40) {{%.*}}, ptr noalias {{%.*}}, ptr noalias captures(none) {{%.*}}, ptr %T) %g = function_ref @arguments_in_def : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> () %y = apply %g(%1, %2, %3, %4, %5, %6) : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> () return undef : $() } -// CHECK-LABEL: declare{{( dllimport)?}} swiftcc void @arguments_in_decl(ptr nocapture dereferenceable(4), ptr noalias nocapture dereferenceable(4), ptr noalias nocapture dereferenceable(4), ptr noalias nocapture dereferenceable(40), ptr noalias, ptr noalias nocapture, ptr) +// CHECK-LABEL: declare{{( dllimport)?}} swiftcc void @arguments_in_decl(ptr captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(40), ptr noalias, ptr noalias nocapture, ptr) sil @arguments_in_decl : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> () -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @arguments_in_def_out(ptr noalias nocapture sret({{.*}}) %0, ptr nocapture dereferenceable(4) %1, ptr noalias nocapture dereferenceable(4) %2, ptr noalias nocapture dereferenceable(4) %3, ptr noalias nocapture dereferenceable(40) %4, ptr noalias %5, ptr noalias nocapture %6, ptr %T) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @arguments_in_def_out(ptr noalias captures(none) sret({{.*}}) %0, ptr captures(none) dereferenceable(4) %1, ptr noalias captures(none) dereferenceable(4) %2, ptr noalias captures(none) dereferenceable(4) %3, ptr noalias captures(none) dereferenceable(40) %4, ptr noalias %5, ptr noalias captures(none) %6, ptr %T) sil @arguments_in_def_out : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> @out Builtin.Int32 { entry(%0 : $*Builtin.Int32, %1 : $*Builtin.Int32, %2 : $*Builtin.Int32, %3 : $*Builtin.Int32, %4 : $Huge, %5 : $*T, %6 : $*()): - // CHECK: call swiftcc void @arguments_in_decl_out(ptr noalias nocapture sret({{.*}}) {{%.*}}, ptr nocapture dereferenceable(4) {{%.*}}, ptr noalias nocapture dereferenceable(4) {{%.*}}, ptr noalias nocapture dereferenceable(4) {{%.*}}, ptr noalias nocapture dereferenceable(40) {{%.*}}, ptr noalias {{%.*}}, ptr noalias nocapture {{%.*}}, ptr {{%.*}}) + // CHECK: call swiftcc void @arguments_in_decl_out(ptr noalias captures(none) sret({{.*}}) {{%.*}}, ptr captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(40) {{%.*}}, ptr noalias {{%.*}}, ptr noalias captures(none) {{%.*}}, ptr {{%.*}}) %f = function_ref @arguments_in_decl_out : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> @out Builtin.Int32 %x = apply %f(%0, %1, %2, %3, %4, %5, %6) : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> @out Builtin.Int32 - // CHECK: call swiftcc void @arguments_in_def_out(ptr noalias nocapture sret({{.*}}) {{%.*}}, ptr nocapture dereferenceable(4) {{%.*}}, ptr noalias nocapture dereferenceable(4) {{%.*}}, ptr noalias nocapture dereferenceable(4) {{%.*}}, ptr noalias nocapture dereferenceable(40) {{%.*}}, ptr noalias {{%.*}}, ptr noalias nocapture {{%.*}}, ptr {{%.*}}) + // CHECK: call swiftcc void @arguments_in_def_out(ptr noalias captures(none) sret({{.*}}) {{%.*}}, ptr captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(40) {{%.*}}, ptr noalias {{%.*}}, ptr noalias captures(none) {{%.*}}, ptr {{%.*}}) %g = function_ref @arguments_in_def_out : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> @out Builtin.Int32 %y = apply %g(%0, %1, %2, %3, %4, %5, %6) : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> @out Builtin.Int32 return undef : $() } -// CHECK-LABEL: declare{{( dllimport)?}} swiftcc void @arguments_in_decl_out(ptr noalias nocapture sret({{.*}}), ptr nocapture dereferenceable(4), ptr noalias nocapture dereferenceable(4), ptr noalias nocapture dereferenceable(4), ptr noalias nocapture dereferenceable(40), ptr noalias, ptr noalias nocapture, ptr) +// CHECK-LABEL: declare{{( dllimport)?}} swiftcc void @arguments_in_decl_out(ptr noalias captures(none) sret({{.*}}), ptr captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(40), ptr noalias, ptr noalias nocapture, ptr) sil @arguments_in_decl_out : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> @out Builtin.Int32 -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @arguments_in_def_huge_ret(ptr noalias nocapture sret({{.*}}V) %0, ptr nocapture dereferenceable(4) %1, ptr noalias nocapture dereferenceable(4) %2, ptr noalias nocapture dereferenceable(4) %3, ptr noalias nocapture dereferenceable(40) %4, ptr noalias %5, ptr noalias nocapture %6, ptr %T) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @arguments_in_def_huge_ret(ptr noalias captures(none) sret({{.*}}V) %0, ptr captures(none) dereferenceable(4) %1, ptr noalias captures(none) dereferenceable(4) %2, ptr noalias captures(none) dereferenceable(4) %3, ptr noalias captures(none) dereferenceable(40) %4, ptr noalias %5, ptr noalias captures(none) %6, ptr %T) sil @arguments_in_def_huge_ret : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> Huge { entry(%1 : $*Builtin.Int32, %2 : $*Builtin.Int32, %3 : $*Builtin.Int32, %4 : $Huge, %5 : $*T, %6 : $*()): %f = function_ref @arguments_in_decl_huge_ret : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> Huge - // CHECK: call swiftcc void @arguments_in_decl_huge_ret(ptr noalias nocapture sret({{.*}}) {{%.*}}, ptr nocapture dereferenceable(4) {{%.*}}, ptr noalias nocapture dereferenceable(4) {{%.*}}, ptr noalias nocapture dereferenceable(4) {{%.*}}, ptr noalias nocapture dereferenceable(40) {{%.*}}, ptr noalias {{%.*}}, ptr noalias nocapture {{%.*}}, ptr {{%.*}}) + // CHECK: call swiftcc void @arguments_in_decl_huge_ret(ptr noalias captures(none) sret({{.*}}) {{%.*}}, ptr captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(40) {{%.*}}, ptr noalias {{%.*}}, ptr noalias captures(none) {{%.*}}, ptr {{%.*}}) %x = apply %f(%1, %2, %3, %4, %5, %6) : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> Huge - // CHECK: call swiftcc void @arguments_in_def_huge_ret(ptr noalias nocapture sret({{.*}}) {{%.*}}, ptr nocapture dereferenceable(4) {{%.*}}, ptr noalias nocapture dereferenceable(4) {{%.*}}, ptr noalias nocapture dereferenceable(4) {{%.*}}, ptr noalias nocapture dereferenceable(40) {{%.*}}, ptr noalias {{%.*}}, ptr noalias nocapture {{%.*}}, ptr {{%.*}}) + // CHECK: call swiftcc void @arguments_in_def_huge_ret(ptr noalias captures(none) sret({{.*}}) {{%.*}}, ptr captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(40) {{%.*}}, ptr noalias {{%.*}}, ptr noalias captures(none) {{%.*}}, ptr {{%.*}}) %g = function_ref @arguments_in_def_huge_ret : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> Huge %y = apply %g(%1, %2, %3, %4, %5, %6) : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> Huge return %y : $Huge } -// CHECK-LABEL: declare{{( dllimport)?}} swiftcc void @arguments_in_decl_huge_ret(ptr noalias nocapture sret({{.*}}), ptr nocapture dereferenceable(4), ptr noalias nocapture dereferenceable(4), ptr noalias nocapture dereferenceable(4), ptr noalias nocapture dereferenceable(40), ptr noalias, ptr noalias nocapture, ptr) +// CHECK-LABEL: declare{{( dllimport)?}} swiftcc void @arguments_in_decl_huge_ret(ptr noalias captures(none) sret({{.*}}), ptr captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(40), ptr noalias, ptr noalias nocapture, ptr) sil @arguments_in_decl_huge_ret : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> Huge diff --git a/test/IRGen/async_dynamic_replacement.swift b/test/IRGen/async_dynamic_replacement.swift index bef67f42375f3..fb0e699ac4d35 100644 --- a/test/IRGen/async_dynamic_replacement.swift +++ b/test/IRGen/async_dynamic_replacement.swift @@ -26,7 +26,7 @@ public func calls_number() async -> Int { // CHECK-LABEL: define {{.*}}swifttailcc void @"$s25async_dynamic_replacement32indirectReturnDynamicReplaceableSi_S6ityYaKF"(ptr {{.*}}%0, ptr swiftasync %1) // CHECK: forward_to_replaced: -// CHECK: musttail call swifttailcc void {{.*}}(ptr noalias nocapture %0, ptr swiftasync {{.*}}) +// CHECK: musttail call swifttailcc void {{.*}}(ptr noalias captures(none) %0, ptr swiftasync {{.*}}) public dynamic func indirectReturnDynamicReplaceable() async throws -> (Int, Int, Int, Int, Int, Int, Int) { return (0, 0, 0, 0, 0, 0, 0) } diff --git a/test/IRGen/big_types_corner_cases.sil b/test/IRGen/big_types_corner_cases.sil index 270cd16c66cf1..cd1b8a307e5d0 100644 --- a/test/IRGen/big_types_corner_cases.sil +++ b/test/IRGen/big_types_corner_cases.sil @@ -38,7 +38,7 @@ public struct BigBigStruct { } // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @testBitfieldInBlock -// CHECK: call void {{%.*}}(ptr noalias nocapture sret({{.*}}) {{%.*}}, ptr {{%.*}}, ptr byval({{.*}}) align 8 {{%.*}}) +// CHECK: call void {{%.*}}(ptr noalias captures(none) sret({{.*}}) {{%.*}}, ptr {{%.*}}, ptr byval({{.*}}) align 8 {{%.*}}) sil @testBitfieldInBlock : $@convention(thin) (@owned @convention(block) (BitfieldOne) -> BitfieldOne, BitfieldOne) -> BitfieldOne { entry(%b : $@convention(block) (BitfieldOne) -> BitfieldOne, %x : $BitfieldOne): %r = apply %b(%x) : $@convention(block) (BitfieldOne) -> BitfieldOne @@ -46,7 +46,7 @@ entry(%b : $@convention(block) (BitfieldOne) -> BitfieldOne, %x : $BitfieldOne): } // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @testTupleExtract -// CHECK: call void {{%.*}}(ptr noalias nocapture sret({{.*}}) {{%.*}}, ptr {{%.*}}, ptr byval({{.*}}) align 8 {{%.*}}) +// CHECK: call void {{%.*}}(ptr noalias captures(none) sret({{.*}}) {{%.*}}, ptr {{%.*}}, ptr byval({{.*}}) align 8 {{%.*}}) sil @testTupleExtract : $@convention(thin) (@owned (BitfieldOne, @convention(block) (BitfieldOne) -> BitfieldOne), BitfieldOne) -> BitfieldOne { entry(%b : $(BitfieldOne, @convention(block) (BitfieldOne) -> (BitfieldOne)), %x : $BitfieldOne): %a = tuple_extract %b : $(BitfieldOne, @convention(block) (BitfieldOne) -> (BitfieldOne)), 1 @@ -54,9 +54,9 @@ entry(%b : $(BitfieldOne, @convention(block) (BitfieldOne) -> (BitfieldOne)), %x return %r : $BitfieldOne } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @testBigTempStruct(ptr noalias nocapture sret({{.*}}) %0, ptr %1, ptr %Element) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @testBigTempStruct(ptr noalias captures(none) sret({{.*}}) %0, ptr %1, ptr %Element) // CHECK: [[ALLOC:%.*]] = alloca %T22big_types_corner_cases13BigTempStructV -// CHECK: call swiftcc void @testBigTempStruct(ptr noalias nocapture sret({{.*}}) [[ALLOC]], ptr %1, ptr %Element) +// CHECK: call swiftcc void @testBigTempStruct(ptr noalias captures(none) sret({{.*}}) [[ALLOC]], ptr %1, ptr %Element) // CHECK: ret void sil @testBigTempStruct : $@convention(method) (@guaranteed _ArrayBuffer) -> @owned BigTempStruct { bb0(%0 : $_ArrayBuffer): @@ -66,9 +66,9 @@ bb0(%0 : $_ArrayBuffer): return %9 : $BigTempStruct } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @testTryApply(ptr noalias nocapture sret({{.*}}) %0, ptr %1, ptr %2, ptr swiftself %3, ptr noalias nocapture swifterror dereferenceable(8) %4) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @testTryApply(ptr noalias captures(none) sret({{.*}}) %0, ptr %1, ptr %2, ptr swiftself %3, ptr noalias captures(none) swifterror dereferenceable(8) %4) // CHECK: [[ALLOC:%.*]] = alloca %T22big_types_corner_cases9BigStructV -// CHECK: call swiftcc void {{.*}}(ptr noalias nocapture sret({{.*}}) [[ALLOC]] +// CHECK: call swiftcc void {{.*}}(ptr noalias captures(none) sret({{.*}}) [[ALLOC]] // CHECK: ret void sil @testTryApply : $@convention(thin)(() -> (@owned BigStruct, @error Error)) -> (@owned BigStruct, @error Error) { bb0(%0 : $() -> (@owned BigStruct, @error Error)): @@ -82,8 +82,8 @@ bb2(%err : $Error): throw %err : $Error } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @testFuncWithModBlockStorageApply(ptr nocapture dereferenceable({{.*}}) %0, ptr noalias nocapture dereferenceable({{.*}}) -// CHECK: call swiftcc void {{.*}}(ptr noalias nocapture dereferenceable({{.*}}) %1 +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @testFuncWithModBlockStorageApply(ptr captures(none) dereferenceable({{.*}}) %0, ptr noalias captures(none) dereferenceable({{.*}}) +// CHECK: call swiftcc void {{.*}}(ptr noalias captures(none) dereferenceable({{.*}}) %1 // CHECK: ret void sil @testFuncWithModBlockStorageApply : $@convention(thin) (@inout_aliasable @block_storage @callee_owned (@owned BigStruct) -> (), BigStruct) -> () { // %0 // user: %5 @@ -109,7 +109,7 @@ sil public_external @c_return_func : $@convention(thin) () -> () -> @owned BigSt // CHECK: [[RET:%.*]] = insertvalue { ptr, ptr } { ptr @"$s17part_apply_calleeTA", ptr undef }, ptr // CHECK: ret { ptr, ptr } [[RET]] -// CHECK-LABEL: define internal swiftcc void @"$s17part_apply_calleeTA"(ptr noalias nocapture sret({{.*}}) %0, i64 %1, ptr swiftself %2) +// CHECK-LABEL: define internal swiftcc void @"$s17part_apply_calleeTA"(ptr noalias captures(none) sret({{.*}}) %0, i64 %1, ptr swiftself %2) // CHECK: ret void sil @part_apply_caller : $@convention(thin) () -> @owned @callee_owned (@owned Builtin.Int64) -> @owned BigStruct { @@ -174,12 +174,12 @@ sil @get_optional_none : $@convention(method) <τ_0_0> (@thin Optional<τ_0_0>.T sil @short_circuit_operation : $@convention(thin) <τ_0_0> (@in Optional<τ_0_0>, @owned @callee_owned () -> (@out τ_0_0, @error Error)) -> (@out τ_0_0, @error Error) sil @autoclosure_partialapply : $@convention(thin) (@owned @callee_owned () -> (BigStruct, @error Error)) -> (@out BigStruct, @error Error) -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @closure(ptr noalias nocapture sret({{.*}}) %0, ptr %1) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @closure(ptr noalias captures(none) sret({{.*}}) %0, ptr %1) // CHECK-64: [[ALLOC1:%.*]] = alloca %T22big_types_corner_cases9BigStructV // CHECK-64: [[ALLOC2:%.*]] = alloca %T22big_types_corner_cases9BigStructV // CHECK-64: [[ALLOC3:%.*]] = alloca %T22big_types_corner_cases9BigStructVSg // CHECK-64: [[ALLOC4:%.*]] = alloca %T22big_types_corner_cases9BigStructVSg -// CHECK-64: call swiftcc void @"$s22big_types_corner_cases8SuperSubC1fyyFAA9BigStructVycfU_AFyKXKfu_TA"(ptr noalias nocapture sret({{.*}}) [[ALLOC1]], ptr swiftself {{.*}}, ptr nocapture swifterror %swifterror) +// CHECK-64: call swiftcc void @"$s22big_types_corner_cases8SuperSubC1fyyFAA9BigStructVycfU_AFyKXKfu_TA"(ptr noalias captures(none) sret({{.*}}) [[ALLOC1]], ptr swiftself {{.*}}, ptr captures(none) swifterror %swifterror) // CHECK: ret void sil @closure : $@convention(thin) (@owned SuperSub) -> BigStruct { bb0(%0 : $SuperSub): @@ -218,7 +218,7 @@ sil @returnBigStruct : $@convention(thin) () -> @owned BigStruct // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @closureToConvert() // CHECK: entry: // CHECK: [[ALLOC:%.*]] = alloca %T22big_types_corner_cases9BigStructV -// CHECK: call swiftcc void @returnBigStruct(ptr noalias nocapture sret({{.*}}) [[ALLOC]]) +// CHECK: call swiftcc void @returnBigStruct(ptr noalias captures(none) sret({{.*}}) [[ALLOC]]) // CHECK: ret void // CHECK-LABEL: } sil @closureToConvert : $@convention(thin) () -> () { @@ -246,11 +246,11 @@ bb0: sil @convertToThickHelper : $@convention(thin) (@owned BigStruct) -> () -// CHECK-LABAL: define {{.*}} swiftcc void @convertToThick(ptr noalias nocapture dereferenceable({{.*}}) %0) +// CHECK-LABAL: define {{.*}} swiftcc void @convertToThick(ptr noalias captures(none) dereferenceable({{.*}}) %0) // CHECK: entry: // CHECK: [[ALLOC:%.*]] = alloca %T22big_types_corner_cases9BigStructV, align 4 // CHECK: call void @llvm.memcpy.p0.p0.i64 -// CHECK: call swiftcc void @convertToThickHelper(ptr noalias nocapture dereferenceable({{.*}}) [[ALLOC]], ptr swiftself null) +// CHECK: call swiftcc void @convertToThickHelper(ptr noalias captures(none) dereferenceable({{.*}}) [[ALLOC]], ptr swiftself null) // CHECK: ret void // CHECK-LABEL: } sil @convertToThick : $@convention(thin) (@in BigStruct) -> () { diff --git a/test/IRGen/big_types_corner_cases.swift b/test/IRGen/big_types_corner_cases.swift index d63789ac579ec..15201ff63f3bd 100644 --- a/test/IRGen/big_types_corner_cases.swift +++ b/test/IRGen/big_types_corner_cases.swift @@ -46,7 +46,7 @@ let bigStructGlobalArray : [BigStruct] = [ BigStruct() ] -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} internal swiftcc void @"$s22big_types_corner_cases21OptionalInoutFuncTypeC7executeyys5Error_pSgFyyXEfU_"(ptr nocapture dereferenceable({{.*}}) %0, ptr %1, ptr nocapture dereferenceable({{.*}}) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} internal swiftcc void @"$s22big_types_corner_cases21OptionalInoutFuncTypeC7executeyys5Error_pSgFyyXEfU_"(ptr captures(none) dereferenceable({{.*}}) %0, ptr %1, ptr captures(none) dereferenceable({{.*}}) // CHECK: call void @"$s22big_types_corner_cases9BigStructVSgs5Error_pSgIegng_SgWOe // CHECK: call void @"$s22big_types_corner_cases9BigStructVSgs5Error_pSgIegng_SgWOy // CHECK: ret void @@ -66,9 +66,9 @@ public func f3_uses_f2() { } // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s22big_types_corner_cases10f3_uses_f2yyF"() -// CHECK: call swiftcc void @"$s22big_types_corner_cases9BigStructVACycfC"(ptr noalias nocapture sret({{.*}}) +// CHECK: call swiftcc void @"$s22big_types_corner_cases9BigStructVACycfC"(ptr noalias captures(none) sret({{.*}}) // CHECK: call swiftcc { ptr, ptr } @"$s22big_types_corner_cases13f2_returns_f1AA9BigStructVADcyF"() -// CHECK: call swiftcc void {{.*}}(ptr noalias nocapture sret({{.*}}) {{.*}}, ptr noalias nocapture dereferenceable({{.*}}) {{.*}}, ptr swiftself {{.*}}) +// CHECK: call swiftcc void {{.*}}(ptr noalias captures(none) sret({{.*}}) {{.*}}, ptr noalias captures(none) dereferenceable({{.*}}) {{.*}}, ptr swiftself {{.*}}) // CHECK: ret void public func f4_tuple_use_of_f2() { @@ -81,7 +81,7 @@ public func f4_tuple_use_of_f2() { // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s22big_types_corner_cases18f4_tuple_use_of_f2yyF"() // CHECK: [[TUPLE:%.*]] = call swiftcc { ptr, ptr } @"$s22big_types_corner_cases13f2_returns_f1AA9BigStructVADcyF"() // CHECK: [[TUPLE_EXTRACT:%.*]] = extractvalue { ptr, ptr } [[TUPLE]], 0 -// CHECK: call swiftcc void [[TUPLE_EXTRACT]](ptr noalias nocapture sret({{.*}}) {{.*}}, ptr noalias nocapture dereferenceable({{.*}}) {{.*}}, ptr swiftself %{{.*}}) +// CHECK: call swiftcc void [[TUPLE_EXTRACT]](ptr noalias captures(none) sret({{.*}}) {{.*}}, ptr noalias captures(none) dereferenceable({{.*}}) {{.*}}, ptr swiftself %{{.*}}) // CHECK: ret void public class BigClass { @@ -95,8 +95,8 @@ public class BigClass { } } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} hidden swiftcc void @"$s22big_types_corner_cases8BigClassC03useE6Struct0aH0yAA0eH0V_tF"(ptr noalias nocapture dereferenceable({{.*}}) %0, ptr swiftself %1) -// CHECK: call swiftcc void {{.*}}(ptr noalias nocapture dereferenceable({{.*}}) %0, ptr swiftself +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} hidden swiftcc void @"$s22big_types_corner_cases8BigClassC03useE6Struct0aH0yAA0eH0V_tF"(ptr noalias captures(none) dereferenceable({{.*}}) %0, ptr swiftself %1) +// CHECK: call swiftcc void {{.*}}(ptr noalias captures(none) dereferenceable({{.*}}) %0, ptr swiftself // CHECK: ret void public struct MyStruct { @@ -134,17 +134,17 @@ public func enumCallee(_ x: LargeEnum) { case .Empty2: break } } -// CHECK-64-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s22big_types_corner_cases10enumCalleeyyAA9LargeEnumOF"(ptr noalias nocapture dereferenceable({{.*}}) %0) #0 { +// CHECK-64-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s22big_types_corner_cases10enumCalleeyyAA9LargeEnumOF"(ptr noalias captures(none) dereferenceable({{.*}}) %0) #0 { // CHECK-64: alloca %T22big_types_corner_cases9LargeEnumO05InnerF0O // CHECK-64: alloca %T22big_types_corner_cases9LargeEnumO // CHECK-64: $ss5print_9separator10terminatoryypd_S2StF // CHECK-64: ret void -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} internal swiftcc void @"$s22big_types_corner_cases8SuperSubC1fyyFAA9BigStructVycfU_"(ptr noalias nocapture sret({{.*}}) %0, ptr %1) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} internal swiftcc void @"$s22big_types_corner_cases8SuperSubC1fyyFAA9BigStructVycfU_"(ptr noalias captures(none) sret({{.*}}) %0, ptr %1) // CHECK-64: [[ALLOC1:%.*]] = alloca %T22big_types_corner_cases9BigStructV // CHECK-64: [[ALLOC2:%.*]] = alloca %T22big_types_corner_cases9BigStructV // CHECK-64: [[ALLOC3:%.*]] = alloca %T22big_types_corner_cases9BigStructVSg -// CHECK-64: call swiftcc void @"$s22big_types_corner_cases9SuperBaseC4boomAA9BigStructVyF"(ptr noalias nocapture sret({{.*}}) [[ALLOC1]], ptr swiftself {{.*}}) +// CHECK-64: call swiftcc void @"$s22big_types_corner_cases9SuperBaseC4boomAA9BigStructVyF"(ptr noalias captures(none) sret({{.*}}) [[ALLOC1]], ptr swiftself {{.*}}) // CHECK: ret void class SuperBase { func boom() -> BigStruct { @@ -164,10 +164,10 @@ class SuperSub : SuperBase { } } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s22big_types_corner_cases10MUseStructV16superclassMirrorAA03BigF0VSgvg"(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture swiftself dereferenceable({{.*}}) %1) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s22big_types_corner_cases10MUseStructV16superclassMirrorAA03BigF0VSgvg"(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias captures(none) swiftself dereferenceable({{.*}}) %1) // CHECK: [[ALLOC:%.*]] = alloca %T22big_types_corner_cases9BigStructVSg // CHECK: [[LOAD:%.*]] = load ptr, ptr %.callInternalLet.data -// CHECK: call swiftcc void %{{[0-9]+}}(ptr noalias nocapture sret({{.*}}) [[ALLOC]], ptr swiftself [[LOAD]]) +// CHECK: call swiftcc void %{{[0-9]+}}(ptr noalias captures(none) sret({{.*}}) [[ALLOC]], ptr swiftself [[LOAD]]) // CHECK: ret void public struct MUseStruct { var x = BigStruct() @@ -296,9 +296,9 @@ public extension QueryHandler { body(query) } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s22big_types_corner_cases12QueryHandlerPAAE13forceHandle_25query8ReturnedQyd___AA9BigStructVSgtqd___tAA0E0Rd__lF"(ptr noalias nocapture sret({{.*}}) %0, ptr noalias %1, ptr noalias %2, ptr{{.*}}, ptr{{.*}}, ptr {{.*}}.QueryHandler, ptr {{.*}}.Query, ptr noalias swiftself %3) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s22big_types_corner_cases12QueryHandlerPAAE13forceHandle_25query8ReturnedQyd___AA9BigStructVSgtqd___tAA0E0Rd__lF"(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias %1, ptr noalias %2, ptr{{.*}}, ptr{{.*}}, ptr {{.*}}.QueryHandler, ptr {{.*}}.Query, ptr noalias swiftself %3) // CHECK: [[ALLOC:%.*]] = alloca %T22big_types_corner_cases9BigStructVSg -// CHECK: call swiftcc void {{.*}}(ptr noalias nocapture sret({{.*}}) [[ALLOC]], ptr noalias {{.*}}, ptr noalias {{.*}}, ptr swiftself {{.*}}) +// CHECK: call swiftcc void {{.*}}(ptr noalias captures(none) sret({{.*}}) [[ALLOC]], ptr noalias {{.*}}, ptr noalias {{.*}}, ptr swiftself {{.*}}) // CHECK: ret void func forceHandle_2(query: Q) -> (Q.Returned, BigStruct?) { guard let body = handle_2 as? (Q) -> (Q.Returned, BigStruct?) else { @@ -307,11 +307,11 @@ public extension QueryHandler { return body(query) } -// CHECK-LABEL-64: define{{( dllexport)?}}{{( protected)?}} swiftcc { i64, i64 } @"$s22big_types_corner_cases12QueryHandlerPAAE13forceHandle_35query8ReturnedQyd___SbAA9BigStructVcSgtqd___tAA0E0Rd__lF"(ptr noalias %0, ptr noalias nocapture %1, ptr{{.*}}, ptr{{.*}}, ptr {{.*}}.QueryHandler, ptr {{.*}}.Query, ptr noalias nocapture swiftself %2) +// CHECK-LABEL-64: define{{( dllexport)?}}{{( protected)?}} swiftcc { i64, i64 } @"$s22big_types_corner_cases12QueryHandlerPAAE13forceHandle_35query8ReturnedQyd___SbAA9BigStructVcSgtqd___tAA0E0Rd__lF"(ptr noalias %0, ptr noalias captures(none) %1, ptr{{.*}}, ptr{{.*}}, ptr {{.*}}.QueryHandler, ptr {{.*}}.Query, ptr noalias captures(none) swiftself %2) // CHECK-64: {{.*}} = call swiftcc { i64, i64 } {{.*}}(ptr noalias {{.*}}, ptr noalias {{.*}}, ptr swiftself {{.*}}) // CHECK-64: ret { i64, i64 } -// CHECK-LABEL-32: define{{( dllexport)?}}{{( protected)?}} swiftcc { i32, i32} @"$s22big_types_corner_cases12QueryHandlerPAAE13forceHandle_35query8ReturnedQyd___SbAA9BigStructVcSgtqd___tAA0E0Rd__lF"(ptr noalias %0, ptr noalias nocapture %1, ptr{{.*}}, ptr{{.*}}, ptr {{.*}}.QueryHandler, ptr {{.*}}.Query, ptr noalias nocapture swiftself %2) +// CHECK-LABEL-32: define{{( dllexport)?}}{{( protected)?}} swiftcc { i32, i32} @"$s22big_types_corner_cases12QueryHandlerPAAE13forceHandle_35query8ReturnedQyd___SbAA9BigStructVcSgtqd___tAA0E0Rd__lF"(ptr noalias %0, ptr noalias captures(none) %1, ptr{{.*}}, ptr{{.*}}, ptr {{.*}}.QueryHandler, ptr {{.*}}.Query, ptr noalias captures(none) swiftself %2) // CHECK-32: {{.*}} = call swiftcc { i32, i32 } {{.*}}(ptr noalias {{.*}}, ptr noalias {{.*}}, ptr swiftself {{.*}}) // CHECK-32: ret { i32, i32 } func forceHandle_3(query: Q) -> (Q.Returned, Filter?) { @@ -321,12 +321,12 @@ public extension QueryHandler { return body(query) } -// CHECK-LABEL-64: define{{( dllexport)?}}{{( protected)?}} swiftcc { i64, i64 } @"$s22big_types_corner_cases12QueryHandlerPAAE13forceHandle_45query8ReturnedQyd___SbAA9BigStructVcSgtqd___tKAA0E0Rd__lF"(ptr noalias %0, ptr noalias nocapture %1, ptr{{.*}}, ptr{{.*}}, ptr {{.*}}.QueryHandler, ptr {{.*}}.Query, ptr noalias nocapture swiftself %2, ptr swifterror %3) -// CHECK-64: {{.*}} = call swiftcc { i64, i64 } {{.*}}(ptr noalias {{.*}}, ptr noalias {{.*}}, ptr swiftself {{.*}}, ptr noalias nocapture swifterror {{.*}}) +// CHECK-LABEL-64: define{{( dllexport)?}}{{( protected)?}} swiftcc { i64, i64 } @"$s22big_types_corner_cases12QueryHandlerPAAE13forceHandle_45query8ReturnedQyd___SbAA9BigStructVcSgtqd___tKAA0E0Rd__lF"(ptr noalias %0, ptr noalias captures(none) %1, ptr{{.*}}, ptr{{.*}}, ptr {{.*}}.QueryHandler, ptr {{.*}}.Query, ptr noalias captures(none) swiftself %2, ptr swifterror %3) +// CHECK-64: {{.*}} = call swiftcc { i64, i64 } {{.*}}(ptr noalias {{.*}}, ptr noalias {{.*}}, ptr swiftself {{.*}}, ptr noalias captures(none) swifterror {{.*}}) // CHECK-64: ret { i64, i64 } -// CHECK-LABEL-32: define{{( dllexport)?}}{{( protected)?}} swiftcc { i32, i32} @"$s22big_types_corner_cases12QueryHandlerPAAE13forceHandle_45query8ReturnedQyd___SbAA9BigStructVcSgtqd___tKAA0E0Rd__lF"(ptr noalias %0, ptr noalias nocapture %1, ptr{{.*}}, ptr{{.*}}, ptr {{.*}}.QueryHandler, ptr {{.*}}.Query, ptr noalias nocapture swiftself %2, ptr swifterror %3) -// CHECK-32: {{.*}} = call swiftcc { i32, i32 } {{.*}}(ptr noalias {{.*}}, ptr noalias {{.*}}, ptr swiftself {{.*}}, ptr noalias nocapture {{.*}}) +// CHECK-LABEL-32: define{{( dllexport)?}}{{( protected)?}} swiftcc { i32, i32} @"$s22big_types_corner_cases12QueryHandlerPAAE13forceHandle_45query8ReturnedQyd___SbAA9BigStructVcSgtqd___tKAA0E0Rd__lF"(ptr noalias %0, ptr noalias captures(none) %1, ptr{{.*}}, ptr{{.*}}, ptr {{.*}}.QueryHandler, ptr {{.*}}.Query, ptr noalias captures(none) swiftself %2, ptr swifterror %3) +// CHECK-32: {{.*}} = call swiftcc { i32, i32 } {{.*}}(ptr noalias {{.*}}, ptr noalias {{.*}}, ptr swiftself {{.*}}, ptr noalias captures(none) {{.*}}) // CHECK-32: ret { i32, i32 } func forceHandle_4(query: Q) throws -> (Q.Returned, Filter?) { guard let body = handle_4 as? (Q) throws -> (Q.Returned, Filter?) else { diff --git a/test/IRGen/big_types_corner_cases_tiny.swift b/test/IRGen/big_types_corner_cases_tiny.swift index 3907e86260804..5ac56700330e7 100644 --- a/test/IRGen/big_types_corner_cases_tiny.swift +++ b/test/IRGen/big_types_corner_cases_tiny.swift @@ -6,6 +6,6 @@ // CHECK-LABEL: define internal void @{{.*}}WZ // CHECK: [[ALLOC:%.*]] = alloca %T27big_types_corner_cases_tiny30LoadableStructWithBiggerStringV -// CHECK: call swiftcc void {{.*}}(ptr noalias nocapture sret({{.*}}) [[ALLOC]] +// CHECK: call swiftcc void {{.*}}(ptr noalias captures(none) sret({{.*}}) [[ALLOC]] let model = ClassWithLoadableStructWithBiggerString().f() diff --git a/test/IRGen/big_types_tests.sil b/test/IRGen/big_types_tests.sil index acd9a7161a75b..dfea630d68daa 100644 --- a/test/IRGen/big_types_tests.sil +++ b/test/IRGen/big_types_tests.sil @@ -19,7 +19,7 @@ public struct BigStruct { var i8 : Int32 = 8 } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @testDestroyValue(ptr noalias nocapture dereferenceable({{.*}}) #0 { +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @testDestroyValue(ptr noalias captures(none) dereferenceable({{.*}}) #0 { // CHECK-NEXT: entry // CHECK-NEXT: ret void sil @testDestroyValue : $@convention(thin) (@owned BigStruct) -> () { diff --git a/test/IRGen/builtin_pack_length.swift b/test/IRGen/builtin_pack_length.swift index e543df1d4e020..10de5b275c66e 100644 --- a/test/IRGen/builtin_pack_length.swift +++ b/test/IRGen/builtin_pack_length.swift @@ -31,7 +31,7 @@ func weirdPackCountUse1(_ x: repeat each T) -> Builtin.Word { } struct Pack { -// CHECK: define {{.*}} @"$s8builtins4PackV5countBwvgZ"(i64 returned [[PACK_COUNT:%.*]], ptr nocapture readnone %"each T") +// CHECK: define {{.*}} @"$s8builtins4PackV5countBwvgZ"(i64 returned [[PACK_COUNT:%.*]], ptr captures(none) readnone %"each T") // CHECK-NEXT: entry: // CHECK-NEXT: ret i64 [[PACK_COUNT]] static var count: Builtin.Word { diff --git a/test/IRGen/builtins.swift b/test/IRGen/builtins.swift index 6cd0d59b5d317..20d447d2ec329 100644 --- a/test/IRGen/builtins.swift +++ b/test/IRGen/builtins.swift @@ -638,11 +638,11 @@ func zeroInitializerEmpty() { // isUnique variants // ---------------------------------------------------------------------------- -// CHECK: define hidden {{.*}}void @"$s8builtins26acceptsBuiltinNativeObjectyyBoSgzF"(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK: define hidden {{.*}}void @"$s8builtins26acceptsBuiltinNativeObjectyyBoSgzF"(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { func acceptsBuiltinNativeObject(_ ref: inout Builtin.NativeObject?) {} // native -// CHECK-LABEL: define hidden {{.*}}i1 @"$s8builtins8isUniqueyBi1_BoSgzF"(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-LABEL: define hidden {{.*}}i1 @"$s8builtins8isUniqueyBi1_BoSgzF"(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { // CHECK-NEXT: entry: // CHECK: %[[LD_RC:.+]] = load ptr, ptr %0 // CHECK-NEXT: %[[RET:.+]] = call zeroext i1 @swift_isUniquelyReferenced_native(ptr %[[LD_RC]]) @@ -652,7 +652,7 @@ func isUnique(_ ref: inout Builtin.NativeObject?) -> Bool { } // native nonNull -// CHECK-LABEL: define hidden {{.*}}i1 @"$s8builtins8isUniqueyBi1_BozF"(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-LABEL: define hidden {{.*}}i1 @"$s8builtins8isUniqueyBi1_BozF"(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { // CHECK-NEXT: entry: // CHECK: %[[LD_RC:.+]] = load ptr, ptr %0 // CHECK: %[[RET:.+]] = call zeroext i1 @swift_isUniquelyReferenced_nonNull_native(ptr %[[LD_RC]]) @@ -661,11 +661,11 @@ func isUnique(_ ref: inout Builtin.NativeObject) -> Bool { return Builtin.isUnique(&ref) } -// CHECK: define hidden {{.*}}void @"$s8builtins16acceptsAnyObjectyyyXlSgzF"(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK: define hidden {{.*}}void @"$s8builtins16acceptsAnyObjectyyyXlSgzF"(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { func acceptsAnyObject(_ ref: inout Builtin.AnyObject?) {} // ObjC -// CHECK-LABEL: define hidden {{.*}}i1 @"$s8builtins8isUniqueyBi1_yXlSgzF"(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-LABEL: define hidden {{.*}}i1 @"$s8builtins8isUniqueyBi1_yXlSgzF"(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { // CHECK-NEXT: entry: // CHECK: [[ADDR:%.+]] = getelementptr inbounds [[OPTIONAL_ANYOBJECT_TY:%.*]], ptr %0, i32 0, i32 0 // CHECK-NEXT: [[REF:%.+]] = load ptr, ptr [[ADDR]] @@ -678,7 +678,7 @@ func isUnique(_ ref: inout Builtin.AnyObject?) -> Bool { // ObjC nonNull // CHECK-LABEL: define hidden {{.*}}i1 @"$s8builtins8isUniqueyBi1_yXlzF" -// CHECK-SAME: (ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-SAME: (ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { // CHECK-NEXT: entry: // CHECK: [[ADDR:%.+]] = getelementptr inbounds %AnyObject, ptr %0, i32 0, i32 0 // CHECK: [[REF:%.+]] = load ptr, ptr [[ADDR]] @@ -690,7 +690,7 @@ func isUnique(_ ref: inout Builtin.AnyObject) -> Bool { } // BridgeObject nonNull -// CHECK-LABEL: define hidden {{.*}}i1 @"$s8builtins8isUniqueyBi1_BbzF"(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-LABEL: define hidden {{.*}}i1 @"$s8builtins8isUniqueyBi1_BbzF"(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { // CHECK-NEXT: entry: // CHECK: %[[LD:.+]] = load ptr, ptr %0 // CHECK: %[[RET:.+]] = call zeroext i1 @swift_isUniquelyReferenced{{(NonObjC)?}}_nonNull_bridgeObject(ptr %[[LD]]) @@ -706,7 +706,7 @@ func assumeTrue(_ x: Builtin.Int1) { Builtin.assume_Int1(x) } // BridgeObject nonNull -// CHECK-LABEL: define hidden {{.*}}i1 @"$s8builtins15isUnique_nativeyBi1_BbzF"(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-LABEL: define hidden {{.*}}i1 @"$s8builtins15isUnique_nativeyBi1_BbzF"(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { // CHECK-NEXT: entry: // CHECK: %[[LD:.+]] = load ptr, ptr %0 // CHECK-NEXT: %[[RET:.+]] = call zeroext i1 @swift_isUniquelyReferenced_nonNull_native(ptr %[[LD]]) @@ -716,7 +716,7 @@ func isUnique_native(_ ref: inout Builtin.BridgeObject) -> Bool { } // ImplicitlyUnwrappedOptional argument to isUnique. -// CHECK-LABEL: define hidden {{.*}}i1 @"$s8builtins11isUniqueIUOyBi1_BoSgzF"(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-LABEL: define hidden {{.*}}i1 @"$s8builtins11isUniqueIUOyBi1_BoSgzF"(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { // CHECK-NEXT: entry: // CHECK: call zeroext i1 @swift_isUniquelyReferenced_native(ptr // CHECK: ret i1 diff --git a/test/IRGen/c_layout.sil b/test/IRGen/c_layout.sil index 6178b60f1d5d6..58fb788d65e5b 100644 --- a/test/IRGen/c_layout.sil +++ b/test/IRGen/c_layout.sil @@ -32,7 +32,7 @@ bb0: // CHECK-x86_64: [[RESULT:%.*]] = alloca %TSo11BitfieldOneV, align 8 // CHECK-x86_64: [[ARG:%.*]] = alloca %TSo11BitfieldOneV, align 8 // Make the first call and pull all the values out of the indirect result. -// CHECK-x86_64: call void @createBitfieldOne(ptr noalias nocapture sret({{.*}}) [[RESULT]]) +// CHECK-x86_64: call void @createBitfieldOne(ptr noalias captures(none) sret({{.*}}) [[RESULT]]) // CHECK-x86_64: [[ADDR_A:%.*]] = getelementptr inbounds %TSo11BitfieldOneV, ptr [[RESULT]], i32 0, i32 0 // CHECK-x86_64: [[ADDR_A_V:%.*]] = getelementptr inbounds %Ts6UInt32V, ptr [[ADDR_A]], i32 0, i32 0 // CHECK-x86_64: [[A:%.*]] = load i32, ptr [[ADDR_A_V]], align 8 @@ -102,7 +102,7 @@ sil public_external @consumeSIMDStruct : $@convention(c) (SIMDStruct) -> () // CHECK-x86_64-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @testSIMDStruct() // CHECK-SYSV-x86_64: call <3 x float> @createSIMDStruct -// CHECK-WIN-x86_64: call void @createSIMDStruct(ptr noalias nocapture sret({{.*}}) % +// CHECK-WIN-x86_64: call void @createSIMDStruct(ptr noalias captures(none) sret({{.*}}) % // CHECK-SYSV-x86_64: call void @consumeSIMDStruct(<3 x float> // CHECK-WIN-x86_64: call void @consumeSIMDStruct(ptr % sil @testSIMDStruct : $() -> () { @@ -389,8 +389,8 @@ entry(%b : $@convention(block) (CChar) -> CChar, %c : $CChar): } // CHECK-x86_64-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @testBitfieldInBlock -// CHECK-SYSV-x86_64: call void {{%.*}}(ptr noalias nocapture sret({{.*}}) {{%.*}}, ptr {{%.*}}, ptr byval({{.*}}) align 8 {{%.*}}) -// CHECK-WIN-x86_64: call void {{%.*}}(ptr noalias nocapture sret({{.*}}) {{%.*}}, ptr {{%.*}}, ptr {{%.*}}) +// CHECK-SYSV-x86_64: call void {{%.*}}(ptr noalias captures(none) sret({{.*}}) {{%.*}}, ptr {{%.*}}, ptr byval({{.*}}) align 8 {{%.*}}) +// CHECK-WIN-x86_64: call void {{%.*}}(ptr noalias captures(none) sret({{.*}}) {{%.*}}, ptr {{%.*}}, ptr {{%.*}}) sil @testBitfieldInBlock : $@convention(thin) (@owned @convention(block) (BitfieldOne) -> BitfieldOne, BitfieldOne) -> BitfieldOne { entry(%b : $@convention(block) (BitfieldOne) -> BitfieldOne, %x : $BitfieldOne): %r = apply %b(%x) : $@convention(block) (BitfieldOne) -> BitfieldOne diff --git a/test/IRGen/casts.sil b/test/IRGen/casts.sil index 13f0967353f4f..64b00ad43cd60 100644 --- a/test/IRGen/casts.sil +++ b/test/IRGen/casts.sil @@ -15,7 +15,7 @@ class B: A {} sil_vtable A {} sil_vtable B {} -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @unchecked_addr_cast(ptr noalias nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @unchecked_addr_cast(ptr noalias captures(none) dereferenceable({{.*}}) %0) {{.*}} { sil @unchecked_addr_cast : $(@in A) -> B { entry(%a : $*A): %b = unchecked_addr_cast %a : $*A to $*B diff --git a/test/IRGen/class_field_other_module.swift b/test/IRGen/class_field_other_module.swift index b74db17246396..ecd0e23285fec 100644 --- a/test/IRGen/class_field_other_module.swift +++ b/test/IRGen/class_field_other_module.swift @@ -7,7 +7,7 @@ import other_class -// CHECK-LABEL: define {{(protected )?}}{{(dllexport )?}}swiftcc i32 @"$s24class_field_other_module12getSubclassXys5Int32V0c1_A00F0CF"(ptr nocapture readonly %0) +// CHECK-LABEL: define {{(protected )?}}{{(dllexport )?}}swiftcc i32 @"$s24class_field_other_module12getSubclassXys5Int32V0c1_A00F0CF"(ptr captures(none) readonly %0) // CHECK-NEXT: entry: // An Int32 after the heap object header // CHECK-NEXT: [[GEP:%.*]] = getelementptr inbounds i8, ptr %0, i64 16 @@ -17,7 +17,7 @@ public func getSubclassX(_ o: Subclass) -> Int32 { return o.x } -// CHECK-LABEL: define {{(protected )?}}{{(dllexport )?}}swiftcc i32 @"$s24class_field_other_module12getSubclassYys5Int32V0c1_A00F0CF"(ptr nocapture readonly %0) +// CHECK-LABEL: define {{(protected )?}}{{(dllexport )?}}swiftcc i32 @"$s24class_field_other_module12getSubclassYys5Int32V0c1_A00F0CF"(ptr captures(none) readonly %0) // CHECK-NEXT: entry: // An Int32 after an Int32 after the heap object header // CHECK-NEXT: [[GEP:%.*]] = getelementptr inbounds i8, ptr %0, i64 20 diff --git a/test/IRGen/conditional_conformances_class_with_defaulted_method.swift b/test/IRGen/conditional_conformances_class_with_defaulted_method.swift index 1118b4ba4803d..05b321bd9b5ca 100644 --- a/test/IRGen/conditional_conformances_class_with_defaulted_method.swift +++ b/test/IRGen/conditional_conformances_class_with_defaulted_method.swift @@ -12,4 +12,4 @@ extension Foo { } class Box {} extension Box: Foo where T: Foo {} -// CHECK-LABEL: define internal swiftcc void @"$s1x3BoxCyqd__GAA3FooA2aEP3baryyFTW"(ptr noalias nocapture swiftself dereferenceable({{[48]}}) %0, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define internal swiftcc void @"$s1x3BoxCyqd__GAA3FooA2aEP3baryyFTW"(ptr noalias captures(none) swiftself dereferenceable({{[48]}}) %0, ptr %Self, ptr %SelfWitnessTable) diff --git a/test/IRGen/coroutine_accessors.swift b/test/IRGen/coroutine_accessors.swift index 48152378da682..7eba7101bf778 100644 --- a/test/IRGen/coroutine_accessors.swift +++ b/test/IRGen/coroutine_accessors.swift @@ -126,7 +126,7 @@ public var irm: Int { // CHECK-LABEL: define{{.*}} { ptr, ptr } @"$s19coroutine_accessors1SV3irmSivx"( // CHECK-SAME: ptr noalias [[FRAME:%[^,]+]], // CHECK-SAME: ptr swiftcoro [[ALLOCATOR:%[^,]+]], -// CHECK-SAME: ptr nocapture swiftself dereferenceable({{8|16}}) [[SELF:%[^)]+]] +// CHECK-SAME: ptr captures(none) swiftself dereferenceable({{8|16}}) [[SELF:%[^)]+]] // CHECK-SAME: ) // CHECK-SAME: { // CHECK: [[ID:%[^,]+]] = call token @llvm.coro.id.retcon.once.dynamic( @@ -293,7 +293,7 @@ public var force_yield_once_2_convention : () { // CHECK-LABEL: define{{.*}} { ptr, ptr } @increment_irm_yield_once_2( // ptr noalias %0 // CHECK-SAME: ptr swiftcoro [[ALLOCATOR:%[^,]+]] -// ptr nocapture swiftself dereferenceable(16) %2 +// ptr captures(none) swiftself dereferenceable(16) %2 // CHECK-SAME: ) // CHECK-SAME: { // : [[SIZE_32:%[^,]+]] = load i32 diff --git a/test/IRGen/coroutine_accessors_backdeploy_async_56.swift b/test/IRGen/coroutine_accessors_backdeploy_async_56.swift index 5ad8a79ac62d4..327fb4abd943a 100644 --- a/test/IRGen/coroutine_accessors_backdeploy_async_56.swift +++ b/test/IRGen/coroutine_accessors_backdeploy_async_56.swift @@ -126,7 +126,7 @@ public var i: Int { // CHECK-LABEL: define{{.*}} void @increment_i_async( // ptr swiftasync %0 -// CHECK-SAME: ptr nocapture swiftself dereferenceable({{8|4}}) %1 +// CHECK-SAME: ptr captures(none) swiftself dereferenceable({{8|4}}) %1 // CHECK-SAME: ) // CHECK-SAME: { // : [[SIZE_32:%[^,]+]] = load i32 diff --git a/test/IRGen/coroutine_accessors_backdeploy_async_57.swift b/test/IRGen/coroutine_accessors_backdeploy_async_57.swift index 117c310ef3aea..987332e34c1c8 100644 --- a/test/IRGen/coroutine_accessors_backdeploy_async_57.swift +++ b/test/IRGen/coroutine_accessors_backdeploy_async_57.swift @@ -101,7 +101,7 @@ public var i: Int { // CHECK-LABEL: define{{.*}} void @increment_i_async( // ptr swiftasync %0 -// CHECK-SAME: ptr nocapture swiftself dereferenceable({{8|4}}) %1 +// CHECK-SAME: ptr captures(none) swiftself dereferenceable({{8|4}}) %1 // CHECK-SAME: ) // CHECK-SAME: { // : [[SIZE_32:%[^,]+]] = load i32 diff --git a/test/IRGen/dependent_reabstraction.swift b/test/IRGen/dependent_reabstraction.swift index c0250b8f00b17..5eed638512ca9 100644 --- a/test/IRGen/dependent_reabstraction.swift +++ b/test/IRGen/dependent_reabstraction.swift @@ -8,7 +8,7 @@ protocol A { } struct X : A { - // CHECK-LABEL: define internal swiftcc void @"$s23dependent_reabstraction1XVyxGAA1AA2aEP1byy1BQzFTW"(ptr noalias nocapture dereferenceable({{.*}}) %0, ptr noalias nocapture swiftself %1, ptr %Self, ptr %SelfWitnessTable) + // CHECK-LABEL: define internal swiftcc void @"$s23dependent_reabstraction1XVyxGAA1AA2aEP1byy1BQzFTW"(ptr noalias captures(none) dereferenceable({{.*}}) %0, ptr noalias captures(none) swiftself %1, ptr %Self, ptr %SelfWitnessTable) func b(_ b: X.Type) { let x: Any = b markUsed(b as X.Type) diff --git a/test/IRGen/enum.sil b/test/IRGen/enum.sil index 22ad8968aa9cd..b1e0e1e44ae24 100644 --- a/test/IRGen/enum.sil +++ b/test/IRGen/enum.sil @@ -238,7 +238,7 @@ dest(%u2 : $(Builtin.Int64, Builtin.Int64)): return %x : $() } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @singleton_switch_indirect(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @singleton_switch_indirect(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { // CHECK: entry: // CHECK: br label %[[DEST:[0-9]+]] // CHECK: [[DEST]]: @@ -274,7 +274,7 @@ entry(%0 : $Builtin.Int64, %1 : $Builtin.Int64): return %u : $Singleton } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @singleton_inject_indirect(i64 %0, i64 %1, ptr nocapture dereferenceable({{.*}}) %2) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @singleton_inject_indirect(i64 %0, i64 %1, ptr captures(none) dereferenceable({{.*}}) %2) {{.*}} { // CHECK: entry: // CHECK: [[DATA_0_ADDR:%.*]] = getelementptr inbounds <{ i64, i64 }>, ptr %2, i32 0, i32 0 // CHECK: store i64 %0, ptr [[DATA_0_ADDR]] @@ -349,7 +349,7 @@ end: return %x : $() } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @no_payload_switch_indirect(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @no_payload_switch_indirect(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { sil @no_payload_switch_indirect : $@convention(thin) (@inout NoPayloads) -> () { entry(%u : $*NoPayloads): // CHECK: [[TAG_ADDR:%.*]] = getelementptr inbounds %T4enum10NoPayloadsO, ptr %0, i32 0, i32 0 @@ -398,7 +398,7 @@ entry: return %u : $NoPayloads } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @no_payload_inject_z_indirect(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @no_payload_inject_z_indirect(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { // CHECK: entry: // CHECK: [[TAG_ADDR:%.*]] = getelementptr inbounds %T4enum10NoPayloadsO, ptr %0, i32 0, i32 0 // CHECK: store i8 2, ptr [[TAG_ADDR]] @@ -629,7 +629,7 @@ entry(%0 : $Builtin.Word): return %u : $SinglePayloadNoXI2 } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @single_payload_no_xi_inject_x_indirect([[WORD]] %0, ptr nocapture dereferenceable({{.*}}) %1) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @single_payload_no_xi_inject_x_indirect([[WORD]] %0, ptr captures(none) dereferenceable({{.*}}) %1) {{.*}} { // CHECK: entry: // CHECK: store [[WORD]] %0, ptr %1 // CHECK: [[T0:%.*]] = getelementptr inbounds %T4enum18SinglePayloadNoXI2O, ptr %1, i32 0, i32 1 @@ -655,7 +655,7 @@ entry: return %u : $SinglePayloadNoXI2 } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @single_payload_no_xi_inject_y_indirect(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @single_payload_no_xi_inject_y_indirect(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { // CHECK: entry: // CHECK: store [[WORD]] 0, ptr %0 // CHECK: [[T0:%.*]] = getelementptr inbounds %T4enum18SinglePayloadNoXI2O, ptr %0, i32 0, i32 1 @@ -992,7 +992,7 @@ entry(%0 : $Builtin.Int63): return %u : $SinglePayloadSpareBit } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @single_payload_spare_bit_inject_x_indirect(i64 %0, ptr nocapture dereferenceable({{.*}}) %1) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @single_payload_spare_bit_inject_x_indirect(i64 %0, ptr captures(none) dereferenceable({{.*}}) %1) {{.*}} { // CHECK-64: entry: // CHECK-64: [[T:%.*]] = trunc i64 %0 to i63 // CHECK-64: [[BYTE:%.*]] = zext i63 [[T]] to i64 @@ -1019,7 +1019,7 @@ entry: return %u : $SinglePayloadSpareBit } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @single_payload_spare_bit_inject_y_indirect(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @single_payload_spare_bit_inject_y_indirect(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { // CHECK-64: entry: // -- 0x8000_0000_0000_0000 // CHECK-64: store i64 -9223372036854775808, ptr %0 @@ -1304,7 +1304,7 @@ end(%z : $()): return %z : $() } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc i8 @dynamic_single_payload_empty_payload_load(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc i8 @dynamic_single_payload_empty_payload_load(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { // CHECK: entry: // CHECK: %1 = load i8, ptr %0 // CHECK: ret i8 %1 @@ -1315,7 +1315,7 @@ entry(%p : $*DynamicSinglePayload<()>): return %x : $DynamicSinglePayload<()> } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @dynamic_single_payload_empty_payload_store(ptr nocapture dereferenceable({{.*}}) %0, i8 %1) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @dynamic_single_payload_empty_payload_store(ptr captures(none) dereferenceable({{.*}}) %0, i8 %1) {{.*}} { // CHECK: entry: // CHECK: store i8 %1, ptr %0 // CHECK: ret void @@ -1440,7 +1440,7 @@ end: return %v : $() } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_no_spare_bits_switch_indirect(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_no_spare_bits_switch_indirect(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { sil @multi_payload_no_spare_bits_switch_indirect : $(@inout MultiPayloadNoSpareBits) -> () { entry(%u : $*MultiPayloadNoSpareBits): // CHECK-64: [[PAYLOAD:%.*]] = load i64, ptr %0 @@ -1494,7 +1494,7 @@ entry(%0 : $Builtin.Int64): return %u : $MultiPayloadNoSpareBits } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_no_spare_bit_inject_x_indirect(i64 %0, ptr nocapture dereferenceable({{.*}}) %1) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_no_spare_bit_inject_x_indirect(i64 %0, ptr captures(none) dereferenceable({{.*}}) %1) {{.*}} { // CHECK-64: entry: // CHECK-64: store i64 %0, ptr %1 // CHECK-64: [[T0:%.*]] = getelementptr inbounds %T4enum23MultiPayloadNoSpareBitsO, ptr %1, i32 0, i32 1 @@ -1547,7 +1547,7 @@ entry: return %u : $MultiPayloadNoSpareBits } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_no_spare_bit_inject_a_indirect(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_no_spare_bit_inject_a_indirect(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { // CHECK-64: entry: // CHECK-64: store i64 0, ptr %0 // CHECK-64: [[T0:%.*]] = getelementptr inbounds %T4enum23MultiPayloadNoSpareBitsO, ptr %0, i32 0, i32 1 @@ -1738,7 +1738,7 @@ entry(%0 : $Builtin.Int62): return %u : $MultiPayloadOneSpareBit } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_one_spare_bit_inject_x_indirect(i64 %0, ptr nocapture dereferenceable({{.*}}) %1) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_one_spare_bit_inject_x_indirect(i64 %0, ptr captures(none) dereferenceable({{.*}}) %1) {{.*}} { // CHECK-64: entry: // CHECK-64: [[NATIVECC_TRUNC:%.*]] = trunc i64 %0 to i62 // CHECK-64: [[BYTE:%.*]] = zext i62 [[NATIVECC_TRUNC]] to i64 @@ -1776,7 +1776,7 @@ entry(%0 : $Builtin.Int63): return %u : $MultiPayloadOneSpareBit } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_one_spare_bit_inject_y_indirect(i64 %0, ptr nocapture dereferenceable({{.*}}) %1) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_one_spare_bit_inject_y_indirect(i64 %0, ptr captures(none) dereferenceable({{.*}}) %1) {{.*}} { // CHECK-64: entry: // CHECK-64: [[NATIVECC_TRUNC:%.*]] = trunc i64 %0 to i63 // CHECK-64: [[BYTE:%.*]] = zext i63 [[NATIVECC_TRUNC]] to i64 @@ -1826,7 +1826,7 @@ entry: return %u : $MultiPayloadOneSpareBit } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_one_spare_bit_inject_a_indirect(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_one_spare_bit_inject_a_indirect(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { // CHECK-64: entry: // -- 0x8000_0000_0000_0000 // CHECK-64: store i64 -9223372036854775808, ptr %0 @@ -1970,7 +1970,7 @@ entry(%0 : $Builtin.Int62): return %u : $MultiPayloadTwoSpareBits } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_two_spare_bits_inject_x_indirect(i64 %0, ptr nocapture dereferenceable({{.*}}) %1) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_two_spare_bits_inject_x_indirect(i64 %0, ptr captures(none) dereferenceable({{.*}}) %1) {{.*}} { // CHECK-64: entry: // CHECK-64: [[NATIVECC_TRUNC:%.*]] = trunc i64 %0 to i62 // CHECK-64: [[BYTE:%.*]] = zext i62 [[NATIVECC_TRUNC]] to i64 @@ -2004,7 +2004,7 @@ entry(%0 : $Builtin.Int60): return %u : $MultiPayloadTwoSpareBits } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_two_spare_bits_inject_y_indirect(i64 %0, ptr nocapture dereferenceable({{.*}}) %1) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_two_spare_bits_inject_y_indirect(i64 %0, ptr captures(none) dereferenceable({{.*}}) %1) {{.*}} { // CHECK-64: entry: // CHECK-64: [[NATIVECC_TRUNC:%.*]] = trunc i64 %0 to i60 // CHECK-64: [[BYTE:%.*]] = zext i60 [[NATIVECC_TRUNC]] to i64 @@ -2051,7 +2051,7 @@ entry: return %u : $MultiPayloadTwoSpareBits } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_two_spare_bits_inject_a_indirect(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_two_spare_bits_inject_a_indirect(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { // CHECK-64: entry: // -- 0xC000_0000_0000_0000 // CHECK-64: store i64 -4611686018427387904, ptr %0 @@ -2255,7 +2255,7 @@ enum MultiPayloadNestedSpareBits { case B(MultiPayloadInnerSpareBits) } -// CHECK-64-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_nested_spare_bits_switch(ptr noalias nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-64-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_nested_spare_bits_switch(ptr noalias captures(none) dereferenceable({{.*}}) %0) {{.*}} { // CHECK-64: entry: // CHECK-64: %1 = load [[WORD]], ptr %0 // CHECK-64: %2 = lshr [[WORD]] %1, 61 @@ -2325,7 +2325,7 @@ enum MultiPayloadAddressOnlyFixed { case Y(Builtin.Int32) } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_address_only_destroy(ptr noalias nocapture dereferenceable({{.*}}) %0) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_address_only_destroy(ptr noalias captures(none) dereferenceable({{.*}}) %0) sil @multi_payload_address_only_destroy : $@convention(thin) (@in MultiPayloadAddressOnlyFixed) -> () { entry(%m : $*MultiPayloadAddressOnlyFixed): destroy_addr %m : $*MultiPayloadAddressOnlyFixed diff --git a/test/IRGen/enum_derived.swift b/test/IRGen/enum_derived.swift index 02f91193ec81d..c15b4820f36ee 100644 --- a/test/IRGen/enum_derived.swift +++ b/test/IRGen/enum_derived.swift @@ -48,8 +48,8 @@ extension def_enum.TrafficLight : Error {} extension def_enum.Term : Error {} -// CHECK-NORMAL-LABEL: define hidden {{.*}}i64 @"$s12enum_derived7PhantomO8rawValues5Int64Vvg"(i8 %0, ptr nocapture readnone %T) local_unnamed_addr -// CHECK-TESTABLE-LABEL: define{{( dllexport)?}}{{( protected)?}} {{.*}}i64 @"$s12enum_derived7PhantomO8rawValues5Int64Vvg"(i8 %0, ptr nocapture readnone %T) +// CHECK-NORMAL-LABEL: define hidden {{.*}}i64 @"$s12enum_derived7PhantomO8rawValues5Int64Vvg"(i8 %0, ptr captures(none) readnone %T) local_unnamed_addr +// CHECK-TESTABLE-LABEL: define{{( dllexport)?}}{{( protected)?}} {{.*}}i64 @"$s12enum_derived7PhantomO8rawValues5Int64Vvg"(i8 %0, ptr captures(none) readnone %T) enum Phantom : Int64 { case Up diff --git a/test/IRGen/enum_future.sil b/test/IRGen/enum_future.sil index 0418359d96bcf..9aa3a6d45b542 100644 --- a/test/IRGen/enum_future.sil +++ b/test/IRGen/enum_future.sil @@ -242,7 +242,7 @@ dest(%u2 : $(Builtin.Int64, Builtin.Int64)): return %x : $() } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @singleton_switch_indirect(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @singleton_switch_indirect(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { // CHECK: entry: // CHECK: br label %[[DEST:[0-9]+]] // CHECK: [[DEST]]: @@ -278,7 +278,7 @@ entry(%0 : $Builtin.Int64, %1 : $Builtin.Int64): return %u : $Singleton } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @singleton_inject_indirect(i64 %0, i64 %1, ptr nocapture dereferenceable({{.*}}) %2) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @singleton_inject_indirect(i64 %0, i64 %1, ptr captures(none) dereferenceable({{.*}}) %2) {{.*}} { // CHECK: entry: // CHECK: [[DATA_0_ADDR:%.*]] = getelementptr inbounds <{ i64, i64 }>, ptr %2, i32 0, i32 0 // CHECK: store i64 %0, ptr [[DATA_0_ADDR]] @@ -353,7 +353,7 @@ end: return %x : $() } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @no_payload_switch_indirect(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @no_payload_switch_indirect(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { sil @no_payload_switch_indirect : $@convention(thin) (@inout NoPayloads) -> () { entry(%u : $*NoPayloads): // CHECK: [[TAG_ADDR:%.*]] = getelementptr inbounds %T11enum_future10NoPayloadsO, ptr %0, i32 0, i32 0 @@ -402,7 +402,7 @@ entry: return %u : $NoPayloads } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @no_payload_inject_z_indirect(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @no_payload_inject_z_indirect(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { // CHECK: entry: // CHECK: [[TAG_ADDR:%.*]] = getelementptr inbounds %T11enum_future10NoPayloadsO, ptr %0, i32 0, i32 0 // CHECK: store i8 2, ptr [[TAG_ADDR]] @@ -633,7 +633,7 @@ entry(%0 : $Builtin.Word): return %u : $SinglePayloadNoXI2 } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @single_payload_no_xi_inject_x_indirect([[WORD]] %0, ptr nocapture dereferenceable({{.*}}) %1) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @single_payload_no_xi_inject_x_indirect([[WORD]] %0, ptr captures(none) dereferenceable({{.*}}) %1) {{.*}} { // CHECK: entry: // CHECK: store [[WORD]] %0, ptr %1 // CHECK: [[T0:%.*]] = getelementptr inbounds %T11enum_future18SinglePayloadNoXI2O, ptr %1, i32 0, i32 1 @@ -659,7 +659,7 @@ entry: return %u : $SinglePayloadNoXI2 } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @single_payload_no_xi_inject_y_indirect(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @single_payload_no_xi_inject_y_indirect(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { // CHECK: entry: // CHECK: store [[WORD]] 0, ptr %0 // CHECK: [[T0:%.*]] = getelementptr inbounds %T11enum_future18SinglePayloadNoXI2O, ptr %0, i32 0, i32 1 @@ -996,7 +996,7 @@ entry(%0 : $Builtin.Int63): return %u : $SinglePayloadSpareBit } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @single_payload_spare_bit_inject_x_indirect(i64 %0, ptr nocapture dereferenceable({{.*}}) %1) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @single_payload_spare_bit_inject_x_indirect(i64 %0, ptr captures(none) dereferenceable({{.*}}) %1) {{.*}} { // CHECK-64: entry: // CHECK-64: [[T:%.*]] = trunc i64 %0 to i63 // CHECK-64: [[BYTE:%.*]] = zext i63 [[T]] to i64 @@ -1023,7 +1023,7 @@ entry: return %u : $SinglePayloadSpareBit } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @single_payload_spare_bit_inject_y_indirect(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @single_payload_spare_bit_inject_y_indirect(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { // CHECK-64: entry: // -- 0x8000_0000_0000_0000 // CHECK-64: store i64 -9223372036854775808, ptr %0 @@ -1308,7 +1308,7 @@ end(%z : $()): return %z : $() } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc i8 @dynamic_single_payload_empty_payload_load(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc i8 @dynamic_single_payload_empty_payload_load(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { // CHECK: entry: // CHECK: %1 = load i8, ptr %0 // CHECK: ret i8 %1 @@ -1319,7 +1319,7 @@ entry(%p : $*DynamicSinglePayload<()>): return %x : $DynamicSinglePayload<()> } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @dynamic_single_payload_empty_payload_store(ptr nocapture dereferenceable({{.*}}) %0, i8 %1) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @dynamic_single_payload_empty_payload_store(ptr captures(none) dereferenceable({{.*}}) %0, i8 %1) {{.*}} { // CHECK: entry: // CHECK: store i8 %1, ptr %0 // CHECK: ret void @@ -1444,7 +1444,7 @@ end: return %v : $() } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_no_spare_bits_switch_indirect(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_no_spare_bits_switch_indirect(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { sil @multi_payload_no_spare_bits_switch_indirect : $(@inout MultiPayloadNoSpareBits) -> () { entry(%u : $*MultiPayloadNoSpareBits): // CHECK-64: [[PAYLOAD:%.*]] = load i64, ptr %0 @@ -1498,7 +1498,7 @@ entry(%0 : $Builtin.Int64): return %u : $MultiPayloadNoSpareBits } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_no_spare_bit_inject_x_indirect(i64 %0, ptr nocapture dereferenceable({{.*}}) %1) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_no_spare_bit_inject_x_indirect(i64 %0, ptr captures(none) dereferenceable({{.*}}) %1) {{.*}} { // CHECK-64: entry: // CHECK-64: store i64 %0, ptr %1 // CHECK-64: [[T0:%.*]] = getelementptr inbounds %T11enum_future23MultiPayloadNoSpareBitsO, ptr %1, i32 0, i32 1 @@ -1551,7 +1551,7 @@ entry: return %u : $MultiPayloadNoSpareBits } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_no_spare_bit_inject_a_indirect(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_no_spare_bit_inject_a_indirect(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { // CHECK-64: entry: // CHECK-64: store i64 0, ptr %0 // CHECK-64: [[T0:%.*]] = getelementptr inbounds %T11enum_future23MultiPayloadNoSpareBitsO, ptr %0, i32 0, i32 1 @@ -1742,7 +1742,7 @@ entry(%0 : $Builtin.Int62): return %u : $MultiPayloadOneSpareBit } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_one_spare_bit_inject_x_indirect(i64 %0, ptr nocapture dereferenceable({{.*}}) %1) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_one_spare_bit_inject_x_indirect(i64 %0, ptr captures(none) dereferenceable({{.*}}) %1) {{.*}} { // CHECK-64: entry: // CHECK-64: [[NATIVECC_TRUNC:%.*]] = trunc i64 %0 to i62 // CHECK-64: [[VAL:%.*]] = zext i62 [[NATIVECC_TRUNC]] to i64 @@ -1780,7 +1780,7 @@ entry(%0 : $Builtin.Int63): return %u : $MultiPayloadOneSpareBit } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_one_spare_bit_inject_y_indirect(i64 %0, ptr nocapture dereferenceable({{.*}}) %1) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_one_spare_bit_inject_y_indirect(i64 %0, ptr captures(none) dereferenceable({{.*}}) %1) {{.*}} { // CHECK-64: entry: // CHECK-64: [[NATIVECC_TRUNC:%.*]] = trunc i64 %0 to i63 // CHECK-64: [[VAL:%.*]] = zext i63 [[NATIVECC_TRUNC]] to i64 @@ -1830,7 +1830,7 @@ entry: return %u : $MultiPayloadOneSpareBit } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_one_spare_bit_inject_a_indirect(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_one_spare_bit_inject_a_indirect(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { // CHECK-64: entry: // -- 0x8000_0000_0000_0000 // CHECK-64: store i64 -9223372036854775808, ptr %0 @@ -1974,7 +1974,7 @@ entry(%0 : $Builtin.Int62): return %u : $MultiPayloadTwoSpareBits } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_two_spare_bits_inject_x_indirect(i64 %0, ptr nocapture dereferenceable({{.*}}) %1) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_two_spare_bits_inject_x_indirect(i64 %0, ptr captures(none) dereferenceable({{.*}}) %1) {{.*}} { // CHECK-64: entry: // CHECK-64: [[NATIVECC_TRUNC:%.*]] = trunc i64 %0 to i62 // CHECK-64: [[VAL:%.*]] = zext i62 [[NATIVECC_TRUNC]] to i64 @@ -2008,7 +2008,7 @@ entry(%0 : $Builtin.Int60): return %u : $MultiPayloadTwoSpareBits } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_two_spare_bits_inject_y_indirect(i64 %0, ptr nocapture dereferenceable({{.*}}) %1) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_two_spare_bits_inject_y_indirect(i64 %0, ptr captures(none) dereferenceable({{.*}}) %1) {{.*}} { // CHECK-64: entry: // CHECK-64: [[NATIVECC_TRUNC:%.*]] = trunc i64 %0 to i60 // CHECK-64: [[VAL:%.*]] = zext i60 [[NATIVECC_TRUNC]] to i64 @@ -2055,7 +2055,7 @@ entry: return %u : $MultiPayloadTwoSpareBits } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_two_spare_bits_inject_a_indirect(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_two_spare_bits_inject_a_indirect(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { // CHECK-64: entry: // -- 0xC000_0000_0000_0000 // CHECK-64: store i64 -4611686018427387904, ptr %0 @@ -2259,7 +2259,7 @@ enum MultiPayloadNestedSpareBits { case B(MultiPayloadInnerSpareBits) } -// CHECK-64-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_nested_spare_bits_switch(ptr noalias nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-64-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_nested_spare_bits_switch(ptr noalias captures(none) dereferenceable({{.*}}) %0) {{.*}} { // CHECK-64: entry: // CHECK-64: %1 = load [[WORD]], ptr %0 // CHECK-64: %2 = lshr [[WORD]] %1, 61 @@ -2329,7 +2329,7 @@ enum MultiPayloadAddressOnlyFixed { case Y(Builtin.Int32) } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_address_only_destroy(ptr noalias nocapture dereferenceable({{.*}}) %0) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_address_only_destroy(ptr noalias captures(none) dereferenceable({{.*}}) %0) sil @multi_payload_address_only_destroy : $@convention(thin) (@in MultiPayloadAddressOnlyFixed) -> () { entry(%m : $*MultiPayloadAddressOnlyFixed): destroy_addr %m : $*MultiPayloadAddressOnlyFixed diff --git a/test/IRGen/enum_resilience.swift b/test/IRGen/enum_resilience.swift index 3220e4a0c1ef9..fd70946f1dbe8 100644 --- a/test/IRGen/enum_resilience.swift +++ b/test/IRGen/enum_resilience.swift @@ -260,7 +260,7 @@ public func resilientEnumPartialApply(_ f: (Medium) -> Int) { } -// CHECK-LABEL: define internal swiftcc void @"$s14resilient_enum6MediumOSiIgnd_ACSiIegnr_TRTA"(ptr noalias nocapture sret({{.*}}) %0, ptr noalias %1, ptr swiftself %2) +// CHECK-LABEL: define internal swiftcc void @"$s14resilient_enum6MediumOSiIgnd_ACSiIegnr_TRTA"(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias %1, ptr swiftself %2) // Enums with resilient payloads from a different resilience domain diff --git a/test/IRGen/errors.sil b/test/IRGen/errors.sil index fbb5d067594a3..217f619b8077c 100644 --- a/test/IRGen/errors.sil +++ b/test/IRGen/errors.sil @@ -79,8 +79,8 @@ entry(%0 : $AnyObject): // CHECK-wasm32: [[ERRORSLOT:%.*]] = alloca [[SWIFTERROR:.*]] ptr, align // CHECK-NEXT: store ptr null, ptr [[ERRORSLOT]], align - // CHECK-objc-NEXT: [[RESULT:%.*]] = call swiftcc ptr @try_apply_helper(ptr %0, ptr swiftself undef, ptr noalias nocapture [[SWIFTERROR]]{{( )?}}dereferenceable({{.}}) [[ERRORSLOT]]) - // CHECK-native-NEXT: [[RESULT:%.*]] = call swiftcc ptr @try_apply_helper(ptr %0, ptr swiftself undef, ptr noalias nocapture [[SWIFTERROR]]{{( )?}}dereferenceable({{.}}) [[ERRORSLOT]]) + // CHECK-objc-NEXT: [[RESULT:%.*]] = call swiftcc ptr @try_apply_helper(ptr %0, ptr swiftself undef, ptr noalias captures(none) [[SWIFTERROR]]{{( )?}}dereferenceable({{.}}) [[ERRORSLOT]]) + // CHECK-native-NEXT: [[RESULT:%.*]] = call swiftcc ptr @try_apply_helper(ptr %0, ptr swiftself undef, ptr noalias captures(none) [[SWIFTERROR]]{{( )?}}dereferenceable({{.}}) [[ERRORSLOT]]) // CHECK-NEXT: [[ERR:%.*]] = load ptr, ptr [[ERRORSLOT]], align // CHECK-NEXT: [[T0:%.*]] = icmp ne ptr [[ERR]], null // CHECK-NEXT: ptrtoint ptr [[ERR]] to i @@ -116,7 +116,7 @@ enum ColorError : Error { } // CHECK-LABEL: TestCallToWillThrowCallBack -// CHECK: call swiftcc void @swift_willThrow(ptr swiftself undef, ptr noalias nocapture readonly [[SWIFTERROR]]{{( )?}}dereferenceable({{.}}) %2) +// CHECK: call swiftcc void @swift_willThrow(ptr swiftself undef, ptr noalias captures(none) readonly [[SWIFTERROR]]{{( )?}}dereferenceable({{.}}) %2) // CHECK: store ptr %0 // CHECK: ret i64 undef sil hidden @TestCallToWillThrowCallBack : $@convention(thin) (@owned Error) -> (Int64, @error Error) { diff --git a/test/IRGen/existentials_objc.sil b/test/IRGen/existentials_objc.sil index 35bb3b5813f8b..4ca9b4a54fa58 100644 --- a/test/IRGen/existentials_objc.sil +++ b/test/IRGen/existentials_objc.sil @@ -22,7 +22,7 @@ bb0(%0 : $*Any, %1 : $T): return %3 : $() } -// CHECK-DAG: define{{( protected)?}} swiftcc void @init_opaque_existential(ptr noalias nocapture sret({{.*}}) %0, ptr %1, ptr %T) {{.*}} { +// CHECK-DAG: define{{( protected)?}} swiftcc void @init_opaque_existential(ptr noalias captures(none) sret({{.*}}) %0, ptr %1, ptr %T) {{.*}} { // CHECK: [[T0:%.*]] = getelementptr inbounds [[ANY:%Any]], ptr %0, i32 0, i32 1 // CHECK-NEXT: store ptr %T, ptr [[T0]], align 8 // CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds [[ANY]], ptr %0, i32 0, i32 0 @@ -37,7 +37,7 @@ bb0(%0 : $*Any, %1 : $*Any): return %3 : $() } -// CHECK-DAG: define{{( protected)?}} swiftcc void @take_opaque_existential(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture dereferenceable({{.*}}) %1) {{.*}} { +// CHECK-DAG: define{{( protected)?}} swiftcc void @take_opaque_existential(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias captures(none) dereferenceable({{.*}}) %1) {{.*}} { // CHECK: call ptr @"$sypWOb"(ptr %1, ptr %0) // CHECK-NEXT: ret void diff --git a/test/IRGen/extern_c_abitypes.swift b/test/IRGen/extern_c_abitypes.swift index 34a9c818eb092..4a14163612ec4 100644 --- a/test/IRGen/extern_c_abitypes.swift +++ b/test/IRGen/extern_c_abitypes.swift @@ -101,12 +101,12 @@ func test() { // assume %struct.c_struct and %TSo8c_structV have compatible layout // - // CHECK-x86_64: call void @c_roundtrip_c_struct(ptr noalias nocapture sret(%TSo8c_structV) {{.*}}, ptr{{( byval\(%struct.c_struct\))?}}[[ALIGN:(align [0-9]+)?]] {{.*}}) - // CHECK-x86_64: call void @swift_roundtrip_c_struct(ptr noalias nocapture sret(%TSo8c_structV) {{.*}}, ptr{{( byval\(%TSo8c_structV\))?}}[[ALIGN]] {{.*}}) - // CHECK-arm64: call void @c_roundtrip_c_struct(ptr noalias nocapture sret(%TSo8c_structV) {{.*}}, ptr{{( byval\(%struct.c_struct\))?}}[[ALIGN:(align [0-9]+)?]] {{.*}}) - // CHECK-arm64: call void @swift_roundtrip_c_struct(ptr noalias nocapture sret(%TSo8c_structV) {{.*}}, ptr{{( byval\(%TSo8c_structV\))?}}[[ALIGN]] {{.*}}) - // CHECK-wasm32: call void @c_roundtrip_c_struct(ptr noalias nocapture sret(%TSo8c_structV) {{.*}}, ptr{{( byval\(%struct.c_struct\))?}}[[ALIGN:(align [0-9]+)?]] {{.*}}) - // CHECK-wasm32: call void @swift_roundtrip_c_struct(ptr noalias nocapture sret(%TSo8c_structV) {{.*}}, ptr{{( byval\(%TSo8c_structV\))?}}[[ALIGN]] {{.*}}) + // CHECK-x86_64: call void @c_roundtrip_c_struct(ptr noalias captures(none) sret(%TSo8c_structV) {{.*}}, ptr{{( byval\(%struct.c_struct\))?}}[[ALIGN:(align [0-9]+)?]] {{.*}}) + // CHECK-x86_64: call void @swift_roundtrip_c_struct(ptr noalias captures(none) sret(%TSo8c_structV) {{.*}}, ptr{{( byval\(%TSo8c_structV\))?}}[[ALIGN]] {{.*}}) + // CHECK-arm64: call void @c_roundtrip_c_struct(ptr noalias captures(none) sret(%TSo8c_structV) {{.*}}, ptr{{( byval\(%struct.c_struct\))?}}[[ALIGN:(align [0-9]+)?]] {{.*}}) + // CHECK-arm64: call void @swift_roundtrip_c_struct(ptr noalias captures(none) sret(%TSo8c_structV) {{.*}}, ptr{{( byval\(%TSo8c_structV\))?}}[[ALIGN]] {{.*}}) + // CHECK-wasm32: call void @c_roundtrip_c_struct(ptr noalias captures(none) sret(%TSo8c_structV) {{.*}}, ptr{{( byval\(%struct.c_struct\))?}}[[ALIGN:(align [0-9]+)?]] {{.*}}) + // CHECK-wasm32: call void @swift_roundtrip_c_struct(ptr noalias captures(none) sret(%TSo8c_structV) {{.*}}, ptr{{( byval\(%TSo8c_structV\))?}}[[ALIGN]] {{.*}}) // CHECK-armv7k: call [3 x i32] @c_roundtrip_c_struct([3 x i32] {{.*}}) // CHECK-armv7k: call [3 x i32] @swift_roundtrip_c_struct([3 x i32] {{.*}}) var c_struct_val = c_struct(foo: 496, bar: 28, baz: 8) diff --git a/test/IRGen/fixlifetime.sil b/test/IRGen/fixlifetime.sil index c6c971758c49e..df298bfb85831 100644 --- a/test/IRGen/fixlifetime.sil +++ b/test/IRGen/fixlifetime.sil @@ -8,7 +8,7 @@ // unnecessary. // ONONE-NOT: @__swift_fixLifetime -// CHECK-objc-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @test(ptr %0, ptr %1, ptr %2, ptr %3, ptr %4, ptr noalias nocapture dereferenceable({{.*}}) %5, {{(i64|i32)}} %6, {{(i64|i32)}} %7) {{.*}} { +// CHECK-objc-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @test(ptr %0, ptr %1, ptr %2, ptr %3, ptr %4, ptr noalias captures(none) dereferenceable({{.*}}) %5, {{(i64|i32)}} %6, {{(i64|i32)}} %7) {{.*}} { // CHECK-objc: entry: // CHECK-objc: call void @__swift_fixLifetime(ptr // CHECK-objc: call void @__swift_fixLifetime(ptr @@ -20,7 +20,7 @@ // CHECK-objc: call void @__swift_fixLifetime(ptr [[TEMP]]) // CHECK-objc: call void @__swift_fixLifetime(ptr -// CHECK-native-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @test(ptr %0, ptr %1, ptr %2, ptr %3, ptr %4, ptr noalias nocapture dereferenceable({{.*}}) %5, {{(i64|i32)}} %6, {{(i64|i32)}} %7) {{.*}} { +// CHECK-native-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @test(ptr %0, ptr %1, ptr %2, ptr %3, ptr %4, ptr noalias captures(none) dereferenceable({{.*}}) %5, {{(i64|i32)}} %6, {{(i64|i32)}} %7) {{.*}} { // CHECK-native: entry: // CHECK-native: call void @__swift_fixLifetime(ptr // CHECK-native: call void @__swift_fixLifetime(ptr diff --git a/test/IRGen/function_param_convention.sil b/test/IRGen/function_param_convention.sil index 124b964fefd72..a3190feccaa4c 100644 --- a/test/IRGen/function_param_convention.sil +++ b/test/IRGen/function_param_convention.sil @@ -10,7 +10,7 @@ struct X { // Make sure we can irgen a SIL function with various parameter attributes // without choking. This is just a basic reality check. -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @foo(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture dereferenceable({{.*}}) %1, ptr nocapture dereferenceable({{.*}}) %2, ptr noalias nocapture dereferenceable({{.*}}) %3, i32 %4, i32 %5, i32 %6) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @foo(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias captures(none) dereferenceable({{.*}}) %1, ptr captures(none) dereferenceable({{.*}}) %2, ptr noalias captures(none) dereferenceable({{.*}}) %3, i32 %4, i32 %5, i32 %6) {{.*}} { sil @foo : $@convention(thin) (@in X, @inout X, @in_guaranteed X, @owned X, X, @guaranteed X) -> @out X { bb0(%0 : $*X, %1 : $*X, %2 : $*X, %3 : $*X, %4 : $X, %5 : $X, %6 : $X): diff --git a/test/IRGen/function_types.sil b/test/IRGen/function_types.sil index c2d022bd9ba32..d0857262b668b 100644 --- a/test/IRGen/function_types.sil +++ b/test/IRGen/function_types.sil @@ -52,9 +52,9 @@ struct X {} sil @out_void_return : $@convention(thin) () -> @out X -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @use_void_return_value(ptr noalias nocapture sret({{.*}}) %0) {{.*}} { +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @use_void_return_value(ptr noalias captures(none) sret({{.*}}) %0) {{.*}} { // CHECK-NEXT: entry: -// CHECK-NEXT: call swiftcc void @out_void_return(ptr noalias nocapture sret({{.*}}) %0) +// CHECK-NEXT: call swiftcc void @out_void_return(ptr noalias captures(none) sret({{.*}}) %0) // CHECK-NEXT: ret void // CHECK-NEXT: } sil @use_void_return_value : $@convention(thin) () -> @out X { diff --git a/test/IRGen/generic_casts.swift b/test/IRGen/generic_casts.swift index edb132269d1f4..a7de242134627 100644 --- a/test/IRGen/generic_casts.swift +++ b/test/IRGen/generic_casts.swift @@ -58,7 +58,7 @@ func intToAll(_ x: Int) -> T { return x as! T } -// CHECK: define hidden swiftcc i64 @"$s13generic_casts8anyToIntySiypF"(ptr noalias nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK: define hidden swiftcc i64 @"$s13generic_casts8anyToIntySiypF"(ptr noalias captures(none) dereferenceable({{.*}}) %0) {{.*}} { func anyToInt(_ x: Any) -> Int { return x as! Int } @@ -104,7 +104,7 @@ func classExistentialToOpaqueArchetype(_ x: ObjCProto1) -> T { protocol P {} protocol Q {} -// CHECK: define hidden swiftcc void @"$s13generic_casts19compositionToMemberyAA1P_pAaC_AA1QpF{{.*}}"(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture dereferenceable({{.*}}) %1) {{.*}} { +// CHECK: define hidden swiftcc void @"$s13generic_casts19compositionToMemberyAA1P_pAaC_AA1QpF{{.*}}"(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias captures(none) dereferenceable({{.*}}) %1) {{.*}} { func compositionToMember(_ a: P & Q) -> P { return a } diff --git a/test/IRGen/generic_metatypes.swift b/test/IRGen/generic_metatypes.swift index d27fe84c46160..ed4e602c1dc63 100644 --- a/test/IRGen/generic_metatypes.swift +++ b/test/IRGen/generic_metatypes.swift @@ -58,7 +58,7 @@ func genericMetatypes(_ t: T.Type, _ u: U.Type) {} protocol Bas {} -// CHECK: define hidden swiftcc { ptr, ptr } @"$s17generic_metatypes14protocolTypeof{{.*}}"(ptr noalias nocapture dereferenceable({{.*}}) %0) +// CHECK: define hidden swiftcc { ptr, ptr } @"$s17generic_metatypes14protocolTypeof{{.*}}"(ptr noalias captures(none) dereferenceable({{.*}}) %0) func protocolTypeof(_ x: Bas) -> Bas.Type { // CHECK: [[METADATA_ADDR:%.*]] = getelementptr inbounds %T17generic_metatypes3BasP, ptr [[X:%.*]], i32 0, i32 1 // CHECK: [[METADATA:%.*]] = load ptr, ptr [[METADATA_ADDR]] diff --git a/test/IRGen/generic_metatypes_future.swift b/test/IRGen/generic_metatypes_future.swift index f1492f3c9f46e..052bb6551f3f7 100644 --- a/test/IRGen/generic_metatypes_future.swift +++ b/test/IRGen/generic_metatypes_future.swift @@ -59,7 +59,7 @@ func genericMetatypes(_ t: T.Type, _ u: U.Type) {} protocol Bas {} -// CHECK: define hidden swiftcc { ptr, ptr } @"$s17generic_metatypes14protocolTypeof{{.*}}"(ptr noalias nocapture dereferenceable({{.*}}) %0) +// CHECK: define hidden swiftcc { ptr, ptr } @"$s17generic_metatypes14protocolTypeof{{.*}}"(ptr noalias captures(none) dereferenceable({{.*}}) %0) func protocolTypeof(_ x: Bas) -> Bas.Type { // CHECK: [[METADATA_ADDR:%.*]] = getelementptr inbounds %T17generic_metatypes3BasP, ptr [[X:%.*]], i32 0, i32 1 // CHECK: [[METADATA:%.*]] = load ptr, ptr [[METADATA_ADDR]] diff --git a/test/IRGen/generic_ternary.swift b/test/IRGen/generic_ternary.swift index f44288913f1b2..7d679d68a50ef 100644 --- a/test/IRGen/generic_ternary.swift +++ b/test/IRGen/generic_ternary.swift @@ -4,7 +4,7 @@ // struct OptionalStreamAdaptor { - // CHECK: define hidden swiftcc void @"$s15generic_ternary21OptionalStreamAdaptorV4next{{[_0-9a-zA-Z]*}}F"(ptr noalias sret({{.*}}) %0, ptr %"OptionalStreamAdaptor", ptr nocapture swiftself dereferenceable({{.*}}) %1) + // CHECK: define hidden swiftcc void @"$s15generic_ternary21OptionalStreamAdaptorV4next{{[_0-9a-zA-Z]*}}F"(ptr noalias sret({{.*}}) %0, ptr %"OptionalStreamAdaptor", ptr captures(none) swiftself dereferenceable({{.*}}) %1) mutating func next() -> Optional { return x[0].next() diff --git a/test/IRGen/indexing.sil b/test/IRGen/indexing.sil index a908a84d15d9e..ed9c72218e81f 100644 --- a/test/IRGen/indexing.sil +++ b/test/IRGen/indexing.sil @@ -12,7 +12,7 @@ struct SameSizeStride { var x, y: Builtin.Int32 } // This type has unequal stride and size. struct DifferentSizeStride { var x: Builtin.Int32, y: Builtin.Int16 } -// CHECK: define{{( protected)?}} {{.*}}void @same_size_stride(ptr noalias nocapture dereferenceable({{.*}}) %0, i64 %1) {{.*}} { +// CHECK: define{{( protected)?}} {{.*}}void @same_size_stride(ptr noalias captures(none) dereferenceable({{.*}}) %0, i64 %1) {{.*}} { // CHECK: getelementptr inbounds %T8indexing14SameSizeStrideV, ptr %0, i64 %1 sil @same_size_stride : $@convention(thin) (@in SameSizeStride, Builtin.Word) -> () { entry(%p : $*SameSizeStride, %i: $Builtin.Word): @@ -20,7 +20,7 @@ entry(%p : $*SameSizeStride, %i: $Builtin.Word): return undef : $() } -// CHECK: define{{( protected)?}} {{.*}}void @different_size_stride(ptr noalias nocapture dereferenceable({{.*}}) %0, i64 %1) {{.*}} { +// CHECK: define{{( protected)?}} {{.*}}void @different_size_stride(ptr noalias captures(none) dereferenceable({{.*}}) %0, i64 %1) {{.*}} { // CHECK: %2 = mul nsw i64 %1, 8 // CHECK-NEXT: %3 = getelementptr inbounds i8, ptr %0, i64 %2 sil @different_size_stride : $@convention(thin) (@in DifferentSizeStride, Builtin.Word) -> () { @@ -29,7 +29,7 @@ entry(%p : $*DifferentSizeStride, %i: $Builtin.Word): return undef : $() } -// CHECK: define{{( protected)?}} {{.*}}void @zero_size(ptr noalias nocapture %0, i64 %1) {{.*}} { +// CHECK: define{{( protected)?}} {{.*}}void @zero_size(ptr noalias captures(none) %0, i64 %1) {{.*}} { // CHECK: %2 = mul nsw i64 %1, 1 // CHECK-NEXT: %3 = getelementptr inbounds i8, ptr %0, i64 %2 sil @zero_size : $@convention(thin) (@in (), Builtin.Word) -> () { diff --git a/test/IRGen/indirect_argument.sil b/test/IRGen/indirect_argument.sil index bb521b9ba5907..54017eab819d4 100644 --- a/test/IRGen/indirect_argument.sil +++ b/test/IRGen/indirect_argument.sil @@ -15,9 +15,9 @@ struct HugeAlignment { } // TODO: could be the context param -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @huge_method(ptr noalias nocapture swiftself dereferenceable({{.*}}) %0) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @huge_method(ptr noalias captures(none) swiftself dereferenceable({{.*}}) %0) // CHECK-NOT: alloca -// CHECK: call swiftcc void @huge_method(ptr noalias nocapture swiftself dereferenceable({{.*}}) %0) +// CHECK: call swiftcc void @huge_method(ptr noalias captures(none) swiftself dereferenceable({{.*}}) %0) sil @huge_method : $@convention(method) (Huge) -> () { entry(%x : $Huge): %f = function_ref @huge_method : $@convention(method) (Huge) -> () @@ -25,9 +25,9 @@ entry(%x : $Huge): return %z : $() } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @huge_param(ptr noalias nocapture dereferenceable({{.*}}) %0) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @huge_param(ptr noalias captures(none) dereferenceable({{.*}}) %0) // CHECK-NOT: alloca -// CHECK: call swiftcc void @huge_param(ptr noalias nocapture dereferenceable({{.*}}) %0) +// CHECK: call swiftcc void @huge_param(ptr noalias captures(none) dereferenceable({{.*}}) %0) sil @huge_param : $@convention(thin) (Huge) -> () { entry(%x : $Huge): %f = function_ref @huge_param : $@convention(thin) (Huge) -> () @@ -35,9 +35,9 @@ entry(%x : $Huge): return %z : $() } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @huge_alignment_param(ptr noalias nocapture dereferenceable({{.*}}) %0) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @huge_alignment_param(ptr noalias captures(none) dereferenceable({{.*}}) %0) // CHECK-NOT: alloca -// CHECK: call swiftcc void @huge_alignment_param(ptr noalias nocapture dereferenceable({{.*}}) %0) +// CHECK: call swiftcc void @huge_alignment_param(ptr noalias captures(none) dereferenceable({{.*}}) %0) sil @huge_alignment_param : $@convention(thin) (HugeAlignment) -> () { entry(%x : $HugeAlignment): %f = function_ref @huge_alignment_param : $@convention(thin) (HugeAlignment) -> () @@ -45,9 +45,9 @@ entry(%x : $HugeAlignment): return %z : $() } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @huge_param_and_return(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture dereferenceable({{.*}}) %1) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @huge_param_and_return(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias captures(none) dereferenceable({{.*}}) %1) // CHECK: [[TMP_RET:%.*]] = alloca -// CHECK: call swiftcc void @huge_param_and_return(ptr noalias nocapture sret({{.*}}) [[TMP_RET]], ptr noalias nocapture dereferenceable({{.*}}) %1) +// CHECK: call swiftcc void @huge_param_and_return(ptr noalias captures(none) sret({{.*}}) [[TMP_RET]], ptr noalias captures(none) dereferenceable({{.*}}) %1) sil @huge_param_and_return : $@convention(thin) (Huge) -> Huge { entry(%x : $Huge): %f = function_ref @huge_param_and_return : $@convention(thin) (Huge) -> Huge @@ -55,9 +55,9 @@ entry(%x : $Huge): return %z : $Huge } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @huge_param_and_indirect_return(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture dereferenceable({{.*}}) %1) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @huge_param_and_indirect_return(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias captures(none) dereferenceable({{.*}}) %1) // CHECK-NOT: alloca -// CHECK: call swiftcc void @huge_param_and_indirect_return(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture dereferenceable({{.*}}) %1) +// CHECK: call swiftcc void @huge_param_and_indirect_return(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias captures(none) dereferenceable({{.*}}) %1) sil @huge_param_and_indirect_return : $@convention(thin) (Huge) -> @out Huge { entry(%o : $*Huge, %x : $Huge): %f = function_ref @huge_param_and_indirect_return : $@convention(thin) (Huge) -> @out Huge @@ -65,16 +65,16 @@ entry(%o : $*Huge, %x : $Huge): return %z : $() } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @huge_partial_application(ptr noalias nocapture dereferenceable({{.*}}) %0, ptr noalias nocapture dereferenceable({{.*}}) %1) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @huge_partial_application(ptr noalias captures(none) dereferenceable({{.*}}) %0, ptr noalias captures(none) dereferenceable({{.*}}) %1) // CHECK-NOT: alloca // CHECK: [[CLOSURE:%.*]] = call noalias ptr @swift_allocObject -// CHECK: call swiftcc {{.*}} @"$s24huge_partial_applicationTA{{(\.ptrauth)?}}"{{.*}}(ptr noalias nocapture dereferenceable({{.*}}) %0, ptr swiftself [[CLOSURE]]) -// CHECK: define internal swiftcc void @"$s24huge_partial_applicationTA"(ptr noalias nocapture dereferenceable({{.*}}) %0, ptr swiftself %1) +// CHECK: call swiftcc {{.*}} @"$s24huge_partial_applicationTA{{(\.ptrauth)?}}"{{.*}}(ptr noalias captures(none) dereferenceable({{.*}}) %0, ptr swiftself [[CLOSURE]]) +// CHECK: define internal swiftcc void @"$s24huge_partial_applicationTA"(ptr noalias captures(none) dereferenceable({{.*}}) %0, ptr swiftself %1) // CHECK-NOT: alloca // CHECK: [[GEP:%.*]] = getelementptr inbounds <{ %swift.refcounted, %T17indirect_argument4HugeV }>, ptr %1, i32 0, i32 1 // CHECK-NOT: alloca // CHECK-NOT: tail -// CHECK: call swiftcc void @huge_partial_application(ptr noalias nocapture dereferenceable({{.*}}) %0, ptr noalias nocapture dereferenceable({{.*}}) [[GEP]] +// CHECK: call swiftcc void @huge_partial_application(ptr noalias captures(none) dereferenceable({{.*}}) %0, ptr noalias captures(none) dereferenceable({{.*}}) [[GEP]] // CHECK: call void @swift_release(ptr %1) sil @huge_partial_application : $@convention(thin) (Huge, Huge) -> () { entry(%x : $Huge, %y : $Huge): @@ -84,16 +84,16 @@ entry(%x : $Huge, %y : $Huge): return %z : $() } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @huge_partial_application_stret(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture dereferenceable({{.*}}) %1, ptr noalias nocapture dereferenceable({{.*}}) %2) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @huge_partial_application_stret(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias captures(none) dereferenceable({{.*}}) %1, ptr noalias captures(none) dereferenceable({{.*}}) %2) // CHECK: [[TMP_RET:%.*]] = alloca // CHECK: [[CLOSURE:%.*]] = call noalias ptr @swift_allocObject -// CHECK: call swiftcc {{.*}} @"$s30huge_partial_application_stretTA{{(\.ptrauth)?}}"{{.*}}(ptr noalias nocapture sret({{.*}}) [[TMP_RET]], ptr noalias nocapture dereferenceable({{.*}}) %1, ptr swiftself [[CLOSURE]]) -// CHECK: define internal swiftcc void @"$s30huge_partial_application_stretTA"(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture dereferenceable({{.*}}) %1, ptr swiftself %2) +// CHECK: call swiftcc {{.*}} @"$s30huge_partial_application_stretTA{{(\.ptrauth)?}}"{{.*}}(ptr noalias captures(none) sret({{.*}}) [[TMP_RET]], ptr noalias captures(none) dereferenceable({{.*}}) %1, ptr swiftself [[CLOSURE]]) +// CHECK: define internal swiftcc void @"$s30huge_partial_application_stretTA"(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias captures(none) dereferenceable({{.*}}) %1, ptr swiftself %2) // CHECK-NOT: alloca // CHECK: [[GEP:%.*]] = getelementptr inbounds <{ %swift.refcounted, %T17indirect_argument4HugeV }>, ptr %2, i32 0, i32 1 // CHECK-NOT: alloca // CHECK-NOT: tail -// CHECK: call swiftcc void @huge_partial_application_stret(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture dereferenceable({{.*}}) %1, ptr noalias nocapture dereferenceable({{.*}}) [[GEP]]) +// CHECK: call swiftcc void @huge_partial_application_stret(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias captures(none) dereferenceable({{.*}}) %1, ptr noalias captures(none) dereferenceable({{.*}}) [[GEP]]) // CHECK: call void @swift_release(ptr %2) sil @huge_partial_application_stret : $@convention(thin) (Huge, Huge) -> Huge { entry(%x : $Huge, %y : $Huge): diff --git a/test/IRGen/indirect_return.swift b/test/IRGen/indirect_return.swift index 96b2a9bb02953..965548eb3a8c9 100644 --- a/test/IRGen/indirect_return.swift +++ b/test/IRGen/indirect_return.swift @@ -20,6 +20,6 @@ func foo() -> (String, String, String, Number, Number) { } // CHECK-LABEL: define{{.*}}testCall func testCall() { -// CHECK: call swiftcc void @"$s15indirect_return3fooSS_S2SAA6Number_pAaC_ptyF"(ptr noalias nocapture %{{.*}} +// CHECK: call swiftcc void @"$s15indirect_return3fooSS_S2SAA6Number_pAaC_ptyF"(ptr noalias captures(none) %{{.*}} print(foo()) } diff --git a/test/IRGen/inout_noalias.sil b/test/IRGen/inout_noalias.sil index 6a3c4fe86bce6..165db0f297b0c 100644 --- a/test/IRGen/inout_noalias.sil +++ b/test/IRGen/inout_noalias.sil @@ -2,7 +2,7 @@ import Swift -// CHECK: define{{.*}}swiftcc void @takeInoutAliasable(ptr nocapture dereferenceable({{[0-9]+}}) %0, ptr %T) +// CHECK: define{{.*}}swiftcc void @takeInoutAliasable(ptr captures(none) dereferenceable({{[0-9]+}}) %0, ptr %T) sil @takeInoutAliasable : $ (@inout_aliasable UnsafePointer) -> () { entry(%ptr : $*UnsafePointer): %retval = tuple () diff --git a/test/IRGen/lazy_multi_file.swift b/test/IRGen/lazy_multi_file.swift index 7e53cbd4d6833..b66f542bbbf96 100644 --- a/test/IRGen/lazy_multi_file.swift +++ b/test/IRGen/lazy_multi_file.swift @@ -14,7 +14,7 @@ class Subclass : LazyContainerClass { // an indirect return value. When it shrinks back, remove the optional // indirect out. // - // CHECK-LABEL: @"$s15lazy_multi_file8SubclassC6getStrSSyF"({{(ptr noalias nocapture sret, )?}}ptr swiftself %0) {{.*}} { + // CHECK-LABEL: @"$s15lazy_multi_file8SubclassC6getStrSSyF"({{(ptr noalias captures(none) sret, )?}}ptr swiftself %0) {{.*}} { func getStr() -> String { // CHECK: = getelementptr inbounds %T15lazy_multi_file8SubclassC, ptr %0, i32 0, i32 3 return str diff --git a/test/IRGen/lifetime.sil b/test/IRGen/lifetime.sil index e4909f3356dd9..5139e22e5682a 100644 --- a/test/IRGen/lifetime.sil +++ b/test/IRGen/lifetime.sil @@ -99,7 +99,7 @@ bb0(%x : $*Builtin.Int64): %0 = tuple () return %0 : $() } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @fixed_size(ptr noalias nocapture dereferenceable(8) %0) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @fixed_size(ptr noalias captures(none) dereferenceable(8) %0) // CHECK: [[XBUF:%.*]] = alloca i64 // CHECK-NEXT: call void @llvm.lifetime.start.p0({{(i32|i64)}} 8, ptr [[XBUF]]) // CHECK-NEXT: load diff --git a/test/IRGen/moveonly_split_module_source_deinit.swift b/test/IRGen/moveonly_split_module_source_deinit.swift index a9b1836263f0d..7cae1a4aa3fb4 100644 --- a/test/IRGen/moveonly_split_module_source_deinit.swift +++ b/test/IRGen/moveonly_split_module_source_deinit.swift @@ -7,7 +7,7 @@ // Make sure we call the deinit through the value witness table in the other module. -// REFERRING_MODULE-LABEL: define {{.*}}swiftcc void @"$s6serverAAV4mainyyKFZ"(ptr swiftself %0, ptr noalias nocapture swifterror dereferenceable({{(8|4)}}) %1) {{.*}}{ +// REFERRING_MODULE-LABEL: define {{.*}}swiftcc void @"$s6serverAAV4mainyyKFZ"(ptr swiftself %0, ptr noalias captures(none) swifterror dereferenceable({{(8|4)}}) %1) {{.*}}{ // REFERRING_MODULE: [[SERVER:%.*]] = alloca %T6server8MoveOnlyV // REFERRING_MODULE: [[VALUE_WITNESS_TABLE:%.*]] = getelementptr inbounds ptr, ptr %"$s6server8MoveOnlyVN.valueWitnesses" // REFERRING_MODULE: [[VALUE_WITNESS:%.*]] = load ptr, ptr [[VALUE_WITNESS_TABLE]] diff --git a/test/IRGen/moveonly_value_functions.swift b/test/IRGen/moveonly_value_functions.swift index f14abc9f87622..d1093a5839032 100644 --- a/test/IRGen/moveonly_value_functions.swift +++ b/test/IRGen/moveonly_value_functions.swift @@ -198,7 +198,7 @@ public func takeOuterDeinitingNC_1(_ t: consuming OuterDeinitingNC_1) { // CHECK: [[INNER_DEINITING_RELEASABLE_NC_METADATA:%[^,]+]] = extractvalue %swift.metadata_response [[RESPONSE]] // CHECK: call swiftcc void @"$s24moveonly_value_functions26InnerDeinitingReleasableNCVfD"( // CHECK-SAME: ptr [[INNER_DEINITING_RELEASABLE_NC_METADATA]], -// : ptr noalias nocapture swiftself dereferenceable(64) %deinit.arg) +// : ptr noalias captures(none) swiftself dereferenceable(64) %deinit.arg) // CHECK: } public func takeOuterNC_1(_ o: consuming OuterNC_1) { external_symbol() @@ -295,7 +295,7 @@ public func takeGenericContext_1OuterNC_1(_ e: consuming GenericContext_1 public func takeOuterSinglePayloadNC_1(_ e: consuming OuterSinglePayloadNC_1) {} // CHECK-LABEL: define{{.*}} @"$s24moveonly_value_functions26takeOuterSinglePayloadNC_2yyAA0efgH2_2OyxGnlF"( -// : ptr noalias nocapture dereferenceable(64) %0, +// : ptr noalias captures(none) dereferenceable(64) %0, // CHECK-SAME: ptr %T) // CHECK-SAME: { // CHECK: call{{.*}} @"$s24moveonly_value_functions22OuterSinglePayloadNC_2OyxGlWOh"( @@ -388,7 +388,7 @@ public func takeOuterMultiPayloadNC_1(_ e: consuming OuterMultiPayloadNC_1 // CHECK: } public func takeOuterMultiPayloadNC_2(_ e: consuming OuterMultiPayloadNC_2) {} // CHECK-LABEL: define{{.*}} @"$s24moveonly_value_functions25takeOuterMultiPayloadNC_3yyAA0efgH2_3OyxGnlF"( -// : ptr noalias nocapture dereferenceable(64) %0, +// : ptr noalias captures(none) dereferenceable(64) %0, // CHECK-SAME: ptr %T) // CHECK-SAME: { // CHECK: call{{.*}} @"$s24moveonly_value_functions21OuterMultiPayloadNC_3OyxGlWOh"( diff --git a/test/IRGen/moveonly_value_functions_onone.swift b/test/IRGen/moveonly_value_functions_onone.swift index 9530a4b82bc62..1e4f91fc6b11e 100644 --- a/test/IRGen/moveonly_value_functions_onone.swift +++ b/test/IRGen/moveonly_value_functions_onone.swift @@ -195,7 +195,7 @@ public func takeOuterDeinitingNC_1(_ t: consuming OuterDeinitingNC_1) { // CHECK: [[INNER_DEINITING_RELEASABLE_NC_METADATA:%[^,]+]] = extractvalue %swift.metadata_response [[RESPONSE]] // CHECK: call swiftcc void @"$s30moveonly_value_functions_onone26InnerDeinitingReleasableNCVfD"( // CHECK-SAME: ptr [[INNER_DEINITING_RELEASABLE_NC_METADATA]], -// : ptr noalias nocapture swiftself dereferenceable(64) %deinit.arg) +// : ptr noalias captures(none) swiftself dereferenceable(64) %deinit.arg) // CHECK: } public func takeOuterNC_1(_ o: consuming OuterNC_1) { external_symbol() @@ -288,7 +288,7 @@ public func takeGenericContext_1OuterNC_1(_ e: consuming GenericContext_1 public func takeOuterSinglePayloadNC_1(_ e: consuming OuterSinglePayloadNC_1) {} // CHECK-LABEL: define{{.*}} @"$s30moveonly_value_functions_onone26takeOuterSinglePayloadNC_2yyAA0fghI2_2OyxGnlF"( -// : ptr noalias nocapture dereferenceable(64) %0, +// : ptr noalias captures(none) dereferenceable(64) %0, // CHECK-SAME: ptr %T) // CHECK-SAME: { // CHECK: call{{.*}} @"$s30moveonly_value_functions_onone22OuterSinglePayloadNC_2OyxGlWOh"( @@ -305,7 +305,7 @@ public func takeOuterSinglePayloadNC_1(_ e: consuming OuterSinglePayloadNC_1< // CHECK: [[METADATA:%[^,]+]] = extractvalue %swift.metadata_response [[RESPONSE]], 0 // CHECK: call swiftcc void @"$s30moveonly_value_functions_onone26InnerDeinitingReleasableNCVfD"( // CHECK-SAME: ptr [[METADATA]], -// : ptr noalias nocapture swiftself dereferenceable(64) %0) +// : ptr noalias captures(none) swiftself dereferenceable(64) %0) // CHECK: } public func takeOuterSinglePayloadNC_2(_ e: consuming OuterSinglePayloadNC_2) {} @@ -383,7 +383,7 @@ public func takeOuterMultiPayloadNC_1(_ e: consuming OuterMultiPayloadNC_1 // CHECK: } public func takeOuterMultiPayloadNC_2(_ e: consuming OuterMultiPayloadNC_2) {} // CHECK-LABEL: define{{.*}} @"$s30moveonly_value_functions_onone25takeOuterMultiPayloadNC_3yyAA0fghI2_3OyxGnlF"( -// : ptr noalias nocapture dereferenceable(64) %0, +// : ptr noalias captures(none) dereferenceable(64) %0, // CHECK-SAME: ptr %T) // CHECK-SAME: { // CHECK: call{{.*}} @"$s30moveonly_value_functions_onone21OuterMultiPayloadNC_3OyxGlWOh"( diff --git a/test/IRGen/objc_block_storage.sil b/test/IRGen/objc_block_storage.sil index 5ecd6d590d1a5..4954efe53fa8f 100644 --- a/test/IRGen/objc_block_storage.sil +++ b/test/IRGen/objc_block_storage.sil @@ -38,7 +38,7 @@ import gizmo // CHECK: ptr [[NSRECT_BLOCK_SIGNATURE]] // CHECK: } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @project_block_storage(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @project_block_storage(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { // CHECK-NEXT: entry: // CHECK-NEXT: %1 = getelementptr inbounds { %objc_block, ptr }, ptr %0, i32 0, i32 1 // CHECK-NEXT: %2 = load ptr, ptr %1, align 8 @@ -51,7 +51,7 @@ entry(%0 : $*@block_storage Builtin.RawPointer): return %p : $Builtin.RawPointer } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc fp128 @overaligned_project_block_storage(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc fp128 @overaligned_project_block_storage(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { // CHECK-NEXT: entry: // CHECK-NEXT: %1 = getelementptr inbounds { %objc_block, fp128 }, ptr %0, i32 0, i32 1 // CHECK-NEXT: %2 = load fp128, ptr %1, align 16 @@ -64,7 +64,7 @@ entry(%0 : $*@block_storage Builtin.FPIEEE128): return %p : $Builtin.FPIEEE128 } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @init_block_header_trivial(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @init_block_header_trivial(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { // CHECK: [[HEADER:%.*]] = getelementptr inbounds { %objc_block, ptr }, ptr %0, i32 0, i32 0 // CHECK: [[T0:%.*]] = getelementptr inbounds %objc_block, ptr [[HEADER]], i32 0, i32 0 // CHECK: store ptr [[BLOCK_ISA]], ptr [[T0]] @@ -109,7 +109,7 @@ entry(%0 : $*@block_storage Builtin.RawPointer, %1 : $Int): return %1 : $Int } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @init_block_header_nontrivial(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @init_block_header_nontrivial(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { // CHECK: [[HEADER:%.*]] = getelementptr inbounds // CHECK: [[T0:%.*]] = getelementptr inbounds %objc_block, ptr [[HEADER]], i32 0, i32 0 // CHECK: store ptr [[BLOCK_ISA]], ptr [[T0]] @@ -147,7 +147,7 @@ entry(%0 : $*@block_storage Builtin.NativeObject): sil public_external @invoke_nontrivial : $@convention(c) (@inout_aliasable @block_storage Builtin.NativeObject) -> () -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @init_block_header_stret(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @init_block_header_stret(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { // CHECK: [[HEADER:%.*]] = getelementptr inbounds // CHECK: [[T0:%.*]] = getelementptr inbounds %objc_block, ptr [[HEADER]], i32 0, i32 0 // CHECK: store ptr [[BLOCK_ISA]], ptr [[T0]] diff --git a/test/IRGen/objc_class_export.swift b/test/IRGen/objc_class_export.swift index 4f3e467940a27..c2b3b29460f34 100644 --- a/test/IRGen/objc_class_export.swift +++ b/test/IRGen/objc_class_export.swift @@ -87,13 +87,13 @@ struct BigStructWithNativeObjects { return NSRect(origin: NSPoint(x: 0, y: 0), size: NSSize(width: 0, height: 0)) } - // CHECK: define internal void @"$s17objc_class_export3FooC6boundsSo6NSRectVyFTo"(ptr noalias nocapture sret({{.*}}) %0, ptr %1, ptr %2) {{[#0-9]*}} { + // CHECK: define internal void @"$s17objc_class_export3FooC6boundsSo6NSRectVyFTo"(ptr noalias captures(none) sret({{.*}}) %0, ptr %1, ptr %2) {{[#0-9]*}} { // CHECK: call swiftcc { double, double, double, double } @"$s17objc_class_export3FooC6boundsSo6NSRectVyF"(ptr swiftself %1) @objc func convertRectToBacking(r r: NSRect) -> NSRect { return r } - // CHECK: define internal void @"$s17objc_class_export3FooC20convertRectToBacking1rSo6NSRectVAG_tFTo"(ptr noalias nocapture sret({{.*}}) %0, ptr %1, ptr %2, ptr byval({{.*}} align 8 %3) {{[#0-9]*}} { + // CHECK: define internal void @"$s17objc_class_export3FooC20convertRectToBacking1rSo6NSRectVAG_tFTo"(ptr noalias captures(none) sret({{.*}}) %0, ptr %1, ptr %2, ptr byval({{.*}} align 8 %3) {{[#0-9]*}} { // CHECK: call swiftcc { double, double, double, double } @"$s17objc_class_export3FooC20convertRectToBacking1rSo6NSRectVAG_tF"(double {{.*}}, double {{.*}}, double {{.*}}, double {{.*}}, ptr swiftself %1) func doStuffToSwiftSlice(f f: [Int]) { diff --git a/test/IRGen/objc_generic_protocol_conformance.swift b/test/IRGen/objc_generic_protocol_conformance.swift index a87cebe9733e9..7510c614e9658 100644 --- a/test/IRGen/objc_generic_protocol_conformance.swift +++ b/test/IRGen/objc_generic_protocol_conformance.swift @@ -9,4 +9,4 @@ protocol P { extension Foo: P {} // SIL-LABEL: sil private [transparent] [thunk] [ossa] @$sSo3FooCyxG33objc_generic_protocol_conformance1PA2dEP3fooyyFTW {{.*}} @pseudogeneric -// IR-LABEL: define internal swiftcc void @"$sSo3FooCyxG33objc_generic_protocol_conformance1PA2dEP3fooyyFTW"(ptr noalias nocapture swiftself dereferenceable({{4|8}}) %0, ptr{{( %Self)?}}, ptr{{( %SelfWitnessTable)?}}) +// IR-LABEL: define internal swiftcc void @"$sSo3FooCyxG33objc_generic_protocol_conformance1PA2dEP3fooyyFTW"(ptr noalias captures(none) swiftself dereferenceable({{4|8}}) %0, ptr{{( %Self)?}}, ptr{{( %SelfWitnessTable)?}}) diff --git a/test/IRGen/objc_simd.sil b/test/IRGen/objc_simd.sil index cdbde09c874bf..b7803f97ba77c 100644 --- a/test/IRGen/objc_simd.sil +++ b/test/IRGen/objc_simd.sil @@ -57,15 +57,15 @@ entry(%x : $float3): } // x86_64-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { float, float, float, float } @simd_native_args(float %0, float %1, float %2, float %3) -// i386-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @simd_native_args(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture dereferenceable({{.*}}) %1) +// i386-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @simd_native_args(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias captures(none) dereferenceable({{.*}}) %1) // aarch64-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { float, float, float, float } @simd_native_args(float %0, float %1, float %2, float %3) // arm64-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { float, float, float, float } @simd_native_args(float %0, float %1, float %2, float %3) -// armv6-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @simd_native_args(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture dereferenceable({{.*}}) %1) +// armv6-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @simd_native_args(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias captures(none) dereferenceable({{.*}}) %1) // armv7-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { float, float, float, float } @simd_native_args(float %0, float %1, float %2, float %3) // armv7s-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { float, float, float, float } @simd_native_args(float %0, float %1, float %2, float %3) // armv7k-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { float, float, float, float } @simd_native_args(float %0, float %1, float %2, float %3) // arm64_32-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { float, float, float, float } @simd_native_args(float %0, float %1, float %2, float %3) -// powerpc64-LABEL: define{{( dllexport)?}}{{( protected)?}} void @simd_native_args(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture dereferenceable({{.*}}) %1) +// powerpc64-LABEL: define{{( dllexport)?}}{{( protected)?}} void @simd_native_args(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias captures(none) dereferenceable({{.*}}) %1) // powerpc64le-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { float, float, float, float } @simd_native_args(float %0, float %1, float %2, float %3) // s390x-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { float, float, float, float } @simd_native_args(float %0, float %1, float %2, float %3) // wasm32-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { float, float, float, float } @simd_native_args(float %0, float %1, float %2, float %3) diff --git a/test/IRGen/objc_structs.swift b/test/IRGen/objc_structs.swift index ab047f8476bfe..d09cd994e3bbc 100644 --- a/test/IRGen/objc_structs.swift +++ b/test/IRGen/objc_structs.swift @@ -16,7 +16,7 @@ import gizmo // CHECK: define hidden swiftcc { double, double, double, double } @"$s12objc_structs8getFrame{{[_0-9a-zA-Z]*}}F"(ptr %0) {{.*}} { func getFrame(_ g: Gizmo) -> NSRect { // CHECK: load ptr, ptr @"\01L_selector(frame)" - // CHECK: call void @objc_msgSend_stret(ptr noalias nocapture sret({{.*}}) {{.*}}, ptr {{.*}}, ptr {{.*}}) + // CHECK: call void @objc_msgSend_stret(ptr noalias captures(none) sret({{.*}}) {{.*}}, ptr {{.*}}, ptr {{.*}}) return g.frame() } // CHECK: } @@ -31,7 +31,7 @@ func setFrame(_ g: Gizmo, frame: NSRect) { // CHECK: define hidden swiftcc { double, double, double, double } @"$s12objc_structs8makeRect{{[_0-9a-zA-Z]*}}F"(double %0, double %1, double %2, double %3) func makeRect(_ a: Double, b: Double, c: Double, d: Double) -> NSRect { - // CHECK: call void @NSMakeRect(ptr noalias nocapture sret({{.*}}) {{.*}}, double {{.*}}, double {{.*}}, double {{.*}}, double {{.*}}) + // CHECK: call void @NSMakeRect(ptr noalias captures(none) sret({{.*}}) {{.*}}, double {{.*}}, double {{.*}}, double {{.*}}, double {{.*}}) return NSMakeRect(a,b,c,d) } // CHECK: } @@ -45,7 +45,7 @@ func stringFromRect(_ r: NSRect) -> String { // CHECK: define hidden swiftcc { double, double, double, double } @"$s12objc_structs9insetRect{{[_0-9a-zA-Z]*}}F"(double %0, double %1, double %2, double %3, double %4, double %5) func insetRect(_ r: NSRect, x: Double, y: Double) -> NSRect { - // CHECK: call void @NSInsetRect(ptr noalias nocapture sret({{.*}}) {{.*}}, ptr byval({{.*}}) align 8 {{.*}}, double {{.*}}, double {{.*}}) + // CHECK: call void @NSInsetRect(ptr noalias captures(none) sret({{.*}}) {{.*}}, ptr byval({{.*}}) align 8 {{.*}}, double {{.*}}, double {{.*}}) return NSInsetRect(r, x, y) } // CHECK: } @@ -53,13 +53,13 @@ func insetRect(_ r: NSRect, x: Double, y: Double) -> NSRect { // CHECK: define hidden swiftcc { double, double, double, double } @"$s12objc_structs19convertRectFromBase{{[_0-9a-zA-Z]*}}F"(ptr %0, double %1, double %2, double %3, double %4) func convertRectFromBase(_ v: NSView, r: NSRect) -> NSRect { // CHECK: load ptr, ptr @"\01L_selector(convertRectFromBase:)", align 8 - // CHECK: call void @objc_msgSend_stret(ptr noalias nocapture sret({{.*}}) {{.*}}, ptr {{.*}}, ptr {{.*}}, ptr byval({{.*}}) align 8 {{.*}}) + // CHECK: call void @objc_msgSend_stret(ptr noalias captures(none) sret({{.*}}) {{.*}}, ptr {{.*}}, ptr {{.*}}, ptr byval({{.*}}) align 8 {{.*}}) return v.convertRect(fromBase: r) } // CHECK: } // CHECK: define hidden swiftcc { ptr, ptr, ptr, ptr } @"$s12objc_structs20useStructOfNSStringsySo0deF0VADF"(ptr %0, ptr %1, ptr %2, ptr %3) -// CHECK: call void @useStructOfNSStringsInObjC(ptr noalias nocapture sret({{.*}}) {{%.*}}, ptr byval({{.*}}) align 8 {{%.*}}) +// CHECK: call void @useStructOfNSStringsInObjC(ptr noalias captures(none) sret({{.*}}) {{%.*}}, ptr byval({{.*}}) align 8 {{%.*}}) func useStructOfNSStrings(_ s: StructOfNSStrings) -> StructOfNSStrings { return useStructOfNSStringsInObjC(s) } diff --git a/test/IRGen/objc_super.swift b/test/IRGen/objc_super.swift index b8a8a2cdea6e0..2cdbda5da233c 100644 --- a/test/IRGen/objc_super.swift +++ b/test/IRGen/objc_super.swift @@ -40,7 +40,7 @@ class Hoozit : Gizmo { // CHECK: [[T0:%.*]] = extractvalue %swift.metadata_response [[TMP]], 0 // CHECK: store ptr [[T0]], ptr {{.*}}, align 8 // CHECK: load ptr, ptr @"\01L_selector(frame)" - // CHECK: call void @objc_msgSendSuper2_stret(ptr noalias nocapture sret({{.*}}) {{.*}}, ptr {{.*}}, ptr {{.*}}) + // CHECK: call void @objc_msgSendSuper2_stret(ptr noalias captures(none) sret({{.*}}) {{.*}}, ptr {{.*}}, ptr {{.*}}) return NSInsetRect(super.frame(), 2.0, 2.0) } // CHECK: } diff --git a/test/IRGen/partial_apply.sil b/test/IRGen/partial_apply.sil index 6ebfac8e03a82..6b262b85abbf5 100644 --- a/test/IRGen/partial_apply.sil +++ b/test/IRGen/partial_apply.sil @@ -135,7 +135,7 @@ bb0(%x : $SwiftClass): sil public_external @indirect_guaranteed_captured_class_param : $@convention(thin) (Int, @in_guaranteed SwiftClass) -> Int -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { ptr, ptr } @partial_apply_indirect_guaranteed_class_param(ptr noalias nocapture dereferenceable({{.*}}) %0) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { ptr, ptr } @partial_apply_indirect_guaranteed_class_param(ptr noalias captures(none) dereferenceable({{.*}}) %0) // CHECK-NOT: {{retain|release}} // CHECK: [[X:%.*]] = load ptr, ptr %0 // CHECK-NOT: {{retain|release}} @@ -148,7 +148,7 @@ sil public_external @indirect_guaranteed_captured_class_param : $@convention(thi // CHECK-NOT: load // CHECK-NOT: retain // CHECK-NOT: release -// CHECK: [[RESULT:%.*]] = call swiftcc i64 @indirect_guaranteed_captured_class_param(i64 %0, ptr noalias nocapture dereferenceable({{.*}}) [[X_TMP]] +// CHECK: [[RESULT:%.*]] = call swiftcc i64 @indirect_guaranteed_captured_class_param(i64 %0, ptr noalias captures(none) dereferenceable({{.*}}) [[X_TMP]] // CHECK-NOT: retain // CHECK: call void @swift_release(ptr %1) // CHECK: ret i64 [[RESULT]] @@ -162,7 +162,7 @@ bb0(%x : $*SwiftClass): sil public_external @indirect_consumed_captured_class_param : $@convention(thin) (Int, @in SwiftClass) -> Int -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { ptr, ptr } @partial_apply_indirect_consumed_class_param(ptr noalias nocapture dereferenceable({{.*}}) %0) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { ptr, ptr } @partial_apply_indirect_consumed_class_param(ptr noalias captures(none) dereferenceable({{.*}}) %0) // CHECK-NOT: {{retain|release}} // CHECK: [[CONTEXT_OBJ:%.*]] = load ptr, ptr %0 // CHECK-NOT: {{retain|release}} @@ -175,7 +175,7 @@ sil public_external @indirect_consumed_captured_class_param : $@convention(thin) // CHECK-NOT: load // CHECK-NOT: retain // CHECK-NOT: release -// CHECK: [[RESULT:%.*]] = call swiftcc i64 @indirect_consumed_captured_class_param(i64 %0, ptr noalias nocapture dereferenceable({{.*}}) [[X_TMP]]) +// CHECK: [[RESULT:%.*]] = call swiftcc i64 @indirect_consumed_captured_class_param(i64 %0, ptr noalias captures(none) dereferenceable({{.*}}) [[X_TMP]]) // CHECK-NOT: retain // CHECK-NOT: release // CHECK: ret i64 [[RESULT]] @@ -227,7 +227,7 @@ bb0(%x : $SwiftClassPair): sil public_external @indirect_guaranteed_captured_class_pair_param : $@convention(thin) (Int, @in_guaranteed SwiftClassPair) -> Int -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { ptr, ptr } @partial_apply_indirect_guaranteed_class_pair_param(ptr noalias nocapture dereferenceable({{.*}}) %0) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { ptr, ptr } @partial_apply_indirect_guaranteed_class_pair_param(ptr noalias captures(none) dereferenceable({{.*}}) %0) // CHECK: [[CONTEXT_OBJ:%.*]] = call noalias ptr @swift_allocObject // CHECK-NOT: {{retain|release}} // CHECK: [[T0:%.*]] = insertvalue {{.*}} [[PARTIAL_APPLY_FORWARDER:@"\$s[A-Za-z0-9_]+TA"]], {{.*}} [[CONTEXT_OBJ]] @@ -237,7 +237,7 @@ sil public_external @indirect_guaranteed_captured_class_pair_param : $@conventio // CHECK: [[PAIR_ADDR:%.*]] = getelementptr // CHECK-NOT: load // CHECK-NOT: retain -// CHECK: [[RESULT:%.*]] = call swiftcc i64 @indirect_guaranteed_captured_class_pair_param(i64 %0, ptr noalias nocapture dereferenceable({{.*}}) [[PAIR_ADDR]]) +// CHECK: [[RESULT:%.*]] = call swiftcc i64 @indirect_guaranteed_captured_class_pair_param(i64 %0, ptr noalias captures(none) dereferenceable({{.*}}) [[PAIR_ADDR]]) // CHECK: release{{.*}}%1) // CHECK: ret i64 [[RESULT]] @@ -250,7 +250,7 @@ bb0(%x : $*SwiftClassPair): sil public_external @indirect_consumed_captured_class_pair_param : $@convention(thin) (Int, @in SwiftClassPair) -> Int -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { ptr, ptr } @partial_apply_indirect_consumed_class_pair_param(ptr noalias nocapture dereferenceable({{.*}}) %0) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { ptr, ptr } @partial_apply_indirect_consumed_class_pair_param(ptr noalias captures(none) dereferenceable({{.*}}) %0) // CHECK: [[CONTEXT_OBJ:%.*]] = call noalias ptr @swift_allocObject // CHECK-NOT: {{retain|release}} // CHECK: [[T0:%.*]] = insertvalue {{.*}} [[PARTIAL_APPLY_FORWARDER:@"\$s[A-Za-z0-9_]+TA"]], {{.*}} [[CONTEXT_OBJ]] @@ -260,7 +260,7 @@ sil public_external @indirect_consumed_captured_class_pair_param : $@convention( // CHECK: [[X_TMP:%.*]] = alloca // CHECK: call ptr @"$s13partial_apply14SwiftClassPairVWOc" // CHECK: release{{.*}}%1) -// CHECK: [[RESULT:%.*]] = call swiftcc i64 @indirect_consumed_captured_class_pair_param(i64 %0, ptr noalias nocapture dereferenceable({{.*}}) [[X_TMP]]) +// CHECK: [[RESULT:%.*]] = call swiftcc i64 @indirect_consumed_captured_class_pair_param(i64 %0, ptr noalias captures(none) dereferenceable({{.*}}) [[X_TMP]]) // CHECK: ret i64 [[RESULT]] sil @partial_apply_indirect_consumed_class_pair_param : $@convention(thin) (@in SwiftClassPair) -> @callee_owned (Int) -> Int { @@ -472,7 +472,7 @@ sil public_external @generic_indirect_return : $@convention(thin) (Int) -> @ // CHECK-LABEL: define{{.*}} @partial_apply_generic_indirect_return // CHECK: insertvalue {{.*}}$s23generic_indirect_returnTA -// CHECK-LABEL: define internal swiftcc void @"$s23generic_indirect_returnTA"(ptr noalias nocapture sret({{.*}}) %0, ptr swiftself +// CHECK-LABEL: define internal swiftcc void @"$s23generic_indirect_returnTA"(ptr noalias captures(none) sret({{.*}}) %0, ptr swiftself // CHECK: call swiftcc void @generic_indirect_return({{.*}} %0, // CHECK: ret void sil @partial_apply_generic_indirect_return : $@convention(thin) (Int) -> @callee_owned () -> @owned GenericEnum { @@ -500,7 +500,7 @@ sil public_external @generic_indirect_return2 : $@convention(thin) (Int) -> // CHECK: [[R2:%.*]] = insertvalue { ptr, ptr } [[R1]], ptr [[CTX2]], 1 // CHECK: ret { ptr, ptr } [[R2]] -// CHECK-LABEL: define internal swiftcc void @"$s24generic_indirect_return2TA"(ptr noalias nocapture sret({{.*}}) %0, ptr swiftself %1) +// CHECK-LABEL: define internal swiftcc void @"$s24generic_indirect_return2TA"(ptr noalias captures(none) sret({{.*}}) %0, ptr swiftself %1) // CHECK: call swiftcc void @generic_indirect_return2(ptr noalias sret({{.*}}) %0, // CHECK: ret void sil @partial_apply_generic_indirect_return2 : $@convention(thin) (Int) -> @callee_owned () -> @owned GenericEnum2 { diff --git a/test/IRGen/partial_apply_coro.sil b/test/IRGen/partial_apply_coro.sil index 26ed13a46b652..40e6f58c093ca 100644 --- a/test/IRGen/partial_apply_coro.sil +++ b/test/IRGen/partial_apply_coro.sil @@ -1012,7 +1012,7 @@ bb0(%x : $SwiftClass): } // CHECK-LABEL: define {{.*}} { ptr, ptr } @indirect_guaranteed_captured_class_param -// CHECK-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE]]) %0, [[ARGTYPE:i32|i64]] %1, ptr noalias nocapture dereferenceable([[ARGPTR_SIZE:4|8]]) %2) +// CHECK-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE]]) %0, [[ARGTYPE:i32|i64]] %1, ptr noalias captures(none) dereferenceable([[ARGPTR_SIZE:4|8]]) %2) sil public @indirect_guaranteed_captured_class_param : $@yield_once @convention(thin) (Int, @in_guaranteed SwiftClass) -> (@yields SwiftClass) { entry(%i : $Int, %c : $*SwiftClass): %0 = builtin "int_trap"() : $Never @@ -1020,7 +1020,7 @@ entry(%i : $Int, %c : $*SwiftClass): } // CHECK-LABEL: define {{.*}} { ptr, ptr } @partial_apply_indirect_guaranteed_class_param -// CHECK-SAME: (ptr noalias nocapture dereferenceable([[ARGPTR_SIZE]]) %[[ARGPTR:.*]]) +// CHECK-SAME: (ptr noalias captures(none) dereferenceable([[ARGPTR_SIZE]]) %[[ARGPTR:.*]]) // CHECK: entry: // CHECK: %[[ARG:.*]] = load ptr, ptr %[[ARGPTR]] // CHECK: %[[RET:.*]] = insertvalue { ptr, ptr } { ptr @"$s40indirect_guaranteed_captured_class_paramTA{{.*}}", ptr undef }, ptr %[[ARG]], 1 @@ -1037,7 +1037,7 @@ entry(%i : $Int, %c : $*SwiftClass): // CHECK: store ptr %[[PA_CTX_BOX]], ptr %[[SELFPTR]] // CHECK: %[[FRAMEPTR:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAME]], i32 0, i32 0 // CHECK: call void @llvm.lifetime.start.p0(i64 [[BUFFER_SIZE]], ptr %[[FRAMEPTR]]) -// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, ptr } @indirect_guaranteed_captured_class_param(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], [[ARG_TYPE]] %[[ARG0]], ptr noalias nocapture dereferenceable([[ARGPTR_SIZE]]) %[[SELFPTR]]) +// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, ptr } @indirect_guaranteed_captured_class_param(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], [[ARG_TYPE]] %[[ARG0]], ptr noalias captures(none) dereferenceable([[ARGPTR_SIZE]]) %[[SELFPTR]]) // CHECK: %[[RESUME:.*]] = extractvalue { ptr, ptr } %[[YIELD_PAIR]], 0 // CHECK: %[[SPILL2:.*]] = getelementptr inbounds %"$s40indirect_guaranteed_captured_class_paramTA.Frame", ptr %[[SPILL]], i32 0, i32 1 // CHECK: store ptr %[[RESUME]], ptr %[[SPILL2]] @@ -1079,7 +1079,7 @@ bb0(%x : $*SwiftClass): } // CHECK-LABEL: define {{.*}} { ptr, ptr } @indirect_consumed_captured_class_param -// CHECK-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE:(16|32)]]) %0, [[ARGTYPE:(i32|i64)]] %1, ptr noalias nocapture dereferenceable([[ARGPTR_SIZE:(4|8)]]) %2) +// CHECK-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE:(16|32)]]) %0, [[ARGTYPE:(i32|i64)]] %1, ptr noalias captures(none) dereferenceable([[ARGPTR_SIZE:(4|8)]]) %2) sil public @indirect_consumed_captured_class_param : $@yield_once @convention(thin) (Int, @in SwiftClass) -> (@yields SwiftClass) { entry(%i : $Int, %c : $*SwiftClass): %0 = builtin "int_trap"() : $Never @@ -1087,7 +1087,7 @@ entry(%i : $Int, %c : $*SwiftClass): } // CHECK-LABEL: define {{.*}} { ptr, ptr } @partial_apply_indirect_consumed_class_param -// CHECK-SAME: (ptr noalias nocapture dereferenceable([[ARGPTR_SIZE]]) %[[ARGPTR:.*]]) +// CHECK-SAME: (ptr noalias captures(none) dereferenceable([[ARGPTR_SIZE]]) %[[ARGPTR:.*]]) // CHECK: entry: // CHECK: %[[ARG:.*]] = load ptr, ptr %[[ARGPTR]] // CHECK: %[[RET:.*]] = insertvalue { ptr, ptr } { ptr @"$s38indirect_consumed_captured_class_paramTA{{.*}}", ptr undef }, ptr %[[ARG]], 1 @@ -1105,7 +1105,7 @@ entry(%i : $Int, %c : $*SwiftClass): // CHECK: store ptr %[[PA_CTX_BOX]], ptr %[[SELFPTR]] // CHECK: %[[FRAMEPTR:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAME]], i32 0, i32 0 // CHECK: call void @llvm.lifetime.start.p0(i64 [[BUFFER_SIZE]], ptr %[[FRAMEPTR]]) -// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, ptr } @indirect_consumed_captured_class_param(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], [[ARG_TYPE]] %[[ARG0]], ptr noalias nocapture dereferenceable([[ARGPTR_SIZE]]) %[[SELFPTR]]) +// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, ptr } @indirect_consumed_captured_class_param(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], [[ARG_TYPE]] %[[ARG0]], ptr noalias captures(none) dereferenceable([[ARGPTR_SIZE]]) %[[SELFPTR]]) // CHECK: %[[RESUME:.*]] = extractvalue { ptr, ptr } %[[YIELD_PAIR]], 0 // CHECK: %[[SPILL2:.*]] = getelementptr inbounds %"$s38indirect_consumed_captured_class_paramTA.Frame", ptr %[[SPILL]], i32 0, i32 1 // CHECK: store ptr %[[RESUME]], ptr %[[SPILL2]] @@ -1231,7 +1231,7 @@ bb0(%x : $SwiftClassPair): // CHECK-64-LABEL: define {{.*}} { ptr, i64 } @indirect_guaranteed_captured_class_pair_param // CHECK-32-LABEL: define {{.*}} { ptr, i32 } @indirect_guaranteed_captured_class_pair_param -// CHECK-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE:(16|32)]]) %0, [[ARG_TYPE:(i32|i64)]] %1, ptr noalias nocapture dereferenceable([[PAIR_SIZE:(8|16)]]) %2) +// CHECK-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE:(16|32)]]) %0, [[ARG_TYPE:(i32|i64)]] %1, ptr noalias captures(none) dereferenceable([[PAIR_SIZE:(8|16)]]) %2) sil public @indirect_guaranteed_captured_class_pair_param : $@yield_once @convention(thin) (Int, @in_guaranteed SwiftClassPair) -> (@yields Int) { entry(%i : $Int, %c : $*SwiftClassPair): %0 = builtin "int_trap"() : $Never @@ -1239,7 +1239,7 @@ entry(%i : $Int, %c : $*SwiftClassPair): } // CHECK-LABEL: define {{.*}} { ptr, ptr } @partial_apply_indirect_guaranteed_class_pair_param -// CHECK-SAME: (ptr noalias nocapture dereferenceable([[PAIR_SIZE]]) %[[ARG:.*]]) +// CHECK-SAME: (ptr noalias captures(none) dereferenceable([[PAIR_SIZE]]) %[[ARG:.*]]) // CHECK: entry: // CHECK: %[[BOX:.*]] = call noalias ptr @swift_allocObject(ptr getelementptr inbounds (%swift.full_boxmetadata, ptr @metadata.{{.*}} // CHECK: %[[BOXPTR:.*]] = getelementptr inbounds <{ %swift.refcounted, %T18partial_apply_coro14SwiftClassPairV }>, ptr %[[BOX]], i32 0, i32 1 @@ -1258,7 +1258,7 @@ entry(%i : $Int, %c : $*SwiftClassPair): // CHECK: %[[PA_CTX:.*]] = getelementptr inbounds <{ %swift.refcounted, %T18partial_apply_coro14SwiftClassPairV }>, ptr %[[PA_CTX_BOX]], i32 0, i32 1 // CHECK: %[[FRAMEPTR:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[SPILL1]], i32 0, i32 0 // CHECK: call void @llvm.lifetime.start.p0(i64 [[BUFFER_SIZE]], ptr %[[FRAMEPTR]]) -// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, [[ARG_TYPE]] } @indirect_guaranteed_captured_class_pair_param(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], [[ARG_TYPE]] %1, ptr noalias nocapture dereferenceable([[PAIR_SIZE]]) %[[PA_CTX]]) +// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, [[ARG_TYPE]] } @indirect_guaranteed_captured_class_pair_param(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], [[ARG_TYPE]] %1, ptr noalias captures(none) dereferenceable([[PAIR_SIZE]]) %[[PA_CTX]]) // CHECK: %[[RESUME:.*]] = extractvalue { ptr, [[ARG_TYPE]] } %[[YIELD_PAIR]], 0 // CHECK: %[[SPILL2:.*]] = getelementptr inbounds %"$s45indirect_guaranteed_captured_class_pair_paramTA.Frame", ptr %[[SPILL]], i32 0, i32 1 // CHECK: store ptr %[[RESUME]], ptr %[[SPILL2]] @@ -1301,7 +1301,7 @@ bb0(%x : $*SwiftClassPair): // CHECK-32-LABEL: define {{.*}} { ptr, i32 } @indirect_consumed_captured_class_pair_param // CHECK-64-LABEL: define {{.*}} { ptr, i64 } @indirect_consumed_captured_class_pair_param -// CHECK-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE]]) %0, [[ARG_TYPE]] %1, ptr noalias nocapture dereferenceable([[PAIR_SIZE]]) %2) +// CHECK-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE]]) %0, [[ARG_TYPE]] %1, ptr noalias captures(none) dereferenceable([[PAIR_SIZE]]) %2) sil public @indirect_consumed_captured_class_pair_param : $@yield_once @convention(thin) (Int, @in SwiftClassPair) -> (@yields Int) { entry(%i : $Int, %c : $*SwiftClassPair): %0 = builtin "int_trap"() : $Never @@ -1309,7 +1309,7 @@ entry(%i : $Int, %c : $*SwiftClassPair): } // CHECK-LABEL: define {{.*}} { ptr, ptr } @partial_apply_indirect_consumed_class_pair_param -// CHECK-SAME: (ptr noalias nocapture dereferenceable([[PAIR_SIZE]]) %[[ARG:.*]]) +// CHECK-SAME: (ptr noalias captures(none) dereferenceable([[PAIR_SIZE]]) %[[ARG:.*]]) // CHECK: entry: // CHECK: %[[BOX:.*]] = call noalias ptr @swift_allocObject(ptr getelementptr inbounds (%swift.full_boxmetadata, ptr @metadata.{{.*}} // CHECK: %[[BOXPTR:.*]] = getelementptr inbounds <{ %swift.refcounted, %T18partial_apply_coro14SwiftClassPairV }>, ptr %[[BOX]], i32 0, i32 1 @@ -1331,7 +1331,7 @@ entry(%i : $Int, %c : $*SwiftClassPair): // CHECK: %{{.*}} = call ptr @"$s18partial_apply_coro14SwiftClassPairVWOc"(ptr %[[PA_CTX]], ptr %[[SPILL1]]) // CHECK: %[[FRAMEPTR:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAME]], i32 0, i32 0 // CHECK: call void @llvm.lifetime.start.p0(i64 [[BUFFER_SIZE]], ptr %[[FRAMEPTR]]) -// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, [[ARG_TYPE]] } @indirect_consumed_captured_class_pair_param(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], [[ARG_TYPE]] %1, ptr noalias nocapture dereferenceable([[PAIR_SIZE]]) %[[SPILL1]]) +// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, [[ARG_TYPE]] } @indirect_consumed_captured_class_pair_param(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], [[ARG_TYPE]] %1, ptr noalias captures(none) dereferenceable([[PAIR_SIZE]]) %[[SPILL1]]) // CHECK: %[[RESUME:.*]] = extractvalue { ptr, [[ARG_TYPE]] } %[[YIELD_PAIR]], 0 // CHECK: %[[SPILL2:.*]] = getelementptr inbounds %"$s43indirect_consumed_captured_class_pair_paramTA.Frame", ptr %[[SPILL]], i32 0, i32 2 // CHECK: store ptr %[[RESUME]], ptr %[[SPILL2]] @@ -2059,7 +2059,7 @@ class A3 {} sil_vtable A3 {} // CHECK-LABEL: define {{.*}} { ptr, ptr, ptr } @amethod -// CHECK-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE:(16|32)]]) %0, ptr noalias nocapture swiftself dereferenceable([[SELF_SIZE:(4|8)]]) %1, ptr noalias nocapture swifterror dereferenceable([[ERROR_SIZE:(4|8)]]) %2) +// CHECK-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE:(16|32)]]) %0, ptr noalias captures(none) swiftself dereferenceable([[SELF_SIZE:(4|8)]]) %1, ptr noalias captures(none) swifterror dereferenceable([[ERROR_SIZE:(4|8)]]) %2) sil @amethod : $@yield_once @convention(method) (@in_guaranteed A2) -> (@yields A1, @error Error) { entry(%a : $*A2): %0 = builtin "int_trap"() : $Never @@ -2067,13 +2067,13 @@ entry(%a : $*A2): } // CHECK-LABEL: define {{.*}} { ptr, ptr } @repo -// CHECK-SAME: (ptr noalias nocapture dereferenceable([[SELF_SIZE]]) %[[ARG:.*]]) +// CHECK-SAME: (ptr noalias captures(none) dereferenceable([[SELF_SIZE]]) %[[ARG:.*]]) // CHECK: %[[RET:.*]] = insertvalue { ptr, ptr } { ptr @"$s7amethodTA{{.*}}", ptr undef }, ptr %{{.*}}, 1 // CHECK: ret { ptr, ptr } %[[RET]] // CHECK: } // // CHECK-LABEL: define {{.*}} { ptr, ptr, ptr } @"$s7amethodTA" -// CHECK-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[CTX:.*]], ptr swiftself %[[SELF:.*]], ptr noalias nocapture swifterror dereferenceable([[ERROR_SIZE]]) %[[ERRORPTR:.*]]) +// CHECK-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[CTX:.*]], ptr swiftself %[[SELF:.*]], ptr noalias captures(none) swifterror dereferenceable([[ERROR_SIZE]]) %[[ERRORPTR:.*]]) // CHECK: entry: // CHECK: %[[SELFPTR:.*]] = alloca ptr // CHECK: %[[SPILL:.*]] = call ptr @malloc @@ -2083,7 +2083,7 @@ entry(%a : $*A2): // CHECK: %[[FRAMEPTR:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAME]], i32 0, i32 0 // CHECK: call void @llvm.lifetime.start.p0(i64 [[BUFFER_SIZE]], ptr %[[FRAMEPTR]]) // CHECK: store ptr null, ptr %[[ERRORPTR]] -// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, ptr, ptr } @amethod(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], ptr noalias nocapture swiftself dereferenceable([[SELF_SIZE]]) %[[SELFPTR]], ptr noalias nocapture swifterror dereferenceable([[ERROR_SIZE]]) %[[ERRORPTR]]) +// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, ptr, ptr } @amethod(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], ptr noalias captures(none) swiftself dereferenceable([[SELF_SIZE]]) %[[SELFPTR]], ptr noalias captures(none) swifterror dereferenceable([[ERROR_SIZE]]) %[[ERRORPTR]]) // CHECK: %[[ERRORVAL:.*]] = load ptr, ptr %[[ERRORPTR]] // CHECK: %[[RESUME0:.*]] = extractvalue { ptr, ptr, ptr } %[[YIELD_PAIR]], 0 // CHECK: %[[SPILL2:.*]] = getelementptr inbounds %"$s7amethodTA.Frame", ptr %[[SPILL]], i32 0, i32 1 @@ -2137,7 +2137,7 @@ bb0(%0 : $*A2): } // CHECK-LABEL: define {{.*}} { ptr, ptr } @partial_apply_callee_guaranteed_indirect_guaranteed_class_pair_param -// CHECK-SAME: (ptr noalias nocapture dereferenceable([[ARG_SIZE:(8|16)]]) %[[ARG:.*]]) +// CHECK-SAME: (ptr noalias captures(none) dereferenceable([[ARG_SIZE:(8|16)]]) %[[ARG:.*]]) // CHECK: entry: // CHECK: %[[BOX:.*]] = call noalias ptr @swift_allocObject(ptr getelementptr inbounds (%swift.full_boxmetadata, ptr @metadata // CHECK: %[[BOXPTR:.*]] = getelementptr inbounds <{ %swift.refcounted, %T18partial_apply_coro14SwiftClassPairV }>, ptr %[[BOX]], i32 0, i32 1 @@ -2156,7 +2156,7 @@ bb0(%0 : $*A2): // CHECK: %[[PA_CTX:.*]] = getelementptr inbounds <{ %swift.refcounted, %T18partial_apply_coro14SwiftClassPairV }>, ptr %[[PA_CTX_BOX]], i32 0, i32 1 // CHECK: %[[PA_ARG:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAME]], i32 0, i32 0 // CHECK: call void @llvm.lifetime.start.p0(i64 [[BUFFER_SIZE]], ptr %[[PA_ARG]]) -// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, [[ARG_TYPE]] } @indirect_guaranteed_captured_class_pair_param(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[PA_ARG]], [[ARG_TYPE]] %[[ARG0]], ptr noalias nocapture dereferenceable({{8|16}}) %[[PA_CTX]]) +// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, [[ARG_TYPE]] } @indirect_guaranteed_captured_class_pair_param(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[PA_ARG]], [[ARG_TYPE]] %[[ARG0]], ptr noalias captures(none) dereferenceable({{8|16}}) %[[PA_CTX]]) // CHECK: %[[RESUME:.*]] = extractvalue { ptr, [[ARG_TYPE]] } %[[YIELD_PAIR]], 0 // CHECK: %[[SPILL2:.*]] = getelementptr inbounds %"$s45indirect_guaranteed_captured_class_pair_paramTA.{{[0-9]+}}.Frame", ptr %[[SPILL]], i32 0, i32 1 // CHECK: store ptr %[[RESUME]], ptr %[[SPILL2]], @@ -2201,7 +2201,7 @@ bb0(%x : $*SwiftClassPair): sil public_external @use_closure2 : $@yield_once @convention(thin) (@noescape @yield_once @callee_guaranteed (Int) -> (@yields Int)) -> (@yields Int) // CHECK-LABEL: define {{.*}} @partial_apply_stack_callee_guaranteed_indirect_guaranteed_class_pair_param -// CHECK-SAME: (ptr noalias nocapture dereferenceable([[ARG_SIZE:(8|16)]]) %[[ARG:.*]]) +// CHECK-SAME: (ptr noalias captures(none) dereferenceable([[ARG_SIZE:(8|16)]]) %[[ARG:.*]]) // CHECK: entry: // CHECK: %[[CTX:.*]] = alloca [[[BUFFER_SIZE]] x i8] // CHECK: %[[BOX:.*]] = alloca i8 @@ -2228,7 +2228,7 @@ sil public_external @use_closure2 : $@yield_once @convention(thin) (@noescape @y // CHECK: %[[PA_ARG:.*]] = load ptr, ptr %[[PA_CTX]] // CHECK: %[[FRAMEPTR:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAME]], i32 0, i32 0 // CHECK: call void @llvm.lifetime.start.p0(i64 [[BUFFER_SIZE]], ptr %[[FRAMEPTR]]) -// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, [[ARG_TYPE]] } @indirect_guaranteed_captured_class_pair_param(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], [[ARG_TYPE]] %[[ARG0]], ptr noalias nocapture dereferenceable({{8|16}}) %[[PA_ARG]]) +// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, [[ARG_TYPE]] } @indirect_guaranteed_captured_class_pair_param(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], [[ARG_TYPE]] %[[ARG0]], ptr noalias captures(none) dereferenceable({{8|16}}) %[[PA_ARG]]) // CHECK: %[[RESUME:.*]] = extractvalue { ptr, [[ARG_TYPE]] } %[[YIELD_PAIR]], 0 // CHECK: %[[SPILL2:.*]] = getelementptr inbounds %"$s45indirect_guaranteed_captured_class_pair_paramTA.{{[0-9]+}}.Frame", ptr %[[SPILL]], i32 0, i32 1 // CHECK: store ptr %[[RESUME]], ptr %[[SPILL2]] @@ -2276,7 +2276,7 @@ bb0(%x : $*SwiftClassPair): // CHECK-32-LABEL: define {{.*}} { ptr, i32 } @indirect_in_captured_class_pair_param // CHECK-64-LABEL: define {{.*}} { ptr, i64 } @indirect_in_captured_class_pair_param -// CHECK-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE:(16|32)]]) %0, [[ARG_TYPE:(i32|i64)]] %{{.*}}, ptr noalias nocapture dereferenceable([[PAIR_SIZE:(8|16)]]) %{{.*}}) +// CHECK-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE:(16|32)]]) %0, [[ARG_TYPE:(i32|i64)]] %{{.*}}, ptr noalias captures(none) dereferenceable([[PAIR_SIZE:(8|16)]]) %{{.*}}) sil public @indirect_in_captured_class_pair_param : $@yield_once @convention(thin) (Int, @in_guaranteed SwiftClassPair) -> (@yields Int) { entry(%i : $Int, %p : $*SwiftClassPair): %0 = builtin "int_trap"() : $Never @@ -2284,7 +2284,7 @@ entry(%i : $Int, %p : $*SwiftClassPair): } // CHECK-LABEL: define {{.*}} void @partial_apply_stack_callee_guaranteed_indirect_in_class_pair_param -// CHECK-SAME: (ptr noalias nocapture dereferenceable([[PAIR_SIZE]]) %[[ARG:.*]]) +// CHECK-SAME: (ptr noalias captures(none) dereferenceable([[PAIR_SIZE]]) %[[ARG:.*]]) // CHECK: entry: // CHECK: %[[CTX:.*]] = alloca [[[BUFFER_SIZE]] x i8], // CHECK: %[[BOX:.*]] = alloca i8 @@ -2312,7 +2312,7 @@ entry(%i : $Int, %p : $*SwiftClassPair): // CHECK: %[[PA_ARG:.*]] = load ptr, ptr %[[PA_CTX]] // CHECK: %[[FRAMEPTR:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAME]], i32 0, i32 0 // CHECK: call void @llvm.lifetime.start.p0(i64 [[BUFFER_SIZE]], ptr %[[FRAMEPTR]]) -// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, [[ARG_TYPE]] } @indirect_in_captured_class_pair_param(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], [[ARG_TYPE]] %[[ARG0]], ptr noalias nocapture dereferenceable([[PAIR_SIZE]]) %[[PA_ARG]]) +// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, [[ARG_TYPE]] } @indirect_in_captured_class_pair_param(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], [[ARG_TYPE]] %[[ARG0]], ptr noalias captures(none) dereferenceable([[PAIR_SIZE]]) %[[PA_ARG]]) // CHECK: %[[RESUME:.*]] = extractvalue { ptr, [[ARG_TYPE]] } %[[YIELD_PAIR]], 0 // CHECK: %[[SPILL2:.*]] = getelementptr inbounds %"$s37indirect_in_captured_class_pair_paramTA.Frame", ptr %[[SPILL]], i32 0, i32 1 // CHECK: store ptr %[[RESUME]], ptr %[[SPILL2]] @@ -2477,7 +2477,7 @@ entry: // CHECK-32: define {{.*}} { ptr, i32 } @indirect_in_constant_captured_class_pair_param // CHECK-64: define {{.*}} { ptr, i64 } @indirect_in_constant_captured_class_pair_param -// CHECK-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE:(16|32)]]) %0, [[ARG_TYPE:(i32|i64)]] %1, ptr noalias nocapture dereferenceable([[PAIR_SIZE:(8|16)]]) %2) +// CHECK-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE:(16|32)]]) %0, [[ARG_TYPE:(i32|i64)]] %1, ptr noalias captures(none) dereferenceable([[PAIR_SIZE:(8|16)]]) %2) sil public @indirect_in_constant_captured_class_pair_param : $@yield_once @convention(thin) (Int, @in_guaranteed SwiftClassPair) -> (@yields Int) { entry(%i : $Int, %ic : $*SwiftClassPair): %0 = builtin "int_trap"() : $Never @@ -2485,7 +2485,7 @@ entry(%i : $Int, %ic : $*SwiftClassPair): } // CHECK-LABEL: define {{.*}} void @partial_apply_stack_callee_guaranteed_indirect_in_constant_class_pair_param -// CHECK-SAME: (ptr noalias nocapture dereferenceable([[PAIR_SIZE]]) %[[ARG:.*]]) +// CHECK-SAME: (ptr noalias captures(none) dereferenceable([[PAIR_SIZE]]) %[[ARG:.*]]) // CHECK: entry: // CHECK: %[[CTX:.*]] = alloca [[[BUFFER_SIZE]] x i8] // CHECK: %[[BOX:.*]] = alloca i8 @@ -2513,7 +2513,7 @@ entry(%i : $Int, %ic : $*SwiftClassPair): // CHECK: %[[PA_ARG:.*]] = load ptr, ptr %[[PA_CTX]] // CHECK: %[[FRAMEPTR:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAME]], i32 0, i32 0 // CHECK: call void @llvm.lifetime.start.p0(i64 [[BUFFER_SIZE]], ptr %[[FRAMEPTR]]) -// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, [[ARG_TYPE]] } @indirect_in_constant_captured_class_pair_param(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], [[ARG_TYPE]] %[[ARG0]], ptr noalias nocapture dereferenceable([[PAIR_SIZE]]) %[[PA_ARG]]) +// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, [[ARG_TYPE]] } @indirect_in_constant_captured_class_pair_param(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], [[ARG_TYPE]] %[[ARG0]], ptr noalias captures(none) dereferenceable([[PAIR_SIZE]]) %[[PA_ARG]]) // CHECK: %[[RESUME:.*]] = extractvalue { ptr, [[ARG_TYPE]] } %[[YIELD_PAIR]], 0 // CHECK: %[[SPILL2:.*]] = getelementptr inbounds %"$s46indirect_in_constant_captured_class_pair_paramTA.Frame", ptr %[[SPILL]], i32 0, i32 1 // CHECK: store ptr %[[RESUME]], ptr %[[SPILL2]] @@ -2579,7 +2579,7 @@ bb0(%thick : $@callee_guaranteed @yield_once @convention(thick) (Int64, Int32) - // CHECK: } // // CHECK-LABEL: define {{.*}} ptr @"$s16external_closureTA" -// CHECK-SAME: (ptr noalias {{.*}} %[[CTX:.*]], [[ARG_TYPE]] %[[ARG1:.*]], ptr swiftself %[[PA_CTX_BOX:.*]], ptr noalias nocapture swifterror {{.*}} %[[ERROR:.*]]) +// CHECK-SAME: (ptr noalias {{.*}} %[[CTX:.*]], [[ARG_TYPE]] %[[ARG1:.*]], ptr swiftself %[[PA_CTX_BOX:.*]], ptr noalias captures(none) swifterror {{.*}} %[[ERROR:.*]]) // CHECK: entry: // CHECK: %[[SPILL:.*]] = call ptr @malloc // CHECK: store ptr %[[SPILL]], ptr %[[CTX]] @@ -2590,7 +2590,7 @@ bb0(%thick : $@callee_guaranteed @yield_once @convention(thick) (Int64, Int32) - // CHECK: %[[FRAMEPTR:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAME]], i32 0, i32 0 // CHECK: call void @llvm.lifetime.start.p0(i64 [[BUFFER_SIZE]], ptr %[[FRAMEPTR]]) // CHECK: store ptr null, ptr %[[ERROR]] -// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc ptr @external_closure(ptr noalias {{.*}} %[[FRAMEPTR]], [[ARG_TYPE]] %[[ARG1]], [[ARG_TYPE]] %[[ARG2]], ptr swiftself undef, ptr noalias nocapture swifterror {{.*}} %[[ERROR]]) +// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc ptr @external_closure(ptr noalias {{.*}} %[[FRAMEPTR]], [[ARG_TYPE]] %[[ARG1]], [[ARG_TYPE]] %[[ARG2]], ptr swiftself undef, ptr noalias captures(none) swifterror {{.*}} %[[ERROR]]) // CHECK: %[[SPILL1:.*]] = getelementptr inbounds %"$s16external_closureTA.Frame", ptr %[[SPILL]], i32 0, i32 1 // CHECK: store ptr %[[YIELD_PAIR]], ptr %[[SPILL1]] // CHECK: %[[ERRORVAL:.*]] = load ptr, ptr %[[ERROR]] diff --git a/test/IRGen/partial_apply_generic.swift b/test/IRGen/partial_apply_generic.swift index 20796c87214f0..d8a13172eb81d 100644 --- a/test/IRGen/partial_apply_generic.swift +++ b/test/IRGen/partial_apply_generic.swift @@ -37,7 +37,7 @@ var x = seq ~> split // Indirect return // -// CHECK-LABEL: define internal swiftcc { ptr, ptr } @"$s21partial_apply_generic5split{{[_0-9a-zA-Z]*}}FTA"(ptr noalias nocapture %0, ptr swiftself %1) +// CHECK-LABEL: define internal swiftcc { ptr, ptr } @"$s21partial_apply_generic5split{{[_0-9a-zA-Z]*}}FTA"(ptr noalias captures(none) %0, ptr swiftself %1) // CHECK: tail call swiftcc { ptr, ptr } @"$s21partial_apply_generic5split{{[_0-9a-zA-Z]*}}F"(ptr noalias %0, struct HugeStruct { var a, b, c, d: Int } diff --git a/test/IRGen/pre_specialize.swift b/test/IRGen/pre_specialize.swift index b959a4833cab3..d9901116c6e65 100644 --- a/test/IRGen/pre_specialize.swift +++ b/test/IRGen/pre_specialize.swift @@ -42,12 +42,12 @@ // specialized InternalThing.computedX.getter // CHECK-A-DAG: define{{( dllexport)?}}{{( protected)?}} swiftcc [[INT]] @"$s1A13InternalThingV9computedXxvgSi_Ts5"([[INT]]{{( returned)?}} %0) // specialized InternalThing.computedX.setter -// CHECK-A-DAG: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s1A13InternalThingV9computedXxvsSi_Ts5"([[INT]] %0, ptr nocapture swiftself {{(writeonly )?}}dereferenceable({{(4|8)}}) %1) +// CHECK-A-DAG: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s1A13InternalThingV9computedXxvsSi_Ts5"([[INT]] %0, ptr captures(none) swiftself {{(writeonly )?}}dereferenceable({{(4|8)}}) %1) // specialized InternalThing.subscript.getter // CHECK-A-DAG: define{{( dllexport)?}}{{( protected)?}} swiftcc [[INT]] @"$s1A13InternalThingVyxSicigSi_Ts5"([[INT]] %0, [[INT]]{{( returned)?}} %1) // specialized InternalThing.subscript.setter -// CHECK-A-DAG: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s1A13InternalThingVyxSicisSi_Ts5"([[INT]] %0, [[INT]] %1, ptr nocapture swiftself {{(writeonly )?}}dereferenceable({{(4|8)}}) %2) +// CHECK-A-DAG: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s1A13InternalThingVyxSicisSi_Ts5"([[INT]] %0, [[INT]] %1, ptr captures(none) swiftself {{(writeonly )?}}dereferenceable({{(4|8)}}) %2) // specialized InternalRef.compute() // CHECK-A-FRAG-DAG: define{{( dllexport)?}}{{( protected)?}} swiftcc [[INT:(i64|i32)]] @"$s1A11InternalRefC7computexyFAA09ResilientA10BoxedThingVySiG_Ts5" @@ -76,13 +76,13 @@ // CHECK-B-DAG: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @"$s1A13InternalThingV9computedXxvg1B07AnotherB0C_Ts5"(ptr{{( returned)?}} %0) // specialized InternalThing.computedX.setter -// CHECK-B-DAG: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s1A13InternalThingV9computedXxvs1B07AnotherB0C_Ts5"(ptr %0, ptr nocapture swiftself dereferenceable({{(4|8)}}) %1) +// CHECK-B-DAG: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s1A13InternalThingV9computedXxvs1B07AnotherB0C_Ts5"(ptr %0, ptr captures(none) swiftself dereferenceable({{(4|8)}}) %1) // specialized InternalThing.subscript.getter // CHECK-B-DAG: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @"$s1A13InternalThingVyxSicig1B07AnotherB0C_Ts5"([[INT:(i64|i32)]] %0, ptr{{( returned)?}} %1) // specialized InternalThing.subscript.setter -// CHECK-B-DAG: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s1A13InternalThingVyxSicis1B07AnotherB0C_Ts5"(ptr %0, [[INT]] %1, ptr nocapture swiftself dereferenceable({{(4|8)}}) %2) +// CHECK-B-DAG: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s1A13InternalThingVyxSicis1B07AnotherB0C_Ts5"(ptr %0, [[INT]] %1, ptr captures(none) swiftself dereferenceable({{(4|8)}}) %2) // specialized InternalRef.compute() // CHECK-B-DAG: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @"$s1A11InternalRefC7computexyF1B12AnotherThingC_Ts5 diff --git a/test/IRGen/protocol_accessor_multifile.swift b/test/IRGen/protocol_accessor_multifile.swift index ee4c41e3ecd32..65ccc1c7b0a48 100644 --- a/test/IRGen/protocol_accessor_multifile.swift +++ b/test/IRGen/protocol_accessor_multifile.swift @@ -8,7 +8,7 @@ // CHECK-LABEL: define{{.*}} void @"$s27protocol_accessor_multifile14useExistentialyyF"() func useExistential() { // CHECK: [[BOX:%.+]] = alloca %T27protocol_accessor_multifile5ProtoP, - // CHECK: call swiftcc void @"$s27protocol_accessor_multifile17globalExistentialAA5Proto_pvg"(ptr noalias nocapture sret({{.*}}) [[BOX]]) + // CHECK: call swiftcc void @"$s27protocol_accessor_multifile17globalExistentialAA5Proto_pvg"(ptr noalias captures(none) sret({{.*}}) [[BOX]]) // CHECK: call swiftcc void @"$s27protocol_accessor_multifile5ProtoPAAE6methodyyF" globalExistential.method() // CHECK: call void @__swift_destroy_boxed_opaque_existential_1(ptr [[BOX]]) diff --git a/test/IRGen/protocol_resilience.sil b/test/IRGen/protocol_resilience.sil index 7d2c1784e7401..be9a0af541bc0 100644 --- a/test/IRGen/protocol_resilience.sil +++ b/test/IRGen/protocol_resilience.sil @@ -262,7 +262,7 @@ struct ConformingStruct : ResilientProtocol { static func defaultF() } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @noDefaultA(ptr noalias nocapture swiftself %0, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @noDefaultA(ptr noalias captures(none) swiftself %0, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: sil @noDefaultA : $@convention(witness_method: ResilientProtocol) (@in_guaranteed ConformingStruct) -> () { @@ -281,7 +281,7 @@ bb0(%0 : $*ConformingStruct): } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @noDefaultB(ptr noalias nocapture swiftself %0, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @noDefaultB(ptr noalias captures(none) swiftself %0, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: sil @noDefaultB : $@convention(witness_method: ResilientProtocol) (@in_guaranteed ConformingStruct) -> () { @@ -324,7 +324,7 @@ bb0(%0 : $*T): return %result : $() } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @passConformingType(ptr noalias nocapture %0) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @passConformingType(ptr noalias captures(none) %0) sil @passConformingType : $@convention(thin) (@in ResilientConformingType) -> () { bb0(%0 : $*ResilientConformingType): @@ -381,7 +381,7 @@ bb0(%0 : $*T): return %result : $() } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @passConformingTypeRefined(ptr noalias nocapture %0) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @passConformingTypeRefined(ptr noalias captures(none) %0) sil @passConformingTypeRefined : $@convention(thin) (@in AnotherConformingStruct) -> () { bb0(%0 : $*AnotherConformingStruct): @@ -424,7 +424,7 @@ bb0(%0 : $*T): return %result : $() } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @passConformingTypeAssoc(ptr noalias nocapture %0) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @passConformingTypeAssoc(ptr noalias captures(none) %0) sil @passConformingTypeAssoc : $@convention(thin) (@in ConformsWithResilientAssoc) -> () { bb0(%0 : $*ConformsWithResilientAssoc): diff --git a/test/IRGen/protocol_resilience_thunks.swift b/test/IRGen/protocol_resilience_thunks.swift index 7317d671b3690..491fec9c2dffe 100644 --- a/test/IRGen/protocol_resilience_thunks.swift +++ b/test/IRGen/protocol_resilience_thunks.swift @@ -52,12 +52,12 @@ public protocol MyResilientProtocol { // CHECK-NEXT: [[RESULT:%.*]] = call swiftcc i1 [[WITNESS]](ptr noalias swiftself %0, ptr %1, ptr %2) // CHECK-NEXT: ret i1 [[RESULT]] -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s26protocol_resilience_thunks19MyResilientProtocolP10returnsAnyypyFTj"(ptr noalias nocapture sret({{.*}}) %0, ptr noalias swiftself %1, ptr %2, ptr %3) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s26protocol_resilience_thunks19MyResilientProtocolP10returnsAnyypyFTj"(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias swiftself %1, ptr %2, ptr %3) // CHECK: [[WITNESS_ADDR:%.*]] = getelementptr inbounds ptr, ptr %3, i32 3 // CHECK-NEXT: [[WITNESS:%.*]] = load ptr, ptr [[WITNESS_ADDR]] // CHECK-arm64e-NEXT: ptrtoint ptr [[WITNESS_ADDR]] to i64 // CHECK-arm64e-NEXT: call i64 @llvm.ptrauth.blend -// CHECK-NEXT: call swiftcc void [[WITNESS]](ptr noalias nocapture sret({{.*}}) %0, ptr noalias swiftself %1, ptr %2, ptr %3) +// CHECK-NEXT: call swiftcc void [[WITNESS]](ptr noalias captures(none) sret({{.*}}) %0, ptr noalias swiftself %1, ptr %2, ptr %3) // CHECK-NEXT: ret void // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s26protocol_resilience_thunks19MyResilientProtocolP12throwingFuncyyKFTj"(ptr noalias swiftself %0, ptr{{( noalias nocapture( swifterror)? dereferenceable\(.\))?}} %1, ptr %2, ptr %3) diff --git a/test/IRGen/same_type_constraints.swift b/test/IRGen/same_type_constraints.swift index 4287f34a4c96f..0adae5e99a89d 100644 --- a/test/IRGen/same_type_constraints.swift +++ b/test/IRGen/same_type_constraints.swift @@ -67,7 +67,7 @@ where Self : CodingType, print(Self.ValueType.self) } -// OSIZE: define internal swiftcc ptr @"$s21same_type_constraints12GenericKlazzCyxq_GAA1EAA4DataAaEP_AA0F4TypePWT"(ptr readnone %"GenericKlazz.Data", ptr nocapture readonly %"GenericKlazz", ptr nocapture readnone %"GenericKlazz.E") [[ATTRS:#[0-9]+]] { +// OSIZE: define internal swiftcc ptr @"$s21same_type_constraints12GenericKlazzCyxq_GAA1EAA4DataAaEP_AA0F4TypePWT"(ptr readnone %"GenericKlazz.Data", ptr captures(none) readonly %"GenericKlazz", ptr captures(none) readnone %"GenericKlazz.E") [[ATTRS:#[0-9]+]] { // OSIZE: [[ATTRS]] = {{{.*}}noinline // Check that same-typing two generic parameters together lowers correctly. diff --git a/test/IRGen/select_enum.sil b/test/IRGen/select_enum.sil index 24f8439eb8ff4..c0b7e8e7a1c91 100644 --- a/test/IRGen/select_enum.sil +++ b/test/IRGen/select_enum.sil @@ -7,7 +7,7 @@ enum SinglePayloadSingleEmpty { case DataCase(Builtin.Word) } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @select_enum_SinglePayloadSingleEmpty(ptr noalias nocapture dereferenceable({{.*}}) %0) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @select_enum_SinglePayloadSingleEmpty(ptr noalias captures(none) dereferenceable({{.*}}) %0) sil @select_enum_SinglePayloadSingleEmpty : $@convention(thin) (@in SinglePayloadSingleEmpty) -> () { bb0(%0 : $*SinglePayloadSingleEmpty): %1 = load %0 : $*SinglePayloadSingleEmpty diff --git a/test/IRGen/sil_generic_witness_methods.swift b/test/IRGen/sil_generic_witness_methods.swift index a9c80505798c9..a6a4492708080 100644 --- a/test/IRGen/sil_generic_witness_methods.swift +++ b/test/IRGen/sil_generic_witness_methods.swift @@ -34,7 +34,7 @@ func call_methods(_ x: T, y: S, z: U) { x.generic_method(z) } -// CHECK-LABEL: define hidden swiftcc void @"$s27sil_generic_witness_methods017call_existential_D0{{[_0-9a-zA-Z]*}}F"(ptr noalias nocapture dereferenceable({{.*}}) %0) +// CHECK-LABEL: define hidden swiftcc void @"$s27sil_generic_witness_methods017call_existential_D0{{[_0-9a-zA-Z]*}}F"(ptr noalias captures(none) dereferenceable({{.*}}) %0) func call_existential_methods(_ x: P, y: S) { // CHECK: [[METADATA_ADDR:%.*]] = getelementptr inbounds %T27sil_generic_witness_methods1PP, ptr [[X:%0]], i32 0, i32 1 // CHECK: [[METADATA:%.*]] = load ptr, ptr [[METADATA_ADDR]], align 8 diff --git a/test/IRGen/sil_witness_methods.sil b/test/IRGen/sil_witness_methods.sil index 2c2594a76940b..037bf031fdfef 100644 --- a/test/IRGen/sil_witness_methods.sil +++ b/test/IRGen/sil_witness_methods.sil @@ -28,14 +28,14 @@ struct X {} struct Y {} struct Z {} -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @concrete_type_concrete_method_witness(ptr noalias nocapture swiftself %0, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @concrete_type_concrete_method_witness(ptr noalias captures(none) swiftself %0, ptr %Self, ptr %SelfWitnessTable) sil @concrete_type_concrete_method_witness : $@convention(witness_method: P) (@in Foo) -> @thick Foo.Type { entry(%x : $*Foo): %m = metatype $@thick Foo.Type return %m : $@thick Foo.Type } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @generic_type_concrete_method_witness(ptr noalias nocapture swiftself dereferenceable({{.*}}) %0, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @generic_type_concrete_method_witness(ptr noalias captures(none) swiftself dereferenceable({{.*}}) %0, ptr %Self, ptr %SelfWitnessTable) // CHECK-objc: [[T1:%.*]] = getelementptr inbounds ptr, ptr %Self, i64 10 // CHECK-native: [[T1:%.*]] = getelementptr inbounds ptr, ptr %Self, i64 7 // CHECK: %T = load ptr, ptr [[T1]], align 8 @@ -87,14 +87,14 @@ entry(%x : $@thick Bar.Type): // TODO: %Self Type arg is redundant for class method witness -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @concrete_type_generic_method_witness(ptr noalias %0, ptr %Z, ptr noalias nocapture swiftself %1, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @concrete_type_generic_method_witness(ptr noalias %0, ptr %Z, ptr noalias captures(none) swiftself %1, ptr %Self, ptr %SelfWitnessTable) sil @concrete_type_generic_method_witness : $@convention(witness_method: P) (@in Z, @in Foo) -> @thick Foo.Type { entry(%z : $*Z, %x : $*Foo): %m = metatype $@thick Foo.Type return %m : $@thick Foo.Type } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @generic_type_generic_method_witness(ptr noalias %0, ptr %Z, ptr noalias nocapture swiftself dereferenceable(8) %1, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @generic_type_generic_method_witness(ptr noalias %0, ptr %Z, ptr noalias captures(none) swiftself dereferenceable(8) %1, ptr %Self, ptr %SelfWitnessTable) sil @generic_type_generic_method_witness : $@convention(witness_method: P) (@in Z, @in Bar) -> @thick Bar.Type { entry(%z : $*Z, %x : $*Bar): %t = metatype $@thick T.Type diff --git a/test/IRGen/sil_witness_tables.swift b/test/IRGen/sil_witness_tables.swift index 0318819450467..ab09f3938bc77 100644 --- a/test/IRGen/sil_witness_tables.swift +++ b/test/IRGen/sil_witness_tables.swift @@ -57,14 +57,14 @@ struct Conformer2: Q { func qMethod() {} } -// CHECK-LABEL: define hidden swiftcc void @"$s18sil_witness_tables7erasure1cAA2QQ_pAA9ConformerV_tF"(ptr noalias nocapture sret({{.*}}) %0) +// CHECK-LABEL: define hidden swiftcc void @"$s18sil_witness_tables7erasure1cAA2QQ_pAA9ConformerV_tF"(ptr noalias captures(none) sret({{.*}}) %0) // CHECK: [[WITNESS_TABLE_ADDR:%.*]] = getelementptr inbounds %T18sil_witness_tables2QQP, ptr %0, i32 0, i32 2 // CHECK-NEXT: store ptr [[CONFORMER_QQ_WITNESS_TABLE:@"\$s.*WP"]], ptr [[WITNESS_TABLE_ADDR]], align 8 func erasure(c: Conformer) -> QQ { return c } -// CHECK-LABEL: define hidden swiftcc void @"$s18sil_witness_tables15externalErasure1c0a1_b1_c1_D12_conformance9ExternalP_pAD0G9ConformerV_tF"(ptr noalias nocapture sret({{.*}}) %0) +// CHECK-LABEL: define hidden swiftcc void @"$s18sil_witness_tables15externalErasure1c0a1_b1_c1_D12_conformance9ExternalP_pAD0G9ConformerV_tF"(ptr noalias captures(none) sret({{.*}}) %0) // CHECK: [[WITNESS_TABLE_ADDR:%.*]] = getelementptr inbounds %T39sil_witness_tables_external_conformance9ExternalPP, ptr %0, i32 0, i32 2 // CHECK-NEXT: store ptr [[EXTERNAL_CONFORMER_EXTERNAL_P_WITNESS_TABLE]], ptr %2, align 8 func externalErasure(c: ExternalConformer) -> ExternalP { diff --git a/test/IRGen/struct_resilience.swift b/test/IRGen/struct_resilience.swift index 73960b0340bae..3917e51c06bdc 100644 --- a/test/IRGen/struct_resilience.swift +++ b/test/IRGen/struct_resilience.swift @@ -80,7 +80,7 @@ public struct MySize { public let h: Int } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s17struct_resilience32functionWithMyResilientTypesSize_1fAA0eH0VAEn_A2EnXEtF"(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture dereferenceable({{8|(16)}}) %1, ptr %2, ptr %3) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s17struct_resilience32functionWithMyResilientTypesSize_1fAA0eH0VAEn_A2EnXEtF"(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias captures(none) dereferenceable({{8|(16)}}) %1, ptr %2, ptr %3) public func functionWithMyResilientTypesSize(_ s: __owned MySize, f: (__owned MySize) -> MySize) -> MySize { // There's an alloca for debug info? @@ -108,7 +108,7 @@ public func functionWithMyResilientTypesSize(_ s: __owned MySize, f: (__owned My // CHECK: store [[INT]] [[H]], ptr [[H_PTR]] -// CHECK: call swiftcc void %2(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture dereferenceable({{8|16}}) [[DST]], ptr swiftself %3) +// CHECK: call swiftcc void %2(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias captures(none) dereferenceable({{8|16}}) [[DST]], ptr swiftself %3) // CHECK: call void @llvm.lifetime.end.p0({{i32|i64}} {{8|16}}, ptr [[DST]]) // CHECK: ret void @@ -164,7 +164,7 @@ public struct ResilientStructWithMethod { // Corner case -- type is address-only in SIL, but empty in IRGen -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s17struct_resilience29partialApplyOfResilientMethod1ryAA0f10StructWithG0V_tF"(ptr noalias nocapture %0) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s17struct_resilience29partialApplyOfResilientMethod1ryAA0f10StructWithG0V_tF"(ptr noalias captures(none) %0) public func partialApplyOfResilientMethod(r: ResilientStructWithMethod) { _ = r.method } @@ -190,7 +190,7 @@ public func resilientAny(s : ResilientWeakRef) { // CHECK: [[TYADDR:%.*]] = getelementptr inbounds %Any, ptr [[ANY]], i32 0, i32 1 // CHECK: store ptr [[META2]], ptr [[TYADDR]] // CHECK: call ptr @__swift_allocate_boxed_opaque_existential_0(ptr [[ANY]]) -// CHECK: call swiftcc void @"$s17struct_resilience8wantsAnyyyypF"(ptr noalias nocapture dereferenceable({{(32|16)}}) [[ANY]]) +// CHECK: call swiftcc void @"$s17struct_resilience8wantsAnyyyypF"(ptr noalias captures(none) dereferenceable({{(32|16)}}) [[ANY]]) // CHECK: call void @__swift_destroy_boxed_opaque_existential_0(ptr [[ANY]]) // CHECK: ret void diff --git a/test/IRGen/struct_with_resilient_type.swift b/test/IRGen/struct_with_resilient_type.swift index 20bc54a4cfa0b..ab9b90f609cb6 100644 --- a/test/IRGen/struct_with_resilient_type.swift +++ b/test/IRGen/struct_with_resilient_type.swift @@ -44,7 +44,7 @@ crashCaller() // Don't use the type layout based value witness based generation (i.e we load field offsets below). -// VWT-macosx: define {{.*}} ptr @"$s26struct_with_resilient_type9SomeValueVwta"(ptr noalias returned {{.*}}, ptr noalias {{.*}}, ptr nocapture readonly [[MT:%.*]]) +// VWT-macosx: define {{.*}} ptr @"$s26struct_with_resilient_type9SomeValueVwta"(ptr noalias returned {{.*}}, ptr noalias {{.*}}, ptr captures(none) readonly [[MT:%.*]]) // VWT-macosx: [[VAL1:%.*]] = load i64 // VWT-macosx: store i64 [[VAL1]] // VWT-macosx: [[T1:%.*]] = tail call swiftcc %swift.metadata_response @"$s16resilient_struct13ResilientBoolVMa"(i64 0) diff --git a/test/IRGen/typed_throws.sil b/test/IRGen/typed_throws.sil index 8d5caa462ee53..77845664dcbc6 100644 --- a/test/IRGen/typed_throws.sil +++ b/test/IRGen/typed_throws.sil @@ -18,7 +18,7 @@ sil_vtable A {} sil @create_error : $@convention(thin) () -> @owned A -// CHECK: define{{.*}} swiftcc { ptr, ptr } @throw_error(ptr swiftself %0, ptr noalias nocapture swifterror dereferenceable({{.*}}) %1) +// CHECK: define{{.*}} swiftcc { ptr, ptr } @throw_error(ptr swiftself %0, ptr noalias captures(none) swifterror dereferenceable({{.*}}) %1) // CHECK: [[ERR:%.*]] = call swiftcc ptr @create_error() // CHECK: call ptr @swift_retain(ptr returned [[ERR]]) // CHECK: store ptr inttoptr (i64 1 to ptr), ptr %1 @@ -47,7 +47,7 @@ sil @try_apply_helper : $@convention(thin) (@owned AnyObject) -> (@owned AnyObje // CHECK: entry: // CHECK: %swifterror = alloca swifterror ptr // CHECK: store ptr null, ptr %swifterror -// CHECK: [[RES:%.*]] = call swiftcc { ptr, ptr } @try_apply_helper(ptr %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable({{.*}}) %swifterror) +// CHECK: [[RES:%.*]] = call swiftcc { ptr, ptr } @try_apply_helper(ptr %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable({{.*}}) %swifterror) // CHECK: [[RES_0:%.*]] = extractvalue { ptr, ptr } [[RES]], 0 // CHECK: [[RES_1:%.*]] = extractvalue { ptr, ptr } [[RES]], 1 // CHECK: [[ERRFLAG:%.*]] = load ptr, ptr %swifterror @@ -209,8 +209,8 @@ bb6: return %7 : $() } -// CHECK: define{{.*}} internal swiftcc { ptr, ptr } @"$s16try_apply_helperTA"(ptr swiftself %0, ptr noalias nocapture swifterror dereferenceable({{.*}}) %1) -// CHECK: tail call swiftcc { ptr, ptr } @try_apply_helper(ptr {{.*}}, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable({{.*}}) %1) +// CHECK: define{{.*}} internal swiftcc { ptr, ptr } @"$s16try_apply_helperTA"(ptr swiftself %0, ptr noalias captures(none) swifterror dereferenceable({{.*}}) %1) +// CHECK: tail call swiftcc { ptr, ptr } @try_apply_helper(ptr {{.*}}, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable({{.*}}) %1) // CHECK: ret { ptr, ptr } sil @partial_apply_test : $@convention(thin) (@owned AnyObject) -> @owned @callee_guaranteed () ->(@owned AnyObject, @error S) { @@ -234,7 +234,7 @@ entry(%0: $AnyObject): // CHECK:entry: // CHECK: %swifterror = alloca swifterror ptr // CHECK: store ptr null, ptr %swifterror -// CHECK: call swiftcc { ptr, ptr } %0(ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable({{[0-9]+}}) %swifterror) +// CHECK: call swiftcc { ptr, ptr } %0(ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable({{[0-9]+}}) %swifterror) sil @apply_closure : $@convention(thin) (@guaranteed @callee_guaranteed () -> (@owned AnyObject, @error S)) -> () { entry(%0 : $@callee_guaranteed () ->(@owned AnyObject, @error S)): @@ -272,7 +272,7 @@ bb6: return %t : $() } -// CHECK: define{{.*}} swiftcc void @throwNoError(i64 %0, ptr noalias %1, ptr %"\CF\84_0_0", ptr swiftself %2, ptr noalias nocapture swifterror dereferenceable({{.*}}) %3, ptr %4) +// CHECK: define{{.*}} swiftcc void @throwNoError(i64 %0, ptr noalias %1, ptr %"\CF\84_0_0", ptr swiftself %2, ptr noalias captures(none) swifterror dereferenceable({{.*}}) %3, ptr %4) // CHECK: ret void sil @throwNoError : $@convention(thin) <τ_0_0> (Builtin.Int64, @in τ_0_0) -> @error_indirect τ_0_0 { @@ -281,14 +281,14 @@ bb0(%0: $*τ_0_0, %1 : $Builtin.Int64, %2 : $*τ_0_0): return %5 : $() } -// CHECK: define{{.*}} swiftcc void @throwNoErrorGenericOut(ptr noalias sret(%swift.opaque) %0, i64 %1, ptr noalias %2, ptr %"\CF\84_0_0", ptr %"\CF\84_0_1", ptr swiftself %3, ptr noalias nocapture swifterror dereferenceable({{.*}}) %4, ptr %5) +// CHECK: define{{.*}} swiftcc void @throwNoErrorGenericOut(ptr noalias sret(%swift.opaque) %0, i64 %1, ptr noalias %2, ptr %"\CF\84_0_0", ptr %"\CF\84_0_1", ptr swiftself %3, ptr noalias captures(none) swifterror dereferenceable({{.*}}) %4, ptr %5) sil @throwNoErrorGenericOut : $@convention(thin) <τ_0_0, τ_0_1> (Builtin.Int64, @in τ_0_0) -> (@error_indirect τ_0_0, @out τ_0_1) { bb0(%0: $*τ_0_1, %1: $*τ_0_0, %2 : $Builtin.Int64, %3 : $*τ_0_0): %5 = tuple () return %5 : $() } -// CHECK: define{{.*}} swiftcc void @throwError(i64 %0, ptr noalias %1, ptr %"\CF\84_0_0", ptr swiftself %2, ptr noalias nocapture swifterror dereferenceable({{.*}}) %3, ptr %4) +// CHECK: define{{.*}} swiftcc void @throwError(i64 %0, ptr noalias %1, ptr %"\CF\84_0_0", ptr swiftself %2, ptr noalias captures(none) swifterror dereferenceable({{.*}}) %3, ptr %4) // CHECK: entry: // CHECK: load ptr, ptr // CHECK: [[VW:%.*]] = load ptr, ptr @@ -309,7 +309,7 @@ sil @throwError2 : $@convention(thin) (Builtin.Int64, @in T) -> (@error_i // CHECK: store ptr null, ptr %swifterror // CHECK: [[SIZE:%.*]] = load i64 // CHECK: [[TYPEDERR:%.*]] = alloca i8, i64 [[SIZE]] -// CHECK: call swiftcc void @throwError2(ptr noalias sret(%swift.opaque) %0, i64 0, ptr noalias %1, ptr %T, ptr %V, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror, ptr [[TYPEDERR]]) +// CHECK: call swiftcc void @throwError2(ptr noalias sret(%swift.opaque) %0, i64 0, ptr noalias %1, ptr %T, ptr %V, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror, ptr [[TYPEDERR]]) // CHECK: [[ERR_FLAG:%.*]] = load ptr, ptr %swifterror // CHECK: [[ISERR:%.*]] = icmp ne ptr [[ERR_FLAG]], null // CHECK: br i1 [[ISERR]] @@ -379,8 +379,8 @@ bb3: sil @try_apply_helper_generic : $@convention(thin) (@in T) -> (@out T, @error_indirect T) -// CHECK: define{{.*}} internal swiftcc void @"$s24try_apply_helper_genericTA"(ptr noalias sret(%swift.opaque) %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3) -// CHECK: call swiftcc void @try_apply_helper_generic(ptr noalias sret(%swift.opaque) %0, ptr noalias {{%.*}}, ptr %T, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3) +// CHECK: define{{.*}} internal swiftcc void @"$s24try_apply_helper_genericTA"(ptr noalias sret(%swift.opaque) %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3) +// CHECK: call swiftcc void @try_apply_helper_generic(ptr noalias sret(%swift.opaque) %0, ptr noalias {{%.*}}, ptr %T, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3) sil @partial_apply_test_generic : $@convention(thin) (@in T) -> @owned @callee_guaranteed () ->(@out T, @error_indirect T) { entry(%0: $*T): @@ -411,7 +411,7 @@ entry(%0: $*T): // CHECK: [[V2:%.*]] = getelementptr inbounds %swift.vwtable{{.*}} // CHECK: [[V3:%.*]] = load i64, ptr [[V2]] // CHECK: [[V4:%.*]] = alloca i8, i64 [[V3]] -// CHECK: call swiftcc void %0(ptr noalias sret(%swift.opaque) [[T4]], ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %swifterror, ptr [[V4]]) +// CHECK: call swiftcc void %0(ptr noalias sret(%swift.opaque) [[T4]], ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror, ptr [[V4]]) sil @apply_closure_generic : $@convention(thin) (@guaranteed @callee_guaranteed () ->(@out T, @error_indirect V)) -> () { entry(%0 : $@callee_guaranteed () ->(@out T, @error_indirect V)): %err = alloc_stack $V diff --git a/test/IRGen/typed_throws.swift b/test/IRGen/typed_throws.swift index f4581f0d039e1..897c1754dab4d 100644 --- a/test/IRGen/typed_throws.swift +++ b/test/IRGen/typed_throws.swift @@ -75,7 +75,7 @@ func reabstractAsConcreteThrowing() throws -> Int { try passthroughCall(fiveOrTypedBust) } -// CHECK-LABEL: define {{.*}} swiftcc void @"$sSi12typed_throws10MyBigErrorOIgdzo_SiACIegrzr_TR"(ptr noalias nocapture sret(%TSi) %0, ptr %1, ptr %2, ptr swiftself %3, ptr noalias nocapture swifterror dereferenceable(8) %4, ptr %5) +// CHECK-LABEL: define {{.*}} swiftcc void @"$sSi12typed_throws10MyBigErrorOIgdzo_SiACIegrzr_TR"(ptr noalias captures(none) sret(%TSi) %0, ptr %1, ptr %2, ptr swiftself %3, ptr noalias captures(none) swifterror dereferenceable(8) %4, ptr %5) // CHECK: call swiftcc {{i32|i64}} %1 // CHECK: [[CMP:%.*]] = icmp ne ptr {{%.*}}, null // CHECK: br i1 [[CMP]], label %typed.error.load @@ -107,7 +107,7 @@ func throwsSmallError() throws(SmallError) -> (Float, Int) { } // CHECK: define hidden swiftcc i64 @"$s12typed_throws17catchesSmallErrorSiyF"() -// CHECK: [[RES:%.*]] = call swiftcc { float, i64 } @"$s12typed_throws0B10SmallErrorSf_SityAA0cD0VYKF"(ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) +// CHECK: [[RES:%.*]] = call swiftcc { float, i64 } @"$s12typed_throws0B10SmallErrorSf_SityAA0cD0VYKF"(ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) // CHECK: [[R0:%.*]] = extractvalue { float, i64 } [[RES]], 0 // CHECK: [[R1:%.*]] = extractvalue { float, i64 } [[RES]], 1 // CHECK: phi i64 [ [[R1]], %typed.error.load ] @@ -316,7 +316,7 @@ func smallResultLargerError() throws(SmallError) -> Int8? { } // CHECK: [[COERCED:%.*]] = alloca { i16 }, align 2 -// CHECK: [[RES:%.*]] = call swiftcc i64 @"$s12typed_throws22smallResultLargerErrors4Int8VSgyAA05SmallF0VYKF"(ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) +// CHECK: [[RES:%.*]] = call swiftcc i64 @"$s12typed_throws22smallResultLargerErrors4Int8VSgyAA05SmallF0VYKF"(ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) // CHECK: [[TRUNC:%.*]] = trunc i64 [[RES]] to i16 // CHECK: [[COERCED_PTR:%.*]] = getelementptr inbounds { i16 }, ptr [[COERCED]], i32 0, i32 0 // CHECK: store i16 [[TRUNC]], ptr [[COERCED_PTR]], align 2 @@ -335,7 +335,7 @@ func smallErrorLargerResult() throws(UInt8OptSingletonError) -> Int { } // CHECK: [[COERCED:%.*]] = alloca { i16 }, align 2 -// CHECK: [[RES:%.*]] = call swiftcc i64 @"$s12typed_throws22smallErrorLargerResultSiyAA017UInt8OptSingletonD0OYKF"(ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) +// CHECK: [[RES:%.*]] = call swiftcc i64 @"$s12typed_throws22smallErrorLargerResultSiyAA017UInt8OptSingletonD0OYKF"(ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) // CHECK: [[TRUNC:%.*]] = trunc i64 [[RES]] to i16 // CHECK: [[COERCED_PTR:%.*]] = getelementptr inbounds { i16 }, ptr [[COERCED]], i32 0, i32 0 // CHECK: store i16 [[TRUNC]], ptr [[COERCED_PTR]], align 2 diff --git a/test/IRGen/typed_throws_abi.swift b/test/IRGen/typed_throws_abi.swift index 6f2479d39c44e..d1c73656aa400 100644 --- a/test/IRGen/typed_throws_abi.swift +++ b/test/IRGen/typed_throws_abi.swift @@ -21,7 +21,7 @@ struct ThreeWords: Error { } struct Impl: P { - // CHECK: define hidden swiftcc void @"$s16typed_throws_abi4ImplV2f0yySbAA5EmptyVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc void @"$s16typed_throws_abi4ImplV2f0yySbAA5EmptyVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: // CHECK: ret void @@ -38,7 +38,7 @@ struct Impl: P { } } - // CHECK: define hidden swiftcc i64 @"$s16typed_throws_abi4ImplV2f1ySiSbAA5EmptyVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc i64 @"$s16typed_throws_abi4ImplV2f1ySiSbAA5EmptyVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: // CHECK: ret i64 1 @@ -56,7 +56,7 @@ struct Impl: P { return 1 } - // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2f2ySi_SitSbAA5EmptyVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2f2ySi_SitSbAA5EmptyVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: // CHECK: ret { i64, i64 } { i64 1, i64 2 } @@ -74,7 +74,7 @@ struct Impl: P { return (1, 2) } - // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2f3ySi_S2itSbAA5EmptyVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2f3ySi_S2itSbAA5EmptyVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: // CHECK: ret { i64, i64, i64 } { i64 1, i64 2, i64 3 } @@ -92,7 +92,7 @@ struct Impl: P { return (1, 2, 3) } - // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi4ImplV2f4ySi_S3itSbAA5EmptyVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi4ImplV2f4ySi_S3itSbAA5EmptyVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: // CHECK: ret { i64, i64, i64, i64 } { i64 1, i64 2, i64 3, i64 4 } @@ -110,7 +110,7 @@ struct Impl: P { return (1, 2, 3, 4) } - // CHECK: define hidden swiftcc void @"$s16typed_throws_abi4ImplV2f5ySi_S4itSbAA5EmptyVYKF"(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr swiftself %2, ptr noalias nocapture swifterror dereferenceable(8) %3, ptr %4) + // CHECK: define hidden swiftcc void @"$s16typed_throws_abi4ImplV2f5ySi_S4itSbAA5EmptyVYKF"(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr swiftself %2, ptr noalias captures(none) swifterror dereferenceable(8) %3, ptr %4) // CHECK: br i1 %1, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: // CHECK: store i64 1, ptr %.elt._value, align 8 @@ -133,7 +133,7 @@ struct Impl: P { return (1, 2, 3, 4, 5) } - // CHECK: define hidden swiftcc i64 @"$s16typed_throws_abi4ImplV2g0yySbAA7OneWordVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc i64 @"$s16typed_throws_abi4ImplV2g0yySbAA7OneWordVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi7OneWordV // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: @@ -151,7 +151,7 @@ struct Impl: P { } } - // CHECK: define hidden swiftcc i64 @"$s16typed_throws_abi4ImplV2g1ySiSbAA7OneWordVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc i64 @"$s16typed_throws_abi4ImplV2g1ySiSbAA7OneWordVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi7OneWordV // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: @@ -170,7 +170,7 @@ struct Impl: P { return 1 } - // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2g2ySi_SitSbAA7OneWordVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2g2ySi_SitSbAA7OneWordVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi7OneWordV // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: @@ -189,7 +189,7 @@ struct Impl: P { return (1, 2) } - // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2g3ySi_S2itSbAA7OneWordVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2g3ySi_S2itSbAA7OneWordVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi7OneWordV // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: @@ -208,7 +208,7 @@ struct Impl: P { return (1, 2, 3) } - // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi4ImplV2g4ySi_S3itSbAA7OneWordVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi4ImplV2g4ySi_S3itSbAA7OneWordVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi7OneWordV // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: @@ -227,7 +227,7 @@ struct Impl: P { return (1, 2, 3, 4) } - // CHECK: define hidden swiftcc void @"$s16typed_throws_abi4ImplV2g5ySi_S4itSbAA7OneWordVYKF"(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr swiftself %2, ptr noalias nocapture swifterror dereferenceable(8) %3, ptr %4) + // CHECK: define hidden swiftcc void @"$s16typed_throws_abi4ImplV2g5ySi_S4itSbAA7OneWordVYKF"(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr swiftself %2, ptr noalias captures(none) swifterror dereferenceable(8) %3, ptr %4) // CHECK: entry: // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi7OneWordV, align 8 // CHECK: br i1 %1, label %[[SUCCESS:.*]], label %[[FAIL:.*]] @@ -252,7 +252,7 @@ struct Impl: P { return (1, 2, 3, 4, 5) } - // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2h0yySbAA8TwoWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2h0yySbAA8TwoWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi8TwoWordsV // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: @@ -270,7 +270,7 @@ struct Impl: P { } } - // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2h1ySiSbAA8TwoWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2h1ySiSbAA8TwoWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi8TwoWordsV // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: @@ -289,7 +289,7 @@ struct Impl: P { return 1 } - // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2h2ySi_SitSbAA8TwoWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2h2ySi_SitSbAA8TwoWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi8TwoWordsV // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: @@ -308,7 +308,7 @@ struct Impl: P { return (1, 2) } - // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2h3ySi_S2itSbAA8TwoWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2h3ySi_S2itSbAA8TwoWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi8TwoWordsV // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: @@ -327,7 +327,7 @@ struct Impl: P { return (1, 2, 3) } - // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi4ImplV2h4ySi_S3itSbAA8TwoWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi4ImplV2h4ySi_S3itSbAA8TwoWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi8TwoWordsV // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: @@ -346,7 +346,7 @@ struct Impl: P { return (1, 2, 3, 4) } - // CHECK: define hidden swiftcc void @"$s16typed_throws_abi4ImplV2h5ySi_S4itSbAA8TwoWordsVYKF"(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr swiftself %2, ptr noalias nocapture swifterror dereferenceable(8) %3, ptr %4) + // CHECK: define hidden swiftcc void @"$s16typed_throws_abi4ImplV2h5ySi_S4itSbAA8TwoWordsVYKF"(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr swiftself %2, ptr noalias captures(none) swifterror dereferenceable(8) %3, ptr %4) // CHECK: entry: // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi8TwoWordsV, align 8 // CHECK: br i1 %1, label %[[SUCCESS:.*]], label %[[FAIL:.*]] @@ -371,7 +371,7 @@ struct Impl: P { return (1, 2, 3, 4, 5) } - // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i0yySbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i0yySbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi10ThreeWordsV // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: @@ -389,7 +389,7 @@ struct Impl: P { } } - // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i1ySiSbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i1ySiSbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi10ThreeWordsV // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: @@ -408,7 +408,7 @@ struct Impl: P { return 1 } - // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i2ySi_SitSbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i2ySi_SitSbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi10ThreeWordsV // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: @@ -427,7 +427,7 @@ struct Impl: P { return (1, 2) } - // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i3ySi_S2itSbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i3ySi_S2itSbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi10ThreeWordsV // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: @@ -446,7 +446,7 @@ struct Impl: P { return (1, 2, 3) } - // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i4ySi_S3itSbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i4ySi_S3itSbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi10ThreeWordsV // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: @@ -465,7 +465,7 @@ struct Impl: P { return (1, 2, 3, 4) } - // CHECK: define hidden swiftcc void @"$s16typed_throws_abi4ImplV2i5ySi_S4itSbAA10ThreeWordsVYKF"(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr swiftself %2, ptr noalias nocapture swifterror dereferenceable(8) %3, ptr %4) + // CHECK: define hidden swiftcc void @"$s16typed_throws_abi4ImplV2i5ySi_S4itSbAA10ThreeWordsVYKF"(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr swiftself %2, ptr noalias captures(none) swifterror dereferenceable(8) %3, ptr %4) // CHECK: entry: // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi10ThreeWordsV, align 8 // CHECK: br i1 %1, label %[[SUCCESS:.*]], label %[[FAIL:.*]] @@ -494,7 +494,7 @@ struct Impl: P { // CHECK: define hidden swiftcc i1 @"$s16typed_throws_abi11callImpl_f0ySbAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: call swiftcc void @"$s16typed_throws_abi4ImplV2f0yySbAA5EmptyVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) +// CHECK: call swiftcc void @"$s16typed_throws_abi4ImplV2f0yySbAA5EmptyVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) // CHECK: [[ERROR:%.*]] = load ptr, ptr %swifterror, align 8 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %typed.error.load, label %[[SUCCESS:.*]] @@ -521,7 +521,7 @@ func callImpl_f0(_ impl: Impl, _ b: Bool) -> Bool { // CHECK: define hidden swiftcc i64 @"$s16typed_throws_abi11callImpl_f1ySiAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc i64 @"$s16typed_throws_abi4ImplV2f1ySiSbAA5EmptyVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc i64 @"$s16typed_throws_abi4ImplV2f1ySiSbAA5EmptyVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) // CHECK: [[ERROR:%.*]] = load ptr, ptr %swifterror, align 8 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %typed.error.load, label %[[SUCCESS:.*]] @@ -548,7 +548,7 @@ func callImpl_f1(_ impl: Impl, _ b: Bool) -> Int { // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi11callImpl_f2ySi_SitAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2f2ySi_SitSbAA5EmptyVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2f2ySi_SitSbAA5EmptyVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) // CHECK: [[CALL_RES0:%.*]] = extractvalue { i64, i64 } [[CALL_RES]], 0 // CHECK: [[CALL_RES1:%.*]] = extractvalue { i64, i64 } [[CALL_RES]], 1 // CHECK: [[ERROR:%.*]] = load ptr, ptr %swifterror, align 8 @@ -581,7 +581,7 @@ func callImpl_f2(_ impl: Impl, _ b: Bool) -> (Int, Int) { // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi11callImpl_f3ySi_S2itAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2f3ySi_S2itSbAA5EmptyVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2f3ySi_S2itSbAA5EmptyVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) // CHECK: [[CALL_RES0:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 0 // CHECK: [[CALL_RES1:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 1 // CHECK: [[CALL_RES2:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 2 @@ -618,7 +618,7 @@ func callImpl_f3(_ impl: Impl, _ b: Bool) -> (Int, Int, Int) { // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi11callImpl_f4ySi_S3itAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi4ImplV2f4ySi_S3itSbAA5EmptyVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi4ImplV2f4ySi_S3itSbAA5EmptyVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) // CHECK: [[CALL_RES0:%.*]] = extractvalue { i64, i64, i64, i64 } [[CALL_RES]], 0 // CHECK: [[CALL_RES1:%.*]] = extractvalue { i64, i64, i64, i64 } [[CALL_RES]], 1 // CHECK: [[CALL_RES2:%.*]] = extractvalue { i64, i64, i64, i64 } [[CALL_RES]], 2 @@ -656,12 +656,12 @@ func callImpl_f4(_ impl: Impl, _ b: Bool) -> (Int, Int, Int, Int) { } } -// CHECK: define hidden swiftcc void @"$s16typed_throws_abi11callImpl_f5ySi_S4itAA0E0V_SbtF"(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1) +// CHECK: define hidden swiftcc void @"$s16typed_throws_abi11callImpl_f5ySi_S4itAA0E0V_SbtF"(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 // CHECK: %swifterror1 = alloca ptr, align 8 // CHECK: %call.aggresult = alloca <{ %TSi, %TSi, %TSi, %TSi, %TSi }>, align 8 -// CHECK: call swiftcc void @"$s16typed_throws_abi4ImplV2f5ySi_S4itSbAA5EmptyVYKF"(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %call.aggresult, i1 %1, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror, ptr %swifterror1) +// CHECK: call swiftcc void @"$s16typed_throws_abi4ImplV2f5ySi_S4itSbAA5EmptyVYKF"(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %call.aggresult, i1 %1, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror, ptr %swifterror1) // CHECK: [[CALL_RES0:%.*]] = load i64, ptr {{%call.aggresult.*}}, align 8 // CHECK: [[CALL_RES1:%.*]] = load i64, ptr {{%call.aggresult.*}}, align 8 // CHECK: [[CALL_RES2:%.*]] = load i64, ptr {{%call.aggresult.*}}, align 8 @@ -706,7 +706,7 @@ func callImpl_f5(_ impl: Impl, _ b: Bool) -> (Int, Int, Int, Int, Int) { // CHECK: define hidden swiftcc i64 @"$s16typed_throws_abi11callImpl_g0ySiAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc i64 @"$s16typed_throws_abi4ImplV2g0yySbAA7OneWordVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc i64 @"$s16typed_throws_abi4ImplV2g0yySbAA7OneWordVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) // CHECK: [[ERROR:%.*]] = load ptr, ptr %swifterror, align 8 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %typed.error.load, label %[[SUCCESS:.*]] @@ -734,7 +734,7 @@ func callImpl_g0(_ impl: Impl, _ b: Bool) -> Int { // CHECK: define hidden swiftcc i64 @"$s16typed_throws_abi11callImpl_g1ySiAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc i64 @"$s16typed_throws_abi4ImplV2g1ySiSbAA7OneWordVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc i64 @"$s16typed_throws_abi4ImplV2g1ySiSbAA7OneWordVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) // CHECK: [[ERROR:%.*]] = load ptr, ptr %swifterror, align 8 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %typed.error.load, label %[[SUCCESS:.*]] @@ -762,7 +762,7 @@ func callImpl_g1(_ impl: Impl, _ b: Bool) -> Int { // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi11callImpl_g2ySi_SitAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2g2ySi_SitSbAA7OneWordVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2g2ySi_SitSbAA7OneWordVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) // CHECK: [[CALL_RES0:%.*]] = extractvalue { i64, i64 } [[CALL_RES]], 0 // CHECK: [[CALL_RES1:%.*]] = extractvalue { i64, i64 } [[CALL_RES]], 1 // CHECK: [[ERROR:%.*]] = load ptr, ptr %swifterror, align 8 @@ -796,7 +796,7 @@ func callImpl_g2(_ impl: Impl, _ b: Bool) -> (Int, Int) { // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi11callImpl_g3ySi_S2itAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2g3ySi_S2itSbAA7OneWordVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2g3ySi_S2itSbAA7OneWordVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) // CHECK: [[CALL_RES0:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 0 // CHECK: [[CALL_RES1:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 1 // CHECK: [[CALL_RES2:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 2 @@ -834,7 +834,7 @@ func callImpl_g3(_ impl: Impl, _ b: Bool) -> (Int, Int, Int) { // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi11callImpl_g4ySi_S3itAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi4ImplV2g4ySi_S3itSbAA7OneWordVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi4ImplV2g4ySi_S3itSbAA7OneWordVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) // CHECK: [[CALL_RES0:%.*]] = extractvalue { i64, i64, i64, i64 } [[CALL_RES]], 0 // CHECK: [[CALL_RES1:%.*]] = extractvalue { i64, i64, i64, i64 } [[CALL_RES]], 1 // CHECK: [[CALL_RES2:%.*]] = extractvalue { i64, i64, i64, i64 } [[CALL_RES]], 2 @@ -873,12 +873,12 @@ func callImpl_g4(_ impl: Impl, _ b: Bool) -> (Int, Int, Int, Int) { } } -// CHECK: define hidden swiftcc void @"$s16typed_throws_abi11callImpl_g5ySi_S4itAA0E0V_SbtF"(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1) +// CHECK: define hidden swiftcc void @"$s16typed_throws_abi11callImpl_g5ySi_S4itAA0E0V_SbtF"(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 // CHECK: %swifterror1 = alloca %T16typed_throws_abi7OneWordV, align 8 // CHECK: %call.aggresult = alloca <{ %TSi, %TSi, %TSi, %TSi, %TSi }>, align 8 -// CHECK: call swiftcc void @"$s16typed_throws_abi4ImplV2g5ySi_S4itSbAA7OneWordVYKF"(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %call.aggresult, i1 %1, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror, ptr %swifterror1) +// CHECK: call swiftcc void @"$s16typed_throws_abi4ImplV2g5ySi_S4itSbAA7OneWordVYKF"(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %call.aggresult, i1 %1, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror, ptr %swifterror1) // CHECK: [[CALL_RES0:%.*]] = load i64, ptr {{%call.aggresult.*}}, align 8 // CHECK: [[CALL_RES1:%.*]] = load i64, ptr {{%call.aggresult.*}}, align 8 // CHECK: [[CALL_RES2:%.*]] = load i64, ptr {{%call.aggresult.*}}, align 8 @@ -927,7 +927,7 @@ func callImpl_g5(_ impl: Impl, _ b: Bool) -> (Int, Int, Int, Int, Int) { // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi11callImpl_h0ySi_SitAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2h0yySbAA8TwoWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2h0yySbAA8TwoWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) // CHECK: [[CALL_RES0:%.*]] = extractvalue { i64, i64 } [[CALL_RES]], 0 // CHECK: [[CALL_RES1:%.*]] = extractvalue { i64, i64 } [[CALL_RES]], 1 // CHECK: [[ERROR:%.*]] = load ptr, ptr %swifterror, align 8 @@ -961,7 +961,7 @@ func callImpl_h0(_ impl: Impl, _ b: Bool) -> (Int, Int) { // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi11callImpl_h1ySi_SitAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2h1ySiSbAA8TwoWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2h1ySiSbAA8TwoWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) // CHECK: [[CALL_RES0:%.*]] = extractvalue { i64, i64 } [[CALL_RES]], 0 // CHECK: [[CALL_RES1:%.*]] = extractvalue { i64, i64 } [[CALL_RES]], 1 // CHECK: [[ERROR:%.*]] = load ptr, ptr %swifterror, align 8 @@ -995,7 +995,7 @@ func callImpl_h1(_ impl: Impl, _ b: Bool) -> (Int, Int) { // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi11callImpl_h2ySi_SitAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2h2ySi_SitSbAA8TwoWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2h2ySi_SitSbAA8TwoWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) // CHECK: [[CALL_RES0:%.*]] = extractvalue { i64, i64 } [[CALL_RES]], 0 // CHECK: [[CALL_RES1:%.*]] = extractvalue { i64, i64 } [[CALL_RES]], 1 // CHECK: [[ERROR:%.*]] = load ptr, ptr %swifterror, align 8 @@ -1030,7 +1030,7 @@ func callImpl_h2(_ impl: Impl, _ b: Bool) -> (Int, Int) { // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi11callImpl_h3ySi_S2itAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2h3ySi_S2itSbAA8TwoWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2h3ySi_S2itSbAA8TwoWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) // CHECK: [[CALL_RES0:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 0 // CHECK: [[CALL_RES1:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 1 // CHECK: [[CALL_RES2:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 2 @@ -1069,7 +1069,7 @@ func callImpl_h3(_ impl: Impl, _ b: Bool) -> (Int, Int, Int) { // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi11callImpl_h4ySi_S3itAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi4ImplV2h4ySi_S3itSbAA8TwoWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi4ImplV2h4ySi_S3itSbAA8TwoWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) // CHECK: [[CALL_RES0:%.*]] = extractvalue { i64, i64, i64, i64 } [[CALL_RES]], 0 // CHECK: [[CALL_RES1:%.*]] = extractvalue { i64, i64, i64, i64 } [[CALL_RES]], 1 // CHECK: [[CALL_RES2:%.*]] = extractvalue { i64, i64, i64, i64 } [[CALL_RES]], 2 @@ -1109,12 +1109,12 @@ func callImpl_h4(_ impl: Impl, _ b: Bool) -> (Int, Int, Int, Int) { } } -// CHECK: define hidden swiftcc void @"$s16typed_throws_abi11callImpl_h5ySi_S4itAA0E0V_SbtF"(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1) +// CHECK: define hidden swiftcc void @"$s16typed_throws_abi11callImpl_h5ySi_S4itAA0E0V_SbtF"(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 // CHECK: %swifterror1 = alloca %T16typed_throws_abi8TwoWordsV, align 8 // CHECK: %call.aggresult = alloca <{ %TSi, %TSi, %TSi, %TSi, %TSi }>, align 8 -// CHECK: call swiftcc void @"$s16typed_throws_abi4ImplV2h5ySi_S4itSbAA8TwoWordsVYKF"(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %call.aggresult, i1 %1, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror, ptr %swifterror1) +// CHECK: call swiftcc void @"$s16typed_throws_abi4ImplV2h5ySi_S4itSbAA8TwoWordsVYKF"(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %call.aggresult, i1 %1, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror, ptr %swifterror1) // CHECK: [[CALL_RES0:%.*]] = load i64, ptr {{%call.aggresult.*}}, align 8 // CHECK: [[CALL_RES1:%.*]] = load i64, ptr {{%call.aggresult.*}}, align 8 // CHECK: [[CALL_RES2:%.*]] = load i64, ptr {{%call.aggresult.*}}, align 8 @@ -1165,7 +1165,7 @@ func callImpl_h5(_ impl: Impl, _ b: Bool) -> (Int, Int, Int, Int, Int) { // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi11callImpl_i0ySi_S2itAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i0yySbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i0yySbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) // CHECK: [[CALL_RES0:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 0 // CHECK: [[CALL_RES1:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 1 // CHECK: [[CALL_RES2:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 2 @@ -1203,7 +1203,7 @@ func callImpl_i0(_ impl: Impl, _ b: Bool) -> (Int, Int, Int) { // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi11callImpl_i1ySi_S2itAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i1ySiSbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i1ySiSbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) // CHECK: [[CALL_RES0:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 0 // CHECK: [[CALL_RES1:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 1 // CHECK: [[CALL_RES2:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 2 @@ -1241,7 +1241,7 @@ func callImpl_i1(_ impl: Impl, _ b: Bool) -> (Int, Int, Int) { // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi11callImpl_i2ySi_S2itAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i2ySi_SitSbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i2ySi_SitSbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) // CHECK: [[CALL_RES0:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 0 // CHECK: [[CALL_RES1:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 1 // CHECK: [[CALL_RES2:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 2 @@ -1281,7 +1281,7 @@ func callImpl_i2(_ impl: Impl, _ b: Bool) -> (Int, Int, Int) { // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi11callImpl_i3ySi_S2itAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i3ySi_S2itSbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i3ySi_S2itSbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) // CHECK: [[CALL_RES0:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 0 // CHECK: [[CALL_RES1:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 1 // CHECK: [[CALL_RES2:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 2 @@ -1321,7 +1321,7 @@ func callImpl_i3(_ impl: Impl, _ b: Bool) -> (Int, Int, Int) { // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi11callImpl_i4ySi_S3itAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i4ySi_S3itSbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i4ySi_S3itSbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) // CHECK: [[CALL_RES0:%.*]] = extractvalue { i64, i64, i64, i64 } [[CALL_RES]], 0 // CHECK: [[CALL_RES1:%.*]] = extractvalue { i64, i64, i64, i64 } [[CALL_RES]], 1 // CHECK: [[CALL_RES2:%.*]] = extractvalue { i64, i64, i64, i64 } [[CALL_RES]], 2 @@ -1362,12 +1362,12 @@ func callImpl_i4(_ impl: Impl, _ b: Bool) -> (Int, Int, Int, Int) { } } -// CHECK: define hidden swiftcc void @"$s16typed_throws_abi11callImpl_i5ySi_S4itAA0E0V_SbtF"(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1) +// CHECK: define hidden swiftcc void @"$s16typed_throws_abi11callImpl_i5ySi_S4itAA0E0V_SbtF"(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 // CHECK: %swifterror1 = alloca %T16typed_throws_abi10ThreeWordsV, align 8 // CHECK: %call.aggresult = alloca <{ %TSi, %TSi, %TSi, %TSi, %TSi }>, align 8 -// CHECK: call swiftcc void @"$s16typed_throws_abi4ImplV2i5ySi_S4itSbAA10ThreeWordsVYKF"(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %call.aggresult, i1 %1, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror, ptr %swifterror1) +// CHECK: call swiftcc void @"$s16typed_throws_abi4ImplV2i5ySi_S4itSbAA10ThreeWordsVYKF"(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %call.aggresult, i1 %1, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror, ptr %swifterror1) // CHECK: [[CALL_RES0:%.*]] = load i64, ptr {{%call.aggresult.*}}, align 8 // CHECK: [[CALL_RES1:%.*]] = load i64, ptr {{%call.aggresult.*}}, align 8 // CHECK: [[CALL_RES2:%.*]] = load i64, ptr {{%call.aggresult.*}}, align 8 @@ -1519,7 +1519,7 @@ struct ImplAsync: PAsync { return (1, 2, 3, 4) } - // CHECK: define hidden swifttailcc void @"$s16typed_throws_abi9ImplAsyncV2f5ySi_S4itSbYaAA5EmptyVYKF"(ptr noalias nocapture %0, ptr swiftasync %1, i1 %2, ptr %3) + // CHECK: define hidden swifttailcc void @"$s16typed_throws_abi9ImplAsyncV2f5ySi_S4itSbYaAA5EmptyVYKF"(ptr noalias captures(none) %0, ptr swiftasync %1, i1 %2, ptr %3) // CHECK: [[CORO:%.*]] = call ptr @llvm.coro.begin(token {{%.*}}, ptr null) // CHECK: br i1 %2, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: @@ -1648,7 +1648,7 @@ struct ImplAsync: PAsync { return (1, 2, 3, 4) } - // CHECK: define hidden swifttailcc void @"$s16typed_throws_abi9ImplAsyncV2g5ySi_S4itSbYaAA7OneWordVYKF"(ptr noalias nocapture %0, ptr swiftasync %1, i1 %2, ptr %3) + // CHECK: define hidden swifttailcc void @"$s16typed_throws_abi9ImplAsyncV2g5ySi_S4itSbYaAA7OneWordVYKF"(ptr noalias captures(none) %0, ptr swiftasync %1, i1 %2, ptr %3) // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi7OneWordV, align 8 // CHECK: [[CORO:%.*]] = call ptr @llvm.coro.begin(token {{%.*}}, ptr null) // CHECK: br i1 %2, label %[[SUCCESS:.*]], label %[[FAIL:.*]] @@ -1778,7 +1778,7 @@ struct ImplAsync: PAsync { return (1, 2, 3, 4) } - // CHECK: define hidden swifttailcc void @"$s16typed_throws_abi9ImplAsyncV2h5ySi_S4itSbYaAA8TwoWordsVYKF"(ptr noalias nocapture %0, ptr swiftasync %1, i1 %2, ptr %3) + // CHECK: define hidden swifttailcc void @"$s16typed_throws_abi9ImplAsyncV2h5ySi_S4itSbYaAA8TwoWordsVYKF"(ptr noalias captures(none) %0, ptr swiftasync %1, i1 %2, ptr %3) // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi8TwoWordsV, align 8 // CHECK: [[CORO:%.*]] = call ptr @llvm.coro.begin(token {{%.*}}, ptr null) // CHECK: br i1 %2, label %[[SUCCESS:.*]], label %[[FAIL:.*]] @@ -1908,7 +1908,7 @@ struct ImplAsync: PAsync { return (1, 2, 3, 4) } - // CHECK: define hidden swifttailcc void @"$s16typed_throws_abi9ImplAsyncV2i5ySi_S4itSbYaAA10ThreeWordsVYKF"(ptr noalias nocapture %0, ptr swiftasync %1, i1 %2, ptr %3) + // CHECK: define hidden swifttailcc void @"$s16typed_throws_abi9ImplAsyncV2i5ySi_S4itSbYaAA10ThreeWordsVYKF"(ptr noalias captures(none) %0, ptr swiftasync %1, i1 %2, ptr %3) // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi10ThreeWordsV, align 8 // CHECK: [[CORO:%.*]] = call ptr @llvm.coro.begin(token {{%.*}}, ptr null) // CHECK: br i1 %2, label %[[SUCCESS:.*]], label %[[FAIL:.*]] @@ -2127,7 +2127,7 @@ func callImplAsync_f4(_ impl: ImplAsync, _ b: Bool) async -> (Int, Int, Int, Int } } -// CHECK: define hidden swifttailcc void @"$s16typed_throws_abi16callImplAsync_f5ySi_S4itAA0eF0V_SbtYaF"(ptr noalias nocapture %0, ptr swiftasync %1, i1 %2) +// CHECK: define hidden swifttailcc void @"$s16typed_throws_abi16callImplAsync_f5ySi_S4itAA0eF0V_SbtYaF"(ptr noalias captures(none) %0, ptr swiftasync %1, i1 %2) // CHECK: %swifterror = alloca ptr, align 8 // CHECK: %call.aggresult = alloca <{ %TSi, %TSi, %TSi, %TSi, %TSi }>, align 8 // CHECK: %swifterror1 = alloca swifterror ptr, align 8 @@ -2381,7 +2381,7 @@ func callImplAsync_g4(_ impl: ImplAsync, _ b: Bool) async -> (Int, Int, Int, Int } -// CHECK: define hidden swifttailcc void @"$s16typed_throws_abi16callImplAsync_g5ySi_S4itAA0eF0V_SbtYaF"(ptr noalias nocapture %0, ptr swiftasync %1, i1 %2) +// CHECK: define hidden swifttailcc void @"$s16typed_throws_abi16callImplAsync_g5ySi_S4itAA0eF0V_SbtYaF"(ptr noalias captures(none) %0, ptr swiftasync %1, i1 %2) // CHECK: %swifterror = alloca %T16typed_throws_abi7OneWordV, align 8 // CHECK: %call.aggresult = alloca <{ %TSi, %TSi, %TSi, %TSi, %TSi }>, align 8 // CHECK: %swifterror1 = alloca swifterror ptr, align 8 @@ -2647,7 +2647,7 @@ func callImplAsync_h4(_ impl: ImplAsync, _ b: Bool) async -> (Int, Int, Int, Int } -// CHECK: define hidden swifttailcc void @"$s16typed_throws_abi16callImplAsync_h5ySi_S4itAA0eF0V_SbtYaF"(ptr noalias nocapture %0, ptr swiftasync %1, i1 %2) +// CHECK: define hidden swifttailcc void @"$s16typed_throws_abi16callImplAsync_h5ySi_S4itAA0eF0V_SbtYaF"(ptr noalias captures(none) %0, ptr swiftasync %1, i1 %2) // CHECK: %swifterror = alloca %T16typed_throws_abi8TwoWordsV, align 8 // CHECK: %call.aggresult = alloca <{ %TSi, %TSi, %TSi, %TSi, %TSi }>, align 8 // CHECK: %swifterror1 = alloca swifterror ptr, align 8 @@ -2927,7 +2927,7 @@ func callImplAsync_i4(_ impl: ImplAsync, _ b: Bool) async -> (Int, Int, Int, Int } -// CHECK: define hidden swifttailcc void @"$s16typed_throws_abi16callImplAsync_i5ySi_S4itAA0eF0V_SbtYaF"(ptr noalias nocapture %0, ptr swiftasync %1, i1 %2) +// CHECK: define hidden swifttailcc void @"$s16typed_throws_abi16callImplAsync_i5ySi_S4itAA0eF0V_SbtYaF"(ptr noalias captures(none) %0, ptr swiftasync %1, i1 %2) // CHECK: %swifterror = alloca %T16typed_throws_abi10ThreeWordsV, align 8 // CHECK: %call.aggresult = alloca <{ %TSi, %TSi, %TSi, %TSi, %TSi }>, align 8 // CHECK: %swifterror1 = alloca swifterror ptr, align 8 @@ -2989,7 +2989,7 @@ func callImplAsync_i5(_ impl: ImplAsync, _ b: Bool) async -> (Int, Int, Int, Int } } -// CHECK: define hidden swiftcc { float, float, i64 } @"$s16typed_throws_abi14nonMatching_f0ySf_SftSbAA7OneWordVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) +// CHECK: define hidden swiftcc { float, float, i64 } @"$s16typed_throws_abi14nonMatching_f0ySf_SftSbAA7OneWordVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: // CHECK: ret { float, float, i64 } { float 1.000000e+00, float 2.000000e+00, i64 undef } @@ -3009,7 +3009,7 @@ func nonMatching_f0(_ b: Bool) throws(OneWord) -> (Float, Float) { // CHECK: define hidden swiftcc { i64, float, float } @"$s16typed_throws_abi18callNonMatching_f0ySi_S2ftSbF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc { float, float, i64 } @"$s16typed_throws_abi14nonMatching_f0ySf_SftSbAA7OneWordVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc { float, float, i64 } @"$s16typed_throws_abi14nonMatching_f0ySf_SftSbAA7OneWordVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) // CHECK: [[CALL_RES0:%.*]] = extractvalue { float, float, i64 } [[CALL_RES]], 0 // CHECK: [[CALL_RES1:%.*]] = extractvalue { float, float, i64 } [[CALL_RES]], 1 // CHECK: [[CALL_RES2:%.*]] = extractvalue { float, float, i64 } [[CALL_RES]], 2 @@ -3044,7 +3044,7 @@ func callNonMatching_f0(_ b: Bool) -> (Int, Float, Float) { } } -// define hidden swiftcc { float, i64, float } @"$s16typed_throws_abi14nonMatching_f1ySf_SbSftSbAA7OneWordVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) +// define hidden swiftcc { float, i64, float } @"$s16typed_throws_abi14nonMatching_f1ySf_SbSftSbAA7OneWordVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: // CHECK: ret { float, i64, float } { float 1.000000e+00, i64 1, float 2.000000e+00 } @@ -3063,7 +3063,7 @@ func nonMatching_f1(_ b: Bool) throws(OneWord) -> (Float, Bool, Float) { // CHECK: define hidden swiftcc { i64, float, i1, float } @"$s16typed_throws_abi18callNonMatching_f1ySi_SfSbSftSbF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc { float, i64, float } @"$s16typed_throws_abi14nonMatching_f1ySf_SbSftSbAA7OneWordVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc { float, i64, float } @"$s16typed_throws_abi14nonMatching_f1ySf_SbSftSbAA7OneWordVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) // CHECK: [[CALL_RES0:%.*]] = extractvalue { float, i64, float } [[CALL_RES]], 0 // CHECK: [[CALL_RES1:%.*]] = extractvalue { float, i64, float } [[CALL_RES]], 1 // CHECK: [[CALL_RES2:%.*]] = extractvalue { float, i64, float } [[CALL_RES]], 2 @@ -3225,7 +3225,7 @@ func callNonMatching_f1_async(_ b: Bool) async -> (Int, Float, Bool, Float) { } protocol P { - // CHECK: define hidden swiftcc void @"$s16typed_throws_abi1PP2f0yySbAA5EmptyVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc void @"$s16typed_throws_abi1PP2f0yySbAA5EmptyVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3236,7 +3236,7 @@ protocol P { // CHECK: } func f0(_ b: Bool) throws(Empty) - // CHECK: define hidden swiftcc i64 @"$s16typed_throws_abi1PP2f1ySiSbAA5EmptyVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc i64 @"$s16typed_throws_abi1PP2f1ySiSbAA5EmptyVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3247,7 +3247,7 @@ protocol P { // CHECK: } func f1(_ b: Bool) throws(Empty) -> Int - // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi1PP2f2ySi_SitSbAA5EmptyVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi1PP2f2ySi_SitSbAA5EmptyVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3258,7 +3258,7 @@ protocol P { // CHECK: } func f2(_ b: Bool) throws(Empty) -> (Int, Int) - // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi1PP2f3ySi_S2itSbAA5EmptyVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi1PP2f3ySi_S2itSbAA5EmptyVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3269,7 +3269,7 @@ protocol P { // CHECK: } func f3(_ b: Bool) throws(Empty) -> (Int, Int, Int) - // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi1PP2f4ySi_S3itSbAA5EmptyVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi1PP2f4ySi_S3itSbAA5EmptyVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3280,13 +3280,13 @@ protocol P { // CHECK: } func f4(_ b: Bool) throws(Empty) -> (Int, Int, Int, Int) - // CHECK: define hidden swiftcc void @"$s16typed_throws_abi1PP2f5ySi_S4itSbAA5EmptyVYKFTj"(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr noalias swiftself %2, ptr noalias nocapture swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) - // CHECK: call swiftcc void {{%.*}}(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr noalias swiftself %2, ptr noalias nocapture swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) + // CHECK: define hidden swiftcc void @"$s16typed_throws_abi1PP2f5ySi_S4itSbAA5EmptyVYKFTj"(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr noalias swiftself %2, ptr noalias captures(none) swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) + // CHECK: call swiftcc void {{%.*}}(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr noalias swiftself %2, ptr noalias captures(none) swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) // CHECK: ret void // CHECK: } func f5(_ b: Bool) throws(Empty) -> (Int, Int, Int, Int, Int) - // CHECK: define hidden swiftcc i64 @"$s16typed_throws_abi1PP2g0yySbAA7OneWordVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc i64 @"$s16typed_throws_abi1PP2g0yySbAA7OneWordVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3297,7 +3297,7 @@ protocol P { // CHECK: } func g0(_ b: Bool) throws(OneWord) - // CHECK: define hidden swiftcc i64 @"$s16typed_throws_abi1PP2g1ySiSbAA7OneWordVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc i64 @"$s16typed_throws_abi1PP2g1ySiSbAA7OneWordVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3308,7 +3308,7 @@ protocol P { // CHECK: } func g1(_ b: Bool) throws(OneWord) -> Int - // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi1PP2g2ySi_SitSbAA7OneWordVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi1PP2g2ySi_SitSbAA7OneWordVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3319,7 +3319,7 @@ protocol P { // CHECK: } func g2(_ b: Bool) throws(OneWord) -> (Int, Int) - // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi1PP2g3ySi_S2itSbAA7OneWordVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi1PP2g3ySi_S2itSbAA7OneWordVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3330,7 +3330,7 @@ protocol P { // CHECK: } func g3(_ b: Bool) throws(OneWord) -> (Int, Int, Int) - // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi1PP2g4ySi_S3itSbAA7OneWordVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi1PP2g4ySi_S3itSbAA7OneWordVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3341,13 +3341,13 @@ protocol P { // CHECK: } func g4(_ b: Bool) throws(OneWord) -> (Int, Int, Int, Int) - // CHECK: define hidden swiftcc void @"$s16typed_throws_abi1PP2g5ySi_S4itSbAA7OneWordVYKFTj"(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr noalias swiftself %2, ptr noalias nocapture swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) - // CHECK: call swiftcc void {{%.*}}(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr noalias swiftself %2, ptr noalias nocapture swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) + // CHECK: define hidden swiftcc void @"$s16typed_throws_abi1PP2g5ySi_S4itSbAA7OneWordVYKFTj"(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr noalias swiftself %2, ptr noalias captures(none) swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) + // CHECK: call swiftcc void {{%.*}}(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr noalias swiftself %2, ptr noalias captures(none) swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) // CHECK: ret void // CHECK: } func g5(_ b: Bool) throws(OneWord) -> (Int, Int, Int, Int, Int) - // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi1PP2h0yySbAA8TwoWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi1PP2h0yySbAA8TwoWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3358,7 +3358,7 @@ protocol P { // CHECK: } func h0(_ b: Bool) throws(TwoWords) - // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi1PP2h1ySiSbAA8TwoWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi1PP2h1ySiSbAA8TwoWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3369,7 +3369,7 @@ protocol P { // CHECK: } func h1(_ b: Bool) throws(TwoWords) -> Int - // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi1PP2h2ySi_SitSbAA8TwoWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi1PP2h2ySi_SitSbAA8TwoWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3380,7 +3380,7 @@ protocol P { // CHECK: } func h2(_ b: Bool) throws(TwoWords) -> (Int, Int) - // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi1PP2h3ySi_S2itSbAA8TwoWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi1PP2h3ySi_S2itSbAA8TwoWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3391,7 +3391,7 @@ protocol P { // CHECK: } func h3(_ b: Bool) throws(TwoWords) -> (Int, Int, Int) - // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi1PP2h4ySi_S3itSbAA8TwoWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi1PP2h4ySi_S3itSbAA8TwoWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3402,13 +3402,13 @@ protocol P { // CHECK: } func h4(_ b: Bool) throws(TwoWords) -> (Int, Int, Int, Int) - // CHECK: define hidden swiftcc void @"$s16typed_throws_abi1PP2h5ySi_S4itSbAA8TwoWordsVYKFTj"(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr noalias swiftself %2, ptr noalias nocapture swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) - // CHECK: call swiftcc void {{%.*}}(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr noalias swiftself %2, ptr noalias nocapture swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) + // CHECK: define hidden swiftcc void @"$s16typed_throws_abi1PP2h5ySi_S4itSbAA8TwoWordsVYKFTj"(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr noalias swiftself %2, ptr noalias captures(none) swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) + // CHECK: call swiftcc void {{%.*}}(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr noalias swiftself %2, ptr noalias captures(none) swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) // CHECK: ret void // CHECK: } func h5(_ b: Bool) throws(TwoWords) -> (Int, Int, Int, Int, Int) - // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi1PP2i0yySbAA10ThreeWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi1PP2i0yySbAA10ThreeWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3419,7 +3419,7 @@ protocol P { // CHECK: } func i0(_ b: Bool) throws(ThreeWords) - // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi1PP2i1ySiSbAA10ThreeWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi1PP2i1ySiSbAA10ThreeWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3430,7 +3430,7 @@ protocol P { // CHECK: } func i1(_ b: Bool) throws(ThreeWords) -> Int - // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi1PP2i2ySi_SitSbAA10ThreeWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi1PP2i2ySi_SitSbAA10ThreeWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3441,7 +3441,7 @@ protocol P { // CHECK: } func i2(_ b: Bool) throws(ThreeWords) -> (Int, Int) - // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi1PP2i3ySi_S2itSbAA10ThreeWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi1PP2i3ySi_S2itSbAA10ThreeWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3452,7 +3452,7 @@ protocol P { // CHECK: } func i3(_ b: Bool) throws(ThreeWords) -> (Int, Int, Int) - // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi1PP2i4ySi_S3itSbAA10ThreeWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi1PP2i4ySi_S3itSbAA10ThreeWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3463,8 +3463,8 @@ protocol P { // CHECK: } func i4(_ b: Bool) throws(ThreeWords) -> (Int, Int, Int, Int) - // CHECK: define hidden swiftcc void @"$s16typed_throws_abi1PP2i5ySi_S4itSbAA10ThreeWordsVYKFTj"(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr noalias swiftself %2, ptr noalias nocapture swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) - // CHECK: call swiftcc void {{%.*}}(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr noalias swiftself %2, ptr noalias nocapture swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) + // CHECK: define hidden swiftcc void @"$s16typed_throws_abi1PP2i5ySi_S4itSbAA10ThreeWordsVYKFTj"(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr noalias swiftself %2, ptr noalias captures(none) swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) + // CHECK: call swiftcc void {{%.*}}(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr noalias swiftself %2, ptr noalias captures(none) swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) // CHECK: ret void // CHECK: } func i5(_ b: Bool) throws(ThreeWords) -> (Int, Int, Int, Int, Int) @@ -3542,7 +3542,7 @@ protocol PAsync { // CHECK: } func f4(_ b: Bool) async throws(Empty) -> (Int, Int, Int, Int) - // CHECK: define hidden swifttailcc void @"$s16typed_throws_abi6PAsyncP2f5ySi_S4itSbYaAA5EmptyVYKFTj"(ptr noalias nocapture %0, ptr swiftasync %1, i1 %2, ptr noalias swiftself %3, ptr %4, ptr %5, ptr %6) + // CHECK: define hidden swifttailcc void @"$s16typed_throws_abi6PAsyncP2f5ySi_S4itSbYaAA5EmptyVYKFTj"(ptr noalias captures(none) %0, ptr swiftasync %1, i1 %2, ptr noalias swiftself %3, ptr %4, ptr %5, ptr %6) // CHECK: %swifterror = alloca swifterror ptr // CHECK: [[CORO:%.*]] = call ptr @llvm.coro.begin(token {{%.*}}, ptr null) // CHECK: store ptr null, ptr %swifterror @@ -3621,7 +3621,7 @@ protocol PAsync { // CHECK: } func g4(_ b: Bool) async throws(OneWord) -> (Int, Int, Int, Int) - // CHECK: define hidden swifttailcc void @"$s16typed_throws_abi6PAsyncP2g5ySi_S4itSbYaAA7OneWordVYKFTj"(ptr noalias nocapture %0, ptr swiftasync %1, i1 %2, ptr noalias swiftself %3, ptr %4, ptr %5, ptr %6) + // CHECK: define hidden swifttailcc void @"$s16typed_throws_abi6PAsyncP2g5ySi_S4itSbYaAA7OneWordVYKFTj"(ptr noalias captures(none) %0, ptr swiftasync %1, i1 %2, ptr noalias swiftself %3, ptr %4, ptr %5, ptr %6) // CHECK: %swifterror = alloca swifterror ptr // CHECK: [[CORO:%.*]] = call ptr @llvm.coro.begin(token {{%.*}}, ptr null) // CHECK: store ptr null, ptr %swifterror @@ -3700,7 +3700,7 @@ protocol PAsync { // CHECK: } func h4(_ b: Bool) async throws(TwoWords) -> (Int, Int, Int, Int) - // CHECK: define hidden swifttailcc void @"$s16typed_throws_abi6PAsyncP2h5ySi_S4itSbYaAA8TwoWordsVYKFTj"(ptr noalias nocapture %0, ptr swiftasync %1, i1 %2, ptr noalias swiftself %3, ptr %4, ptr %5, ptr %6) + // CHECK: define hidden swifttailcc void @"$s16typed_throws_abi6PAsyncP2h5ySi_S4itSbYaAA8TwoWordsVYKFTj"(ptr noalias captures(none) %0, ptr swiftasync %1, i1 %2, ptr noalias swiftself %3, ptr %4, ptr %5, ptr %6) // CHECK: %swifterror = alloca swifterror ptr // CHECK: [[CORO:%.*]] = call ptr @llvm.coro.begin(token {{%.*}}, ptr null) // CHECK: store ptr null, ptr %swifterror @@ -3779,7 +3779,7 @@ protocol PAsync { // CHECK: } func i4(_ b: Bool) async throws(ThreeWords) -> (Int, Int, Int, Int) - // CHECK: define hidden swifttailcc void @"$s16typed_throws_abi6PAsyncP2i5ySi_S4itSbYaAA10ThreeWordsVYKFTj"(ptr noalias nocapture %0, ptr swiftasync %1, i1 %2, ptr noalias swiftself %3, ptr %4, ptr %5, ptr %6) + // CHECK: define hidden swifttailcc void @"$s16typed_throws_abi6PAsyncP2i5ySi_S4itSbYaAA10ThreeWordsVYKFTj"(ptr noalias captures(none) %0, ptr swiftasync %1, i1 %2, ptr noalias swiftself %3, ptr %4, ptr %5, ptr %6) // CHECK: %swifterror = alloca swifterror ptr // CHECK: [[CORO:%.*]] = call ptr @llvm.coro.begin(token {{%.*}}, ptr null) // CHECK: store ptr null, ptr %swifterror diff --git a/test/IRGen/typed_throws_thunks.swift b/test/IRGen/typed_throws_thunks.swift index 4535cb4681f80..d72b00f349b79 100644 --- a/test/IRGen/typed_throws_thunks.swift +++ b/test/IRGen/typed_throws_thunks.swift @@ -45,9 +45,9 @@ extension P { } } - // CHECK-LABEL: define{{.*}} swiftcc void @"$s19typed_throws_thunks1PP2g24bodyyyy7FailureQzYKXE_tAGYKFTj"(ptr %0, ptr %1, ptr noalias swiftself %2, ptr noalias nocapture swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) + // CHECK-LABEL: define{{.*}} swiftcc void @"$s19typed_throws_thunks1PP2g24bodyyyy7FailureQzYKXE_tAGYKFTj"(ptr %0, ptr %1, ptr noalias swiftself %2, ptr noalias captures(none) swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) // CHECK-NOT: ret - // CHECK: call swiftcc void {{.*}}(ptr %0, ptr %1, ptr noalias swiftself %2, ptr noalias nocapture swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) + // CHECK: call swiftcc void {{.*}}(ptr %0, ptr %1, ptr noalias swiftself %2, ptr noalias captures(none) swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) public func g2(body: () throws(Failure) -> Void) throws(Failure) { do { @@ -57,9 +57,9 @@ extension P { } } - // CHECK-LABEL: define{{.*}} swiftcc { i64, i64 } @"$s19typed_throws_thunks1PP2g34bodyyyyAA9FixedSizeVYKXE_tAGYKFTj"(ptr %0, ptr %1, ptr noalias swiftself %2, ptr noalias nocapture swifterror dereferenceable(8) %3, ptr %4, ptr %5) + // CHECK-LABEL: define{{.*}} swiftcc { i64, i64 } @"$s19typed_throws_thunks1PP2g34bodyyyyAA9FixedSizeVYKXE_tAGYKFTj"(ptr %0, ptr %1, ptr noalias swiftself %2, ptr noalias captures(none) swifterror dereferenceable(8) %3, ptr %4, ptr %5) // CHECK-NOT: ret - // CHECK: call swiftcc { i64, i64 } {{.*}}(ptr %0, ptr %1, ptr noalias swiftself %2, ptr noalias nocapture swifterror dereferenceable(8) %3, ptr %4, ptr %5) + // CHECK: call swiftcc { i64, i64 } {{.*}}(ptr %0, ptr %1, ptr noalias swiftself %2, ptr noalias captures(none) swifterror dereferenceable(8) %3, ptr %4, ptr %5) public func g3(body: () throws(FixedSize) -> Void) throws(FixedSize) { @@ -69,7 +69,7 @@ extension P { protocol P2 { // CHECK-LABEL: define{{.*}} swiftcc void @"$s19typed_throws_thunks2P2P1fyyAA1EOYKFTj"( // CHECK-SAME: ptr noalias swiftself %0, -// CHECK-SAME: ptr noalias nocapture swifterror dereferenceable(8) %1, +// CHECK-SAME: ptr noalias captures(none) swifterror dereferenceable(8) %1, // CHECK-SAME: ptr %2, ptr %3 // CHECK-SAME: ) // CHECK-SAME: { @@ -81,7 +81,7 @@ protocol P2 { func f() throws(E) // CHECK-LABEL: define{{.*}} swiftcc i8 @"$s19typed_throws_thunks2P2P1gyys4Int8VYKFTj"( // CHECk-SAME: ptr noalias swiftself %0 -// CHECK-SAME: ptr noalias nocapture swifterror dereferenceable(8) %1 +// CHECK-SAME: ptr noalias captures(none) swifterror dereferenceable(8) %1 // CHECK-SAME: ptr %2 // CHECK-SAME: ptr %3 // CHECK-SAME: ) @@ -93,7 +93,7 @@ protocol P2 { func g() throws(Int8) // CHECK-LABEL: define{{.*}} swiftcc i8 @"$s19typed_throws_thunks2P2P1hs4Int8VyAA1EOYKFTj"( // CHECK-SAME: ptr noalias swiftself %0 -// CHECK-SAME: ptr noalias nocapture swifterror dereferenceable(8) %1 +// CHECK-SAME: ptr noalias captures(none) swifterror dereferenceable(8) %1 // CHECK-SAME: ptr %2 // CHECK-SAME: ptr %3 // CHECK-SAME: ) @@ -105,7 +105,7 @@ protocol P2 { func h() throws(E) -> Int8 // CHECK-LABEL: define{{.*}} swiftcc i8 @"$s19typed_throws_thunks2P2P1is4Int8VyAFYKFTj"( // CHECK-SAME: ptr noalias swiftself %0 -// CHECK-SAME: ptr noalias nocapture swifterror dereferenceable(8) %1 +// CHECK-SAME: ptr noalias captures(none) swifterror dereferenceable(8) %1 // CHECK-SAME: ptr %2 // CHECK-SAME: ptr %3 // CHECK-SAME: ) diff --git a/test/IRGen/typelayout_based_value_witness.swift b/test/IRGen/typelayout_based_value_witness.swift index 77ee87f9d965b..a2798e5e13d0b 100644 --- a/test/IRGen/typelayout_based_value_witness.swift +++ b/test/IRGen/typelayout_based_value_witness.swift @@ -81,7 +81,7 @@ public enum ForwardEnum { // CHECK: } -// OPT: define{{.*}} void @"$s30typelayout_based_value_witness1AVwxx"(ptr noalias %object, ptr nocapture readonly %"A") +// OPT: define{{.*}} void @"$s30typelayout_based_value_witness1AVwxx"(ptr noalias %object, ptr captures(none) readonly %"A") // OPT: [[T_PARAM:%.*]] = getelementptr inbounds i8, ptr %"A", i64 16 // OPT: [[T:%.*]] = load ptr, ptr [[T_PARAM]] // OPT: [[VWT_ADDR:%.*]] = getelementptr inbounds i8, ptr [[T]], {{(i64|i32)}} -8 @@ -127,7 +127,7 @@ public enum ForwardEnum { // OPT: ret void // CHECK: } -// OPT: define internal void @"$s30typelayout_based_value_witness2E3Owui"(ptr noalias nocapture writeonly %value, i32 %tag, ptr nocapture readonly %"E3") +// OPT: define internal void @"$s30typelayout_based_value_witness2E3Owui"(ptr noalias captures(none) writeonly %value, i32 %tag, ptr captures(none) readonly %"E3") // OPT: [[IS_EMPTY:%.*]] = icmp eq i32 {{%.*}}, 0 // OPT: br i1 [[IS_EMPTY]], label %empty-payload, label %non-empty-payload // OPT: } diff --git a/test/IRGen/unconditional_checked_cast.sil b/test/IRGen/unconditional_checked_cast.sil index adb01d83790f0..b4f9198282b61 100644 --- a/test/IRGen/unconditional_checked_cast.sil +++ b/test/IRGen/unconditional_checked_cast.sil @@ -10,7 +10,7 @@ sil_vtable C {} class D : C {} sil_vtable D {} -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @downcast_test(ptr noalias nocapture sret({{.*}}) %0, ptr nocapture dereferenceable({{.*}}) %1) {{.*}} { +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @downcast_test(ptr noalias captures(none) sret({{.*}}) %0, ptr captures(none) dereferenceable({{.*}}) %1) {{.*}} { // CHECK: entry: // CHECK-NEXT: [[INPUTPTR:%[0-9]+]] = load ptr, ptr [[INPUTPTRPTR:%[0-9]+]], align 8 // CHECK-NEXT: [[TMP:%.*]] = call swiftcc %swift.metadata_response @"$s26unconditional_checked_cast1DCMa"(i64 0) diff --git a/test/IRGen/witness_method.sil b/test/IRGen/witness_method.sil index 83158ff57addc..c59e41bde9b0d 100644 --- a/test/IRGen/witness_method.sil +++ b/test/IRGen/witness_method.sil @@ -110,7 +110,7 @@ class TPSReport : Strategy { func disrupt() -> GrowthHack } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @classArchetypeWitnessMethod(ptr noalias nocapture swiftself dereferenceable({{4|8}}) %0, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @classArchetypeWitnessMethod(ptr noalias captures(none) swiftself dereferenceable({{4|8}}) %0, ptr %Self, ptr %SelfWitnessTable) sil @classArchetypeWitnessMethod : $@convention(witness_method: Strategy) > (@in_guaranteed T) -> () { entry(%self : $*T): @@ -118,7 +118,7 @@ entry(%self : $*T): return %z : $() } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @testClassArchetypeWitnessMethod(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture dereferenceable({{4|8}}) %1, ptr %T, ptr %CoverSheet) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @testClassArchetypeWitnessMethod(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias captures(none) dereferenceable({{4|8}}) %1, ptr %T, ptr %CoverSheet) // CHECK: entry: // CHECK: [[WITNESS_FN:%.*]] = load ptr, ptr getelementptr inbounds (ptr, ptr @"$s14witness_method9TPSReportCyxGAA8StrategyAAWP", i32 3) // CHECK: call swiftcc void [[WITNESS_FN]](ptr noalias sret({{.*}}) %0, ptr noalias swiftself %1, ptr %T, ptr @"$s14witness_method9TPSReportCyxGAA8StrategyAAWP") diff --git a/test/IRGen/yield_once_big.sil b/test/IRGen/yield_once_big.sil index af03283f3f129..bc57efa915fd7 100644 --- a/test/IRGen/yield_once_big.sil +++ b/test/IRGen/yield_once_big.sil @@ -57,7 +57,7 @@ entry: %1000 = integer_literal $Builtin.Int32, 1000 apply %marker(%1000) : $@convention(thin) (Builtin.Int32) -> () - // CHECK-NEXT: call swiftcc void @make_big(ptr noalias nocapture sret({{.*}}) [[TEMP]], ptr %C) + // CHECK-NEXT: call swiftcc void @make_big(ptr noalias captures(none) sret({{.*}}) [[TEMP]], ptr %C) %make = function_ref @make_big : $@convention(thin) () -> (@owned Big) %value = apply %make() : $@convention(thin) () -> (@owned Big) @@ -171,8 +171,8 @@ cont: } // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { ptr, ptr } @test_simple_guaranteed -// CHECK-32-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE:16]]) %0, ptr noalias nocapture dereferenceable(32) %1, ptr %C) -// CHECK-64-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE:32]]) %0, ptr noalias nocapture dereferenceable(64) %1, ptr %C) +// CHECK-32-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE:16]]) %0, ptr noalias captures(none) dereferenceable(32) %1, ptr %C) +// CHECK-64-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE:32]]) %0, ptr noalias captures(none) dereferenceable(64) %1, ptr %C) sil [ossa] @test_simple_guaranteed : $@yield_once (@in_guaranteed BigWrapper) -> (@yields @guaranteed Big) { entry(%arg : $*BigWrapper): // Allocate space for the return value of make_big. diff --git a/test/IRGen/yield_once_indirect.sil b/test/IRGen/yield_once_indirect.sil index e45ed9b15a985..1ee9e6871a96d 100644 --- a/test/IRGen/yield_once_indirect.sil +++ b/test/IRGen/yield_once_indirect.sil @@ -42,7 +42,7 @@ entry: // CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 {{.*}}, ptr [[TEMP]]) %temp = alloc_stack $Indirect - // CHECK-NEXT: call swiftcc void @make_indirect(ptr noalias nocapture sret({{.*}}) [[TEMP]], ptr %C) + // CHECK-NEXT: call swiftcc void @make_indirect(ptr noalias captures(none) sret({{.*}}) [[TEMP]], ptr %C) %make = function_ref @make_indirect : $@convention(thin) () -> (@out Indirect) apply %make(%temp) : $@convention(thin) () -> (@out Indirect) diff --git a/test/Inputs/conditional_conformance_basic_conformances.swift b/test/Inputs/conditional_conformance_basic_conformances.swift index 40e8cc66b3c40..20138a7168a92 100644 --- a/test/Inputs/conditional_conformance_basic_conformances.swift +++ b/test/Inputs/conditional_conformance_basic_conformances.swift @@ -18,7 +18,7 @@ extension Single: P1 where A: P2 { // witness method for Single.normal -// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s42conditional_conformance_basic_conformances6SingleVyxGAA2P1A2A2P2RzlAaEP6normalyyFTW"(ptr noalias nocapture swiftself %0, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s42conditional_conformance_basic_conformances6SingleVyxGAA2P1A2A2P2RzlAaEP6normalyyFTW"(ptr noalias captures(none) swiftself %0, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: // CHECK-NEXT: [[A_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 -1 // CHECK-NEXT: [[A_P2_i8star:%.*]] = load ptr, ptr [[A_P2_PTR]], align 8 @@ -30,7 +30,7 @@ extension Single: P1 where A: P2 { // witness method for Single.generic -// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s42conditional_conformance_basic_conformances6SingleVyxGAA2P1A2A2P2RzlAaEP7genericyyqd__AA2P3Rd__lFTW"(ptr noalias %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias nocapture swiftself %1, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s42conditional_conformance_basic_conformances6SingleVyxGAA2P1A2A2P2RzlAaEP7genericyyqd__AA2P3Rd__lFTW"(ptr noalias %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias captures(none) swiftself %1, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: // CHECK-NEXT: [[A_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 -1 // CHECK-NEXT: [[A_P2_i8star:%.*]] = load ptr, ptr [[A_P2_PTR]], align 8 @@ -188,7 +188,7 @@ extension Double: P1 where B: P2, C: P3 { // witness method for Double.normal -// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s42conditional_conformance_basic_conformances6DoubleVyxq_GAA2P1A2A2P2RzAA2P3R_rlAaEP6normalyyFTW"(ptr noalias nocapture swiftself %0, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s42conditional_conformance_basic_conformances6DoubleVyxq_GAA2P1A2A2P2RzAA2P3R_rlAaEP6normalyyFTW"(ptr noalias captures(none) swiftself %0, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: // CHECK-NEXT: [[B_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 -1 // CHECK-NEXT: [[B_P2_i8star:%.*]] = load ptr, ptr [[B_P2_PTR]], align 8 @@ -208,7 +208,7 @@ extension Double: P1 where B: P2, C: P3 { // witness method for Double.generic -// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s42conditional_conformance_basic_conformances6DoubleVyxq_GAA2P1A2A2P2RzAA2P3R_rlAaEP7genericyyqd__AaGRd__lFTW"(ptr noalias %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias nocapture swiftself %1, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s42conditional_conformance_basic_conformances6DoubleVyxq_GAA2P1A2A2P2RzAA2P3R_rlAaEP7genericyyqd__AaGRd__lFTW"(ptr noalias %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias captures(none) swiftself %1, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: // CHECK-NEXT: [[B_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 -1 diff --git a/test/Inputs/conditional_conformance_basic_conformances_future.swift b/test/Inputs/conditional_conformance_basic_conformances_future.swift index e867a340524c7..3b43a5e305c75 100644 --- a/test/Inputs/conditional_conformance_basic_conformances_future.swift +++ b/test/Inputs/conditional_conformance_basic_conformances_future.swift @@ -18,7 +18,7 @@ extension Single: P1 where A: P2 { // witness method for Single.normal -// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s42conditional_conformance_basic_conformances6SingleVyxGAA2P1A2A2P2RzlAaEP6normalyyFTW"(ptr noalias nocapture swiftself %0, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s42conditional_conformance_basic_conformances6SingleVyxGAA2P1A2A2P2RzlAaEP6normalyyFTW"(ptr noalias captures(none) swiftself %0, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: // CHECK-NEXT: [[A_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 -1 // CHECK-NEXT: [[A_P2_i8star:%.*]] = load ptr, ptr [[A_P2_PTR]], align 8 @@ -30,7 +30,7 @@ extension Single: P1 where A: P2 { // witness method for Single.generic -// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s42conditional_conformance_basic_conformances6SingleVyxGAA2P1A2A2P2RzlAaEP7genericyyqd__AA2P3Rd__lFTW"(ptr noalias %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias nocapture swiftself %1, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s42conditional_conformance_basic_conformances6SingleVyxGAA2P1A2A2P2RzlAaEP7genericyyqd__AA2P3Rd__lFTW"(ptr noalias %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias captures(none) swiftself %1, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: // CHECK-NEXT: [[A_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 -1 // CHECK-NEXT: [[A_P2_i8star:%.*]] = load ptr, ptr [[A_P2_PTR]], align 8 @@ -167,7 +167,7 @@ extension Double: P1 where B: P2, C: P3 { // witness method for Double.normal -// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s42conditional_conformance_basic_conformances6DoubleVyxq_GAA2P1A2A2P2RzAA2P3R_rlAaEP6normalyyFTW"(ptr noalias nocapture swiftself %0, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s42conditional_conformance_basic_conformances6DoubleVyxq_GAA2P1A2A2P2RzAA2P3R_rlAaEP6normalyyFTW"(ptr noalias captures(none) swiftself %0, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: // CHECK-NEXT: [[B_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 -1 // CHECK-NEXT: [[B_P2_i8star:%.*]] = load ptr, ptr [[B_P2_PTR]], align 8 @@ -187,7 +187,7 @@ extension Double: P1 where B: P2, C: P3 { // witness method for Double.generic -// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s42conditional_conformance_basic_conformances6DoubleVyxq_GAA2P1A2A2P2RzAA2P3R_rlAaEP7genericyyqd__AaGRd__lFTW"(ptr noalias %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias nocapture swiftself %1, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s42conditional_conformance_basic_conformances6DoubleVyxq_GAA2P1A2A2P2RzAA2P3R_rlAaEP7genericyyqd__AaGRd__lFTW"(ptr noalias %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias captures(none) swiftself %1, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: // CHECK-NEXT: [[B_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 -1 diff --git a/test/Inputs/conditional_conformance_subclass.swift b/test/Inputs/conditional_conformance_subclass.swift index de35a0d82cc72..5775374b33107 100644 --- a/test/Inputs/conditional_conformance_subclass.swift +++ b/test/Inputs/conditional_conformance_subclass.swift @@ -16,7 +16,7 @@ extension Base: P1 where A: P2 { // witness method for Base.normal -// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s32conditional_conformance_subclass4BaseCyxGAA2P1A2A2P2RzlAaEP6normalyyFTW"(ptr noalias nocapture swiftself dereferenceable(8) %0, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s32conditional_conformance_subclass4BaseCyxGAA2P1A2A2P2RzlAaEP6normalyyFTW"(ptr noalias captures(none) swiftself dereferenceable(8) %0, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: // CHECK-NEXT: [[A_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 -1 // CHECK-NEXT: [[A_P2:%.*]] = load ptr, ptr [[A_P2_PTR]], align 8 @@ -27,7 +27,7 @@ extension Base: P1 where A: P2 { // witness method for Base.generic -// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s32conditional_conformance_subclass4BaseCyxGAA2P1A2A2P2RzlAaEP7genericyyqd__AA2P3Rd__lFTW"(ptr noalias %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias nocapture swiftself dereferenceable(8) %1, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s32conditional_conformance_subclass4BaseCyxGAA2P1A2A2P2RzlAaEP7genericyyqd__AA2P3Rd__lFTW"(ptr noalias %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias captures(none) swiftself dereferenceable(8) %1, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: // CHECK-NEXT: [[A_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 -1 // CHECK-NEXT: [[A_P2:%.*]] = load ptr, ptr [[A_P2_PTR]], align 8 diff --git a/test/Inputs/conditional_conformance_subclass_future.swift b/test/Inputs/conditional_conformance_subclass_future.swift index 4f1a59e28b3f4..c88fb733e0672 100644 --- a/test/Inputs/conditional_conformance_subclass_future.swift +++ b/test/Inputs/conditional_conformance_subclass_future.swift @@ -16,7 +16,7 @@ extension Base: P1 where A: P2 { // witness method for Base.normal -// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s32conditional_conformance_subclass4BaseCyxGAA2P1A2A2P2RzlAaEP6normalyyFTW"(ptr noalias nocapture swiftself dereferenceable(8) %0, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s32conditional_conformance_subclass4BaseCyxGAA2P1A2A2P2RzlAaEP6normalyyFTW"(ptr noalias captures(none) swiftself dereferenceable(8) %0, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: // CHECK-NEXT: [[A_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 -1 // CHECK-NEXT: [[A_P2:%.*]] = load ptr, ptr [[A_P2_PTR]], align 8 @@ -27,7 +27,7 @@ extension Base: P1 where A: P2 { // witness method for Base.generic -// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s32conditional_conformance_subclass4BaseCyxGAA2P1A2A2P2RzlAaEP7genericyyqd__AA2P3Rd__lFTW"(ptr noalias %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias nocapture swiftself dereferenceable(8) %1, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s32conditional_conformance_subclass4BaseCyxGAA2P1A2A2P2RzlAaEP7genericyyqd__AA2P3Rd__lFTW"(ptr noalias %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias captures(none) swiftself dereferenceable(8) %1, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: // CHECK-NEXT: [[A_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 -1 // CHECK-NEXT: [[A_P2:%.*]] = load ptr, ptr [[A_P2_PTR]], align 8 diff --git a/test/Inputs/conditional_conformance_with_assoc.swift b/test/Inputs/conditional_conformance_with_assoc.swift index 1aeffe8f2cf56..84258108a350f 100644 --- a/test/Inputs/conditional_conformance_with_assoc.swift +++ b/test/Inputs/conditional_conformance_with_assoc.swift @@ -41,7 +41,7 @@ extension Double: P1 where B.AT2: P2, C: P3, B.AT2.AT2.AT3: P3 { // witness method for Double.normal -// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s34conditional_conformance_with_assoc6DoubleVyxq_GAA2P1A2A2P3R_AA2P23AT2RpzAafH_AhaGP3AT3RPzrlAaEP6normalyyFTW"(ptr noalias nocapture swiftself %0, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s34conditional_conformance_with_assoc6DoubleVyxq_GAA2P1A2A2P3R_AA2P23AT2RpzAafH_AhaGP3AT3RPzrlAaEP6normalyyFTW"(ptr noalias captures(none) swiftself %0, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: // CHECK-NEXT: [[C_P3_PTR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 -1 // CHECK-NEXT: [[C_P3:%.*]] = load ptr, ptr [[C_P3_PTR]], align 8 @@ -67,7 +67,7 @@ extension Double: P1 where B.AT2: P2, C: P3, B.AT2.AT2.AT3: P3 { // witness method for Double.generic -// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s34conditional_conformance_with_assoc6DoubleVyxq_GAA2P1A2A2P3R_AA2P23AT2RpzAafH_AhaGP3AT3RPzrlAaEP7genericyyqd__AaFRd__lFTW"(ptr noalias %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias nocapture swiftself %1, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s34conditional_conformance_with_assoc6DoubleVyxq_GAA2P1A2A2P3R_AA2P23AT2RpzAafH_AhaGP3AT3RPzrlAaEP7genericyyqd__AaFRd__lFTW"(ptr noalias %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias captures(none) swiftself %1, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: // CHECK-NEXT: [[C_P3_PTR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 -1 // CHECK-NEXT: [[C_P3:%.*]] = load ptr, ptr [[C_P3_PTR]], align 8 diff --git a/test/Inputs/conditional_conformance_with_assoc_future.swift b/test/Inputs/conditional_conformance_with_assoc_future.swift index 5dee20e72d072..229ede617538f 100644 --- a/test/Inputs/conditional_conformance_with_assoc_future.swift +++ b/test/Inputs/conditional_conformance_with_assoc_future.swift @@ -41,7 +41,7 @@ extension Double: P1 where B.AT2: P2, C: P3, B.AT2.AT2.AT3: P3 { // witness method for Double.normal -// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s34conditional_conformance_with_assoc6DoubleVyxq_GAA2P1A2A2P3R_AA2P23AT2RpzAafH_AhaGP3AT3RPzrlAaEP6normalyyFTW"(ptr noalias nocapture swiftself %0, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s34conditional_conformance_with_assoc6DoubleVyxq_GAA2P1A2A2P3R_AA2P23AT2RpzAafH_AhaGP3AT3RPzrlAaEP6normalyyFTW"(ptr noalias captures(none) swiftself %0, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: // CHECK-NEXT: [[C_P3_PTR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 -1 // CHECK-NEXT: [[C_P3:%.*]] = load ptr, ptr [[C_P3_PTR]], align 8 @@ -67,7 +67,7 @@ extension Double: P1 where B.AT2: P2, C: P3, B.AT2.AT2.AT3: P3 { // witness method for Double.generic -// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s34conditional_conformance_with_assoc6DoubleVyxq_GAA2P1A2A2P3R_AA2P23AT2RpzAafH_AhaGP3AT3RPzrlAaEP7genericyyqd__AaFRd__lFTW"(ptr noalias %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias nocapture swiftself %1, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s34conditional_conformance_with_assoc6DoubleVyxq_GAA2P1A2A2P3R_AA2P23AT2RpzAafH_AhaGP3AT3RPzrlAaEP7genericyyqd__AaFRd__lFTW"(ptr noalias %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias captures(none) swiftself %1, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: // CHECK-NEXT: [[C_P3_PTR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 -1 // CHECK-NEXT: [[C_P3:%.*]] = load ptr, ptr [[C_P3_PTR]], align 8 diff --git a/test/Interop/Cxx/class/method/inreg-sret.swift b/test/Interop/Cxx/class/method/inreg-sret.swift index b11bc95fe3c68..c5258b6a1c863 100644 --- a/test/Interop/Cxx/class/method/inreg-sret.swift +++ b/test/Interop/Cxx/class/method/inreg-sret.swift @@ -21,8 +21,8 @@ final public class Function { // Check that inreg on the sret isn't missing -// CHECK-x86_64: call void @"?getFirstBlock@BridgedFunction@@QEBA?AUOptionalBridgedBasicBlock@@XZ"(ptr {{.*}}, ptr noalias nocapture sret(%TSo25OptionalBridgedBasicBlockV) {{.*}}) -// CHECK-aarch64: call void @"?getFirstBlock@BridgedFunction@@QEBA?AUOptionalBridgedBasicBlock@@XZ"(ptr {{.*}}, ptr inreg noalias nocapture sret(%TSo25OptionalBridgedBasicBlockV) {{.*}}) +// CHECK-x86_64: call void @"?getFirstBlock@BridgedFunction@@QEBA?AUOptionalBridgedBasicBlock@@XZ"(ptr {{.*}}, ptr noalias captures(none) sret(%TSo25OptionalBridgedBasicBlockV) {{.*}}) +// CHECK-aarch64: call void @"?getFirstBlock@BridgedFunction@@QEBA?AUOptionalBridgedBasicBlock@@XZ"(ptr {{.*}}, ptr inreg noalias captures(none) sret(%TSo25OptionalBridgedBasicBlockV) {{.*}}) // CHECK-x86_64: define {{.*}} void @"?getFirstBlock@BridgedFunction@@QEBA?AUOptionalBridgedBasicBlock@@XZ"(ptr {{.*}} %{{.*}}, ptr {{.*}} sret(%struct.OptionalBridgedBasicBlock) {{.*}} %{{.*}}) // CHECK-aarch64: define {{.*}} void @"?getFirstBlock@BridgedFunction@@QEBA?AUOptionalBridgedBasicBlock@@XZ"(ptr {{.*}} %{{.*}}, ptr inreg {{.*}} sret(%struct.OptionalBridgedBasicBlock) {{.*}} %{{.*}}) diff --git a/test/Interop/Cxx/class/protocol-conformance-irgen.swift b/test/Interop/Cxx/class/protocol-conformance-irgen.swift index d5dbbe435add5..db017b4910b1c 100644 --- a/test/Interop/Cxx/class/protocol-conformance-irgen.swift +++ b/test/Interop/Cxx/class/protocol-conformance-irgen.swift @@ -7,7 +7,7 @@ protocol HasReturn42 { } -// CHECK: define {{.*}}i32 @"$sSo18ConformsToProtocolV4main11HasReturn42A2cDP8return42s5Int32VyFTW"(ptr nocapture swiftself dereferenceable(1) %{{.*}}, ptr %{{.*}}, ptr %{{.*}}) +// CHECK: define {{.*}}i32 @"$sSo18ConformsToProtocolV4main11HasReturn42A2cDP8return42s5Int32VyFTW"(ptr captures(none) swiftself dereferenceable(1) %{{.*}}, ptr %{{.*}}, ptr %{{.*}}) // CHECK: [[OUT:%.*]] = call i32 @{{_ZN18ConformsToProtocol8return42Ev|"\?return42@ConformsToProtocol@@QEAAHXZ"}}(ptr // CHECK: ret i32 [[OUT]] diff --git a/test/Interop/Cxx/class/returns-large-class-irgen.swift b/test/Interop/Cxx/class/returns-large-class-irgen.swift index d9e6f3af56c7a..f45dde04337da 100644 --- a/test/Interop/Cxx/class/returns-large-class-irgen.swift +++ b/test/Interop/Cxx/class/returns-large-class-irgen.swift @@ -14,7 +14,7 @@ func foo() -> LargeClass { foo() -// CHECK: call swiftcc void @"$s4main3fooSo10LargeClassVyF"(ptr noalias nocapture sret(%TSo10LargeClassV) %{{.*}}) +// CHECK: call swiftcc void @"$s4main3fooSo10LargeClassVyF"(ptr noalias captures(none) sret(%TSo10LargeClassV) %{{.*}}) // The C++ function: // CHECK: define{{( dso_local)?}} void @{{_Z21funcReturnsLargeClassv|"\?funcReturnsLargeClass@@YA\?AULargeClass@@XZ"}}({{%struct.LargeClass\*|ptr}}{{.*}} sret(%struct.LargeClass){{( align .*)?}} %{{.*}}) diff --git a/test/Interop/Cxx/extern-var/extern-var-irgen.swift b/test/Interop/Cxx/extern-var/extern-var-irgen.swift index cbec5e8e26828..57a3d0a416542 100644 --- a/test/Interop/Cxx/extern-var/extern-var-irgen.swift +++ b/test/Interop/Cxx/extern-var/extern-var-irgen.swift @@ -44,4 +44,4 @@ public func passingVarAsInout() { } // CHECK: define {{(protected |dllexport )?}}swiftcc void @"$s4main17passingVarAsInoutyyF"() #0 -// CHECK: call swiftcc void @"$s4main11modifyInoutyys5Int32VzF"(ptr nocapture dereferenceable(4) @{{counter|"\?counter@@3HA"}}) +// CHECK: call swiftcc void @"$s4main11modifyInoutyys5Int32VzF"(ptr captures(none) dereferenceable(4) @{{counter|"\?counter@@3HA"}}) diff --git a/test/Interop/Cxx/static/inline-static-member-var-irgen.swift b/test/Interop/Cxx/static/inline-static-member-var-irgen.swift index f5409c05e9864..edde6d6c0617b 100644 --- a/test/Interop/Cxx/static/inline-static-member-var-irgen.swift +++ b/test/Interop/Cxx/static/inline-static-member-var-irgen.swift @@ -28,4 +28,4 @@ public func passingVarAsInout() { } // CHECK: define {{(protected |dllexport )?}}swiftcc void @"$s4main17passingVarAsInoutyyF"() -// CHECK: call swiftcc void @"$s4main11modifyInoutyys5Int32VzF"(ptr nocapture dereferenceable(4) @{{_ZN22WithInlineStaticMember12staticMemberE|"\?staticMember@WithInlineStaticMember@@2HA"}}) +// CHECK: call swiftcc void @"$s4main11modifyInoutyys5Int32VzF"(ptr captures(none) dereferenceable(4) @{{_ZN22WithInlineStaticMember12staticMemberE|"\?staticMember@WithInlineStaticMember@@2HA"}}) diff --git a/test/Interop/Cxx/static/static-var-irgen.swift b/test/Interop/Cxx/static/static-var-irgen.swift index f8d920ebd8cef..f7b44647fb031 100644 --- a/test/Interop/Cxx/static/static-var-irgen.swift +++ b/test/Interop/Cxx/static/static-var-irgen.swift @@ -85,7 +85,7 @@ public func passingVarAsInout() { modifyInout(&staticVar) } // CHECK: define {{.*}}void @"$s4main17passingVarAsInoutyyF"() -// CHECK: call swiftcc void @"$s4main11modifyInoutyys5Int32VzF"(ptr nocapture dereferenceable(4) @{{_ZL9staticVar|staticVar}}) +// CHECK: call swiftcc void @"$s4main11modifyInoutyys5Int32VzF"(ptr captures(none) dereferenceable(4) @{{_ZL9staticVar|staticVar}}) // CHECK: define internal void @_GLOBAL__sub_I__swift_imported_modules_() // CHECK: call void @{{__cxx_global_var_init|"\?\?__EstaticVarInit@@YAXXZ"}}() diff --git a/test/Interop/Cxx/stdlib/msvc-abi-use-vector-iterator.swift b/test/Interop/Cxx/stdlib/msvc-abi-use-vector-iterator.swift index daa43eeb78a59..d3a26f5b65b9a 100644 --- a/test/Interop/Cxx/stdlib/msvc-abi-use-vector-iterator.swift +++ b/test/Interop/Cxx/stdlib/msvc-abi-use-vector-iterator.swift @@ -5,7 +5,7 @@ import MsvcUseVecIt -// CHECK: call void @"?begin@?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QEBA?AV?$_Vector_const_iterator@V?$_Vector_val@U?$_Simple_types@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@std@@@std@@@2@XZ"(ptr {{.*}}, ptr noalias nocapture sret +// CHECK: call void @"?begin@?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QEBA?AV?$_Vector_const_iterator@V?$_Vector_val@U?$_Simple_types@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@std@@@std@@@2@XZ"(ptr {{.*}}, ptr noalias captures(none) sret func test() -> Bool { let result = f() diff --git a/test/Interop/Cxx/templates/mangling-irgen.swift b/test/Interop/Cxx/templates/mangling-irgen.swift index 3a5f1e8f349ef..d5d714652159d 100644 --- a/test/Interop/Cxx/templates/mangling-irgen.swift +++ b/test/Interop/Cxx/templates/mangling-irgen.swift @@ -4,12 +4,12 @@ import Mangling public func receiveInstantiation(_ i: inout WrappedMagicBool) {} -// CHECK: define {{(protected |dllexport )?}}swiftcc void @"$s4main20receiveInstantiationyySo0025MagicWrapperCBool_lsFCfibVzF"(ptr nocapture dereferenceable(1) %0) +// CHECK: define {{(protected |dllexport )?}}swiftcc void @"$s4main20receiveInstantiationyySo0025MagicWrapperCBool_lsFCfibVzF"(ptr captures(none) dereferenceable(1) %0) public func receiveInstantiation(_ i: inout WrappedMagicInt) {} // Don't forget to update manglings.txt when changing s4main20receiveInstantiationyySo34__CxxTemplateInst12MagicWrapperIiEVzF -// CHECK: define {{(protected |dllexport )?}}swiftcc void @"$s4main20receiveInstantiationyySo0024MagicWrapperCInt_npAIefbVzF"(ptr nocapture dereferenceable(1) %0) +// CHECK: define {{(protected |dllexport )?}}swiftcc void @"$s4main20receiveInstantiationyySo0024MagicWrapperCInt_npAIefbVzF"(ptr captures(none) dereferenceable(1) %0) public func returnInstantiation() -> WrappedMagicInt { return WrappedMagicInt() diff --git a/test/LLVMPasses/allocation-deletion.ll b/test/LLVMPasses/allocation-deletion.ll index 81d9b181dc576..c9db70bf7a6db 100644 --- a/test/LLVMPasses/allocation-deletion.ll +++ b/test/LLVMPasses/allocation-deletion.ll @@ -59,7 +59,7 @@ entry: ; trivial_alloc_eliminate2 - Show that we can eliminate an allocation with a ; destructor that does a retain on the 'self' object. @trivial_dtor_metadata2 = internal constant %swift.heapmetadata { ptr @trivial_dtor2, ptr null } -define internal i64 @trivial_dtor2(ptr nocapture %this) nounwind readonly { +define internal i64 @trivial_dtor2(ptr captures(none) %this) nounwind readonly { entry: %0 = getelementptr inbounds %swift.refcounted, ptr %this, i64 1, i32 0 store ptr inttoptr (i64 4 to ptr), ptr %0, align 8 diff --git a/test/SILOptimizer/devirt_witness_method_empty_conformance.swift b/test/SILOptimizer/devirt_witness_method_empty_conformance.swift index e8ea8e7959487..047493fcebc18 100644 --- a/test/SILOptimizer/devirt_witness_method_empty_conformance.swift +++ b/test/SILOptimizer/devirt_witness_method_empty_conformance.swift @@ -76,7 +76,7 @@ extension ApplyRegStruct { from space: PublicEnum, transform: RegStruct ) { transform.funcInStructAndProtAndExt(.case2, space: space) { -// CHECK-LABEL: define hidden swiftcc void @"$sSa39devirt_witness_method_empty_conformanceAA12PublicStructVRszlE14applyTransformyyF"(ptr nocapture {{.*}}swiftself dereferenceable +// CHECK-LABEL: define hidden swiftcc void @"$sSa39devirt_witness_method_empty_conformanceAA12PublicStructVRszlE14applyTransformyyF"(ptr captures(none) {{.*}}swiftself dereferenceable // CHECK-NEXT: entry // CHECK-NEXT: ret void applyTransform() diff --git a/test/SILOptimizer/eager_specialize.sil b/test/SILOptimizer/eager_specialize.sil index 3f4a290d927f6..71cd25f905b11 100644 --- a/test/SILOptimizer/eager_specialize.sil +++ b/test/SILOptimizer/eager_specialize.sil @@ -698,7 +698,7 @@ bb0(%0 : $*Self, %1 : $*Self, %2 : $@thick Self.Type): // Check that a specialization for _Trivial(32) uses direct loads and stores // instead of value witness functions to load and store the value of a generic type. -// CHECK-IRGEN-LABEL: define linkonce_odr hidden swiftcc void @"$s16eager_specialize18copyValueAndReturn_1sxx_xztlFxxxRlze31_lIetilr_Tp5"(ptr noalias nocapture sret(i32) %0, ptr noalias nocapture dereferenceable(4) %1, ptr nocapture dereferenceable(4) %2, ptr %S +// CHECK-IRGEN-LABEL: define linkonce_odr hidden swiftcc void @"$s16eager_specialize18copyValueAndReturn_1sxx_xztlFxxxRlze31_lIetilr_Tp5"(ptr noalias captures(none) sret(i32) %0, ptr noalias captures(none) dereferenceable(4) %1, ptr captures(none) dereferenceable(4) %2, ptr %S // CHECK-IRGEN: entry: // CHECK-IRGEN: %3 = load i32, ptr %2 // CHECK-IRGEN-NEXT: store i32 %3, ptr %0 @@ -707,7 +707,7 @@ bb0(%0 : $*Self, %1 : $*Self, %2 : $@thick Self.Type): // Check that a specialization for _Trivial(64) uses direct loads and stores // instead of value witness functions to load and store the value of a generic type. -// CHECK-IRGEN-LABEL: define linkonce_odr hidden swiftcc void @"$s16eager_specialize18copyValueAndReturn_1sxx_xztlFxxxRlze63_lIetilr_Tp5"(ptr noalias nocapture sret(i64) %0, ptr noalias nocapture dereferenceable(8) %1, ptr nocapture dereferenceable(8) %2, ptr %S +// CHECK-IRGEN-LABEL: define linkonce_odr hidden swiftcc void @"$s16eager_specialize18copyValueAndReturn_1sxx_xztlFxxxRlze63_lIetilr_Tp5"(ptr noalias captures(none) sret(i64) %0, ptr noalias captures(none) dereferenceable(8) %1, ptr captures(none) dereferenceable(8) %2, ptr %S // CHECK-IRGEN: entry: // CHECK-IRGEN: %3 = load i64, ptr %2 // CHECK-IRGEN-NEXT: store i64 %3, ptr %0 diff --git a/test/SILOptimizer/eager_specialize_ossa.sil b/test/SILOptimizer/eager_specialize_ossa.sil index 2ac721d8a6d96..03aa594364e83 100644 --- a/test/SILOptimizer/eager_specialize_ossa.sil +++ b/test/SILOptimizer/eager_specialize_ossa.sil @@ -886,7 +886,7 @@ bb0(%0 : $*Self, %1 : $*Self, %2 : $@thick Self.Type): // Check that a specialization for _Trivial(32) uses direct loads and stores // instead of value witness functions to load and store the value of a generic type. -// CHECK-IRGEN-LABEL: define linkonce_odr hidden swiftcc void @"$s16eager_specialize18copyValueAndReturn_1sxx_xztlFxxxRlze31_lIetilr_Tp5"(ptr noalias nocapture sret(i32) %0, ptr noalias nocapture dereferenceable(4) %1, ptr nocapture dereferenceable(4) %2, ptr %S +// CHECK-IRGEN-LABEL: define linkonce_odr hidden swiftcc void @"$s16eager_specialize18copyValueAndReturn_1sxx_xztlFxxxRlze31_lIetilr_Tp5"(ptr noalias captures(none) sret(i32) %0, ptr noalias captures(none) dereferenceable(4) %1, ptr captures(none) dereferenceable(4) %2, ptr %S // CHECK-IRGEN: entry: // CHECK-IRGEN: %3 = load i32, ptr %2 // CHECK-IRGEN-NEXT: store i32 %3, ptr %0 @@ -895,7 +895,7 @@ bb0(%0 : $*Self, %1 : $*Self, %2 : $@thick Self.Type): // Check that a specialization for _Trivial(64) uses direct loads and stores // instead of value witness functions to load and store the value of a generic type. -// CHECK-IRGEN-LABEL: define linkonce_odr hidden swiftcc void @"$s16eager_specialize18copyValueAndReturn_1sxx_xztlFxxxRlze63_lIetilr_Tp5"(ptr noalias nocapture sret(i64) %0, ptr noalias nocapture dereferenceable(8) %1, ptr nocapture dereferenceable(8) %2, ptr %S +// CHECK-IRGEN-LABEL: define linkonce_odr hidden swiftcc void @"$s16eager_specialize18copyValueAndReturn_1sxx_xztlFxxxRlze63_lIetilr_Tp5"(ptr noalias captures(none) sret(i64) %0, ptr noalias captures(none) dereferenceable(8) %1, ptr captures(none) dereferenceable(8) %2, ptr %S // CHECK-IRGEN: entry: // CHECK-IRGEN: %3 = load i64, ptr %2 // CHECK-IRGEN-NEXT: store i64 %3, ptr %0 From bb9fb7286e6ad06fa29cf494a38df1008e00a0e5 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Thu, 17 Apr 2025 20:12:45 +0100 Subject: [PATCH 03/40] LLVMPasses: Switch from obsoleted `llvm::IRHash` to `llvm::stable_hash` Per 1941c5180b91d792200d5e868d45c96e99bda35e (llvm-project). --- lib/LLVMPasses/LLVMMergeFunctions.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/LLVMPasses/LLVMMergeFunctions.cpp b/lib/LLVMPasses/LLVMMergeFunctions.cpp index 122c947df19d2..7f33a935d5676 100644 --- a/lib/LLVMPasses/LLVMMergeFunctions.cpp +++ b/lib/LLVMPasses/LLVMMergeFunctions.cpp @@ -258,7 +258,7 @@ class SwiftMergeFunctions { FunctionEntry *First; /// A very cheap hash, used to early exit if functions do not match. - llvm::IRHash Hash; + llvm::stable_hash Hash; public: // Note the hash is recalculated potentially multiple times, but it is cheap. @@ -714,7 +714,7 @@ bool SwiftMergeFunctions::runOnModule(Module &M) { // All functions in the module, ordered by hash. Functions with a unique // hash value are easily eliminated. - std::vector> HashedFuncs; + std::vector> HashedFuncs; for (Function &Func : M) { if (isEligibleFunction(&Func)) { @@ -722,10 +722,11 @@ bool SwiftMergeFunctions::runOnModule(Module &M) { } } - std::stable_sort( - HashedFuncs.begin(), HashedFuncs.end(), - [](const std::pair &a, - const std::pair &b) { return a.first < b.first; }); + std::stable_sort(HashedFuncs.begin(), HashedFuncs.end(), + [](const std::pair &a, + const std::pair &b) { + return a.first < b.first; + }); std::vector FuncEntryStorage; FuncEntryStorage.reserve(HashedFuncs.size()); From 3ef981621369588c9ff6c73fb124175862d8ca2a Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Thu, 17 Apr 2025 20:34:08 +0100 Subject: [PATCH 04/40] Adjust includes of moved LLVM header Per 2ae968a0d9fb61606b020e898d884c82dd0ed8b5 (llvm-project). --- include/swift/AST/IRGenOptions.h | 4 ++-- include/swift/Option/SanitizerOptions.h | 2 +- lib/IRGen/IRGen.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/swift/AST/IRGenOptions.h b/include/swift/AST/IRGenOptions.h index d05d7c96e51d8..998af7e62e88e 100644 --- a/include/swift/AST/IRGenOptions.h +++ b/include/swift/AST/IRGenOptions.h @@ -29,9 +29,9 @@ #include "llvm/IR/CallingConv.h" // FIXME: This include is just for llvm::SanitizerCoverageOptions. We should // split the header upstream so we don't include so much. -#include "llvm/Transforms/Instrumentation.h" -#include "llvm/Support/raw_ostream.h" #include "llvm/Support/VersionTuple.h" +#include "llvm/Support/raw_ostream.h" +#include "llvm/Transforms/Utils/Instrumentation.h" #include #include #include diff --git a/include/swift/Option/SanitizerOptions.h b/include/swift/Option/SanitizerOptions.h index faa394f39b072..ab7f3bbdb8776 100644 --- a/include/swift/Option/SanitizerOptions.h +++ b/include/swift/Option/SanitizerOptions.h @@ -20,7 +20,7 @@ #include "llvm/Option/ArgList.h" // FIXME: This include is just for llvm::SanitizerCoverageOptions. We should // split the header upstream so we don't include so much. -#include "llvm/Transforms/Instrumentation.h" +#include "llvm/Transforms/Utils/Instrumentation.h" namespace swift { class DiagnosticEngine; diff --git a/lib/IRGen/IRGen.cpp b/lib/IRGen/IRGen.cpp index 79de76923f69a..35b9dba2614cc 100644 --- a/lib/IRGen/IRGen.cpp +++ b/lib/IRGen/IRGen.cpp @@ -85,7 +85,6 @@ #include "llvm/Transforms/IPO.h" #include "llvm/Transforms/IPO/AlwaysInliner.h" #include "llvm/Transforms/IPO/ThinLTOBitcodeWriter.h" -#include "llvm/Transforms/Instrumentation.h" #include "llvm/Transforms/Instrumentation/AddressSanitizer.h" #include "llvm/Transforms/Instrumentation/InstrProfiling.h" #include "llvm/Transforms/Instrumentation/SanitizerCoverage.h" @@ -93,6 +92,7 @@ #include "llvm/Transforms/ObjCARC.h" #include "llvm/Transforms/Scalar.h" #include "llvm/Transforms/Scalar/DCE.h" +#include "llvm/Transforms/Utils/Instrumentation.h" #include "llvm/CodeGen/MachineOptimizationRemarkEmitter.h" #include "llvm/IR/DiagnosticInfo.h" From b71e689138e76451499c7c6e6a2be9388a3fab80 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Sun, 20 Apr 2025 04:57:27 +0100 Subject: [PATCH 05/40] Adjust includes of moved Clang headers Per 0d150db214e2aa13a825b563c7238e1243d61db1 (llvm-project). --- include/swift/Migrator/FixitApplyDiagnosticConsumer.h | 4 ++-- include/swift/Migrator/RewriteBufferEditsReceiver.h | 7 ++++--- lib/IDE/Utils.cpp | 6 +++--- lib/Migrator/APIDiffMigratorPass.cpp | 2 +- lib/Migrator/Migrator.cpp | 2 +- tools/SourceKit/lib/Support/ImmutableTextBuffer.cpp | 4 ++-- tools/swift-ide-test/swift-ide-test.cpp | 4 ++-- 7 files changed, 15 insertions(+), 14 deletions(-) diff --git a/include/swift/Migrator/FixitApplyDiagnosticConsumer.h b/include/swift/Migrator/FixitApplyDiagnosticConsumer.h index 4937a881b827d..ce5aebf58f5e9 100644 --- a/include/swift/Migrator/FixitApplyDiagnosticConsumer.h +++ b/include/swift/Migrator/FixitApplyDiagnosticConsumer.h @@ -21,7 +21,7 @@ #include "swift/Migrator/FixitFilter.h" #include "swift/Migrator/Migrator.h" #include "swift/Migrator/Replacement.h" -#include "clang/Rewrite/Core/RewriteBuffer.h" +#include "llvm/ADT/RewriteBuffer.h" #include "llvm/ADT/SmallSet.h" namespace swift { @@ -37,7 +37,7 @@ struct Replacement; class FixitApplyDiagnosticConsumer final : public DiagnosticConsumer, public FixitFilter { - clang::RewriteBuffer RewriteBuf; + llvm::RewriteBuffer RewriteBuf; /// The entire text of the input file. const StringRef Text; diff --git a/include/swift/Migrator/RewriteBufferEditsReceiver.h b/include/swift/Migrator/RewriteBufferEditsReceiver.h index 91c86d893bc6d..e9366ead711f5 100644 --- a/include/swift/Migrator/RewriteBufferEditsReceiver.h +++ b/include/swift/Migrator/RewriteBufferEditsReceiver.h @@ -16,7 +16,7 @@ #include "clang/Basic/SourceManager.h" #include "clang/Basic/SourceLocation.h" #include "clang/Edit/EditsReceiver.h" -#include "clang/Rewrite/Core/RewriteBuffer.h" +#include "llvm/ADT/RewriteBuffer.h" #include "llvm/ADT/StringRef.h" #include "llvm/Support/raw_ostream.h" @@ -26,12 +26,13 @@ namespace swift { namespace migrator { /// An EditsReceiver that collects edits from an EditedSource and directly -/// applies it to a clang::RewriteBuffer. +/// applies it to a llvm::RewriteBuffer. class RewriteBufferEditsReceiver final : public clang::edit::EditsReceiver { const clang::SourceManager &ClangSourceManager; const clang::FileID InputFileID; const StringRef InputText; - clang::RewriteBuffer RewriteBuf; + llvm::RewriteBuffer RewriteBuf; + public: RewriteBufferEditsReceiver(const clang::SourceManager &ClangSourceManager, const clang::FileID InputFileID, diff --git a/lib/IDE/Utils.cpp b/lib/IDE/Utils.cpp index 6dbb2fb7aa320..1b338aa62d593 100644 --- a/lib/IDE/Utils.cpp +++ b/lib/IDE/Utils.cpp @@ -20,7 +20,7 @@ #include "swift/Parse/Parser.h" #include "swift/Subsystems.h" #include "clang/AST/ASTContext.h" -#include "clang/Rewrite/Core/RewriteBuffer.h" +#include "llvm/ADT/RewriteBuffer.h" #include "llvm/ADT/STLExtras.h" #include "llvm/Support/Compiler.h" #include "llvm/Support/MemoryBuffer.h" @@ -782,11 +782,11 @@ accept(SourceManager &SM, RegionType Type, ArrayRef Replacements) { namespace { class ClangFileRewriterHelper { unsigned InterestedId; - clang::RewriteBuffer RewriteBuf; + llvm::RewriteBuffer RewriteBuf; bool HasChange; llvm::raw_ostream &OS; - void removeCommentLines(clang::RewriteBuffer &Buffer, StringRef Input, + void removeCommentLines(llvm::RewriteBuffer &Buffer, StringRef Input, StringRef LineHeader) { size_t Pos = 0; while (true) { diff --git a/lib/Migrator/APIDiffMigratorPass.cpp b/lib/Migrator/APIDiffMigratorPass.cpp index 627f5fb5c1367..b5626e6fad5bb 100644 --- a/lib/Migrator/APIDiffMigratorPass.cpp +++ b/lib/Migrator/APIDiffMigratorPass.cpp @@ -29,7 +29,7 @@ #include "clang/Basic/FileManager.h" #include "clang/Basic/SourceManager.h" #include "clang/Edit/EditedSource.h" -#include "clang/Rewrite/Core/RewriteBuffer.h" +#include "llvm/ADT/RewriteBuffer.h" #include "llvm/Support/FileSystem.h" using namespace swift; diff --git a/lib/Migrator/Migrator.cpp b/lib/Migrator/Migrator.cpp index 7549d14200480..034c056dc370a 100644 --- a/lib/Migrator/Migrator.cpp +++ b/lib/Migrator/Migrator.cpp @@ -21,7 +21,7 @@ #include "clang/Basic/FileManager.h" #include "clang/Basic/SourceManager.h" #include "clang/Edit/EditedSource.h" -#include "clang/Rewrite/Core/RewriteBuffer.h" +#include "llvm/ADT/RewriteBuffer.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/FileSystem.h" diff --git a/tools/SourceKit/lib/Support/ImmutableTextBuffer.cpp b/tools/SourceKit/lib/Support/ImmutableTextBuffer.cpp index 81a4623b1a93b..0ebf2619ba200 100644 --- a/tools/SourceKit/lib/Support/ImmutableTextBuffer.cpp +++ b/tools/SourceKit/lib/Support/ImmutableTextBuffer.cpp @@ -11,13 +11,13 @@ //===----------------------------------------------------------------------===// #include "SourceKit/Support/ImmutableTextBuffer.h" -#include "clang/Rewrite/Core/RewriteRope.h" +#include "llvm/ADT/RewriteRope.h" #include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/SourceMgr.h" using namespace SourceKit; using namespace llvm; -using clang::RewriteRope; +using llvm::RewriteRope; void ImmutableTextUpdate::anchor() {} diff --git a/tools/swift-ide-test/swift-ide-test.cpp b/tools/swift-ide-test/swift-ide-test.cpp index 8ddd310faba80..d7292c4f80149 100644 --- a/tools/swift-ide-test/swift-ide-test.cpp +++ b/tools/swift-ide-test/swift-ide-test.cpp @@ -53,7 +53,7 @@ #include "swift/Markup/Markup.h" #include "swift/Parse/ParseVersion.h" #include "swift/Sema/IDETypeChecking.h" -#include "clang/Rewrite/Core/RewriteBuffer.h" +#include "llvm/ADT/RewriteBuffer.h" #include "llvm/ADT/SmallString.h" #include "llvm/ADT/Statistic.h" #include "llvm/Support/CommandLine.h" @@ -2082,7 +2082,7 @@ static int doDumpImporterLookupTables(const CompilerInvocation &InitInvok, class StructureAnnotator : public ide::SyntaxModelWalker { SourceManager &SM; unsigned BufferID; - clang::RewriteBuffer RewriteBuf; + llvm::RewriteBuffer RewriteBuf; std::vector NodeStack; CharSourceRange LastPoppedNodeRange; From da47b58586f2b8006cdddbadec148b55f5377d6d Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Thu, 17 Apr 2025 21:30:59 +0100 Subject: [PATCH 06/40] Refactor `llvm::opt::GenericOptTable` subclasses after changes to LLVM Option library Per dd647e3e608ed0b2bac7c588d5859b80ef4a5976 (llvm-project). --- lib/DriverTool/swift_cache_tool_main.cpp | 14 ++++++++------ lib/Option/Options.cpp | 18 ++++++++++-------- .../tools/sourcekitd-test/TestOptions.cpp | 15 ++++++++------- 3 files changed, 26 insertions(+), 21 deletions(-) diff --git a/lib/DriverTool/swift_cache_tool_main.cpp b/lib/DriverTool/swift_cache_tool_main.cpp index be1fe4ce157b3..5855bc3d9de26 100644 --- a/lib/DriverTool/swift_cache_tool_main.cpp +++ b/lib/DriverTool/swift_cache_tool_main.cpp @@ -65,12 +65,13 @@ enum ID { #undef OPTION }; -#define PREFIX(NAME, VALUE) \ - constexpr llvm::StringLiteral NAME##_init[] = VALUE; \ - constexpr llvm::ArrayRef NAME( \ - NAME##_init, std::size(NAME##_init) - 1); +#define OPTTABLE_STR_TABLE_CODE #include "SwiftCacheToolOptions.inc" -#undef PREFIX +#undef OPTTABLE_STR_TABLE_CODE + +#define OPTTABLE_PREFIXES_TABLE_CODE +#include "SwiftCacheToolOptions.inc" +#undef OPTTABLE_PREFIXES_TABLE_CODE static const OptTable::Info InfoTable[] = { #define OPTION(...) LLVM_CONSTRUCT_OPT_INFO(__VA_ARGS__), @@ -80,7 +81,8 @@ static const OptTable::Info InfoTable[] = { class CacheToolOptTable : public llvm::opt::GenericOptTable { public: - CacheToolOptTable() : GenericOptTable(InfoTable) {} + CacheToolOptTable() + : GenericOptTable(OptionStrTable, OptionPrefixesTable, InfoTable) {} }; class SwiftCacheToolInvocation { diff --git a/lib/Option/Options.cpp b/lib/Option/Options.cpp index 6a159de3150ba..5a334e131bcc1 100644 --- a/lib/Option/Options.cpp +++ b/lib/Option/Options.cpp @@ -16,15 +16,16 @@ #include "llvm/Option/OptTable.h" #include "llvm/Option/Option.h" -using namespace swift::options; -using namespace llvm::opt; +#define OPTTABLE_STR_TABLE_CODE +#include "swift/Option/Options.inc" +#undef OPTTABLE_STR_TABLE_CODE -#define PREFIX(NAME, VALUE) \ - constexpr llvm::StringLiteral NAME##_init[] = VALUE; \ - constexpr llvm::ArrayRef NAME( \ - NAME##_init, std::size(NAME##_init) - 1); +#define OPTTABLE_PREFIXES_TABLE_CODE #include "swift/Option/Options.inc" -#undef PREFIX +#undef OPTTABLE_PREFIXES_TABLE_CODE + +using namespace swift::options; +using namespace llvm::opt; static const llvm::opt::GenericOptTable::Info InfoTable[] = { #define OPTION(...) LLVM_CONSTRUCT_OPT_INFO(__VA_ARGS__), @@ -36,7 +37,8 @@ namespace { class SwiftOptTable : public llvm::opt::GenericOptTable { public: - SwiftOptTable() : GenericOptTable(InfoTable) {} + SwiftOptTable() + : GenericOptTable(OptionStrTable, OptionPrefixesTable, InfoTable) {} }; } // end anonymous namespace diff --git a/tools/SourceKit/tools/sourcekitd-test/TestOptions.cpp b/tools/SourceKit/tools/sourcekitd-test/TestOptions.cpp index 14345dfbb40f6..90a696db11c73 100644 --- a/tools/SourceKit/tools/sourcekitd-test/TestOptions.cpp +++ b/tools/SourceKit/tools/sourcekitd-test/TestOptions.cpp @@ -35,13 +35,13 @@ enum Opt { #undef OPTION }; -// Create prefix string literals used in Options.td. -#define PREFIX(NAME, VALUE) \ - constexpr llvm::StringLiteral NAME##_init[] = VALUE; \ - constexpr llvm::ArrayRef NAME( \ - NAME##_init, std::size(NAME##_init) - 1); +#define OPTTABLE_STR_TABLE_CODE #include "Options.inc" -#undef PREFIX +#undef OPTTABLE_STR_TABLE_CODE + +#define OPTTABLE_PREFIXES_TABLE_CODE +#include "Options.inc" +#undef OPTTABLE_PREFIXES_TABLE_CODE // Create table mapping all options defined in Options.td. static const llvm::opt::OptTable::Info InfoTable[] = { @@ -53,7 +53,8 @@ static const llvm::opt::OptTable::Info InfoTable[] = { // Create OptTable class for parsing actual command line arguments class TestOptTable : public llvm::opt::GenericOptTable { public: - TestOptTable() : GenericOptTable(InfoTable) {} + TestOptTable() + : GenericOptTable(OptionStrTable, OptionPrefixesTable, InfoTable) {} }; } // end anonymous namespace From 7b9318fa848c1fcddb4a385db4758dcf8428e1f1 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Thu, 17 Apr 2025 22:11:01 +0100 Subject: [PATCH 07/40] Refactor uses of obsoleted `llvm::DenseMap::{FindAndConstruct,getOrInsertDefault}` Per 390b82dd4c485ec64cf8a6c52fb73e391792262e (llvm-project). --- include/swift/SILOptimizer/Analysis/Analysis.h | 14 +++++++------- lib/AST/RequirementMachine/RequirementLowering.cpp | 3 +-- lib/SILOptimizer/Analysis/ColdBlockInfo.cpp | 4 ++-- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/include/swift/SILOptimizer/Analysis/Analysis.h b/include/swift/SILOptimizer/Analysis/Analysis.h index a0647818b0418..ec6c729117198 100644 --- a/include/swift/SILOptimizer/Analysis/Analysis.h +++ b/include/swift/SILOptimizer/Analysis/Analysis.h @@ -231,19 +231,19 @@ class FunctionAnalysisBase : public SILAnalysis { // Check that the analysis can handle this function. verifyFunction(f); - auto &it = storage.FindAndConstruct(f); - if (!it.second) - it.second = newFunctionAnalysis(f); - return it.second.get(); + auto &value = storage[f]; + if (!value) + value = newFunctionAnalysis(f); + return value.get(); } virtual void forcePrecompute(SILFunction *f) override { // Check that the analysis can handle this function. verifyFunction(f); - auto &it = storage.FindAndConstruct(f); - if (!it.second) - it.second = newFunctionAnalysis(f); + auto &value = storage[f]; + if (!value) + value = newFunctionAnalysis(f); } /// Invalidate all information in this analysis. diff --git a/lib/AST/RequirementMachine/RequirementLowering.cpp b/lib/AST/RequirementMachine/RequirementLowering.cpp index 46319d3c338f3..a446a6d491fb3 100644 --- a/lib/AST/RequirementMachine/RequirementLowering.cpp +++ b/lib/AST/RequirementMachine/RequirementLowering.cpp @@ -856,7 +856,7 @@ void swift::rewriting::applyInverses( continue; } - auto state = inverses.getOrInsertDefault(canSubject); + auto &state = inverses[canSubject]; // Check if this inverse has already been seen. auto inverseKind = inverse.getKind(); @@ -864,7 +864,6 @@ void swift::rewriting::applyInverses( continue; state.insert(inverseKind); - inverses[canSubject] = state; } // Fast-path: if there are no valid inverses, then there are no requirements diff --git a/lib/SILOptimizer/Analysis/ColdBlockInfo.cpp b/lib/SILOptimizer/Analysis/ColdBlockInfo.cpp index f42fe7b60d449..9fde5f1ea0431 100644 --- a/lib/SILOptimizer/Analysis/ColdBlockInfo.cpp +++ b/lib/SILOptimizer/Analysis/ColdBlockInfo.cpp @@ -441,7 +441,7 @@ bool ColdBlockInfo::isCold(const SILBasicBlock *BB) const { } void ColdBlockInfo::resetToCold(const SILBasicBlock *BB) { - auto &entry = EnergyMap.getOrInsertDefault(BB); + auto &entry = EnergyMap[BB]; if (isColdEnergy(entry)) return; @@ -451,7 +451,7 @@ void ColdBlockInfo::resetToCold(const SILBasicBlock *BB) { } void ColdBlockInfo::set(const SILBasicBlock *BB, State::Temperature temp) { - auto &entry = EnergyMap.getOrInsertDefault(BB); + auto &entry = EnergyMap[BB]; if (entry.contains(temp)) return; From b301dfe2636d80b4b582bc5809e9d76ec8c5a7c9 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Thu, 17 Apr 2025 22:12:48 +0100 Subject: [PATCH 08/40] Basic: Rename symbol in bitfield macro to not collide with Clang Per 131acb07d814fabcc969dcaa63f4f352cd529267 (llvm-project). --- include/swift/AST/Expr.h | 8 ++++---- include/swift/Basic/InlineBitfield.h | 18 +++++++++--------- include/swift/SIL/MemAccessUtils.h | 20 +++++++++----------- 3 files changed, 22 insertions(+), 24 deletions(-) diff --git a/include/swift/AST/Expr.h b/include/swift/AST/Expr.h index 2d052da7ce819..7da99d35fef2c 100644 --- a/include/swift/AST/Expr.h +++ b/include/swift/AST/Expr.h @@ -154,12 +154,12 @@ class alignas(8) Expr : public ASTAllocated { Implicit : 1 ); - SWIFT_INLINE_BITFIELD_FULL(CollectionExpr, Expr, 64-NumExprBits, + SWIFT_INLINE_BITFIELD_FULL(CollectionExpr, Expr, 64-NumberOfExprBits, /// True if the type of this collection expr was inferred by the collection /// fallback type, like [Any]. IsTypeDefaulted : 1, /// Number of comma source locations. - NumCommas : 32 - 1 - NumExprBits, + NumCommas : 32 - 1 - NumberOfExprBits, /// Number of entries in the collection. If this is a DictionaryExpr, /// each entry is a Tuple with the key and value pair. NumSubExprs : 32 @@ -256,8 +256,8 @@ class alignas(8) Expr : public ASTAllocated { LitKind : 3 ); - SWIFT_INLINE_BITFIELD(AbstractClosureExpr, Expr, (16-NumExprBits)+16, - : 16 - NumExprBits, // Align and leave room for subclasses + SWIFT_INLINE_BITFIELD(AbstractClosureExpr, Expr, (16-NumberOfExprBits)+16, + : 16 - NumberOfExprBits, // Align and leave room for subclasses Discriminator : 16 ); diff --git a/include/swift/Basic/InlineBitfield.h b/include/swift/Basic/InlineBitfield.h index b41ae018d4edf..1378115aee012 100644 --- a/include/swift/Basic/InlineBitfield.h +++ b/include/swift/Basic/InlineBitfield.h @@ -41,7 +41,7 @@ namespace swift { uint64_t : 64 - (C); /* Better code gen */ \ } T; \ LLVM_PACKED_END \ - enum { Num##T##Bits = (C) }; \ + enum { NumberOf##T##Bits = (C) }; \ static_assert(sizeof(T##Bitfield) <= 8, "Bitfield overflow") /// Define an bitfield for type 'T' with parent class 'U' and 'C' bits used. @@ -49,11 +49,11 @@ namespace swift { LLVM_PACKED_START \ class T##Bitfield { \ friend class T; \ - uint64_t : Num##U##Bits, __VA_ARGS__; \ - uint64_t : 64 - (Num##U##Bits + (HC) + (C)); /* Better code gen */ \ + uint64_t : NumberOf##U##Bits, __VA_ARGS__; \ + uint64_t : 64 - (NumberOf##U##Bits + (HC) + (C)); /* Better code gen */ \ } T; \ LLVM_PACKED_END \ - enum { Num##T##Bits = Num##U##Bits + (C) }; \ + enum { NumberOf##T##Bits = NumberOf##U##Bits + (C) }; \ static_assert(sizeof(T##Bitfield) <= 8, "Bitfield overflow") #define SWIFT_INLINE_BITFIELD(T, U, C, ...) \ @@ -75,8 +75,8 @@ namespace swift { LLVM_PACKED_START \ class T##Bitfield { \ friend class T; \ - enum { NumPadBits = 64 - (Num##U##Bits + (C)) }; \ - uint64_t : Num##U##Bits, __VA_ARGS__; \ + enum { NumPadBits = 64 - (NumberOf##U##Bits + (C)) }; \ + uint64_t : NumberOf##U##Bits, __VA_ARGS__; \ } T; \ LLVM_PACKED_END \ static_assert(sizeof(T##Bitfield) <= 8, "Bitfield overflow") @@ -101,15 +101,15 @@ namespace swift { class T##Bitfield { \ template \ friend class T; \ - enum { NumPadBits = 64 - (Num##U##Bits + (C)) }; \ - uint64_t : Num##U##Bits, __VA_ARGS__; \ + enum { NumPadBits = 64 - (NumberOf##U##Bits + (C)) }; \ + uint64_t : NumberOf##U##Bits, __VA_ARGS__; \ } T; \ LLVM_PACKED_END \ static_assert(sizeof(T##Bitfield) <= 8, "Bitfield overflow") /// Define an empty bitfield for type 'T'. #define SWIFT_INLINE_BITFIELD_EMPTY(T, U) \ - enum { Num##T##Bits = Num##U##Bits } + enum { NumberOf##T##Bits = NumberOf##U##Bits } // XXX/HACK: templated max() doesn't seem to work in a bitfield size context. constexpr unsigned bitmax(unsigned a, unsigned b) { diff --git a/include/swift/SIL/MemAccessUtils.h b/include/swift/SIL/MemAccessUtils.h index 07a0002e37559..b16f5a21f02af 100644 --- a/include/swift/SIL/MemAccessUtils.h +++ b/include/swift/SIL/MemAccessUtils.h @@ -375,12 +375,12 @@ class AccessRepresentation { // Define bits for use in AccessStorageAnalysis. Each identified storage // object is mapped to one instance of this subclass. SWIFT_INLINE_BITFIELD_FULL(StorageAccessInfo, AccessRepresentation, - 64 - NumAccessRepresentationBits, + 64 - NumberOfAccessRepresentationBits, accessKind : NumSILAccessKindBits, noNestedConflict : 1, - storageIndex : 64 - (NumAccessRepresentationBits - + NumSILAccessKindBits - + 1)); + storageIndex : 64 - + (NumberOfAccessRepresentationBits + + NumSILAccessKindBits + 1)); // Define bits for use in the AccessEnforcementOpts pass. Each begin_access // in the function is mapped to one instance of this subclass. Reserve a @@ -390,13 +390,11 @@ class AccessRepresentation { // // `AccessRepresentation` refers to the AccessRepresentationBitfield defined // above, setting aside enough bits for common data. - SWIFT_INLINE_BITFIELD_FULL(AccessEnforcementOptsInfo, - AccessRepresentation, - 64 - NumAccessRepresentationBits, - seenNestedConflict : 1, - seenIdenticalStorage : 1, - beginAccessIndex : - 62 - NumAccessRepresentationBits); + SWIFT_INLINE_BITFIELD_FULL(AccessEnforcementOptsInfo, AccessRepresentation, + 64 - NumberOfAccessRepresentationBits, + seenNestedConflict : 1, seenIdenticalStorage : 1, + beginAccessIndex : 62 - + NumberOfAccessRepresentationBits); // Define data flow bits for use in the AccessEnforcementDom pass. Each // begin_access in the function is mapped to one instance of this subclass. From 661d087b281d23f751d55802cf7d9b7deca9a6c1 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Thu, 17 Apr 2025 23:03:44 +0100 Subject: [PATCH 09/40] AST: Refactor use of obsoleted `llvm::Intrinsic::lookupLLVMIntrinsicByName` Per f0297ae552e1e5aacafc1ed43968041994dc8a6e (llvm-project). --- lib/AST/Builtins.cpp | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/lib/AST/Builtins.cpp b/lib/AST/Builtins.cpp index 3b6c17bebbc76..da15f06f3fc74 100644 --- a/lib/AST/Builtins.cpp +++ b/lib/AST/Builtins.cpp @@ -2343,18 +2343,6 @@ bool swift::canBuiltinBeOverloadedForType(BuiltinValueKind ID, Type Ty) { return isBuiltinTypeOverloaded(Ty, OverloadedBuiltinKinds[unsigned(ID)]); } -/// Table of string intrinsic names indexed by enum value. -static const char *const IntrinsicNameTable[] = { - "not_intrinsic", -#define GET_INTRINSIC_NAME_TABLE -#include "llvm/IR/IntrinsicImpl.inc" -#undef GET_INTRINSIC_NAME_TABLE -}; - -#define GET_INTRINSIC_TARGET_DATA -#include "llvm/IR/IntrinsicImpl.inc" -#undef GET_INTRINSIC_TARGET_DATA - llvm::Intrinsic::ID swift::getLLVMIntrinsicID(StringRef InName) { using namespace llvm; @@ -2370,10 +2358,8 @@ llvm::Intrinsic::ID swift::getLLVMIntrinsicID(StringRef InName) { NameS.push_back(C == '_' ? '.' : C); const char *Name = NameS.c_str(); - ArrayRef NameTable(&IntrinsicNameTable[1], - TargetInfos[1].Offset); - int Idx = Intrinsic::lookupLLVMIntrinsicByName(NameTable, Name); - return static_cast(Idx + 1); + + return Intrinsic::lookupIntrinsicID(Name); } llvm::Intrinsic::ID From 81d194abaf9a0cc193b38926c9888f0dad346104 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Thu, 17 Apr 2025 23:05:55 +0100 Subject: [PATCH 10/40] AST: Conservatively handle new `llvm::Intrinsic::IITDescriptor::IITDescriptorKind` enum cases Per 5a1e16f6de26c21cdfae1de05bd075d57029a3e1 (llvm-project). --- lib/AST/Builtins.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/AST/Builtins.cpp b/lib/AST/Builtins.cpp index da15f06f3fc74..12a2bd26fe688 100644 --- a/lib/AST/Builtins.cpp +++ b/lib/AST/Builtins.cpp @@ -2454,6 +2454,9 @@ Type IntrinsicTypeDecoder::decodeImmediate() { case IITDescriptor::Subdivide4Argument: case IITDescriptor::PPCQuad: case IITDescriptor::AArch64Svcount: + case IITDescriptor::OneThirdVecArgument: + case IITDescriptor::OneFifthVecArgument: + case IITDescriptor::OneSeventhVecArgument: // These types cannot be expressed in swift yet. return Type(); From 547a8910c27416e21935f0fcd19965529eed1dc7 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Thu, 17 Apr 2025 23:29:55 +0100 Subject: [PATCH 11/40] AST, ClangImporter, IRGen: Conservatively handle new HLSL `clang::BuiltinType::Kind` enum case Per 52956b0f705499ae4a268d3629b402ecdc2cbbab (llvm-project). --- lib/AST/ClangTypeConverter.cpp | 4 ++++ lib/ClangImporter/ClangAdapter.cpp | 5 +++++ lib/ClangImporter/ImportType.cpp | 4 ++++ lib/IRGen/GenCall.cpp | 5 +++++ 4 files changed, 18 insertions(+) diff --git a/lib/AST/ClangTypeConverter.cpp b/lib/AST/ClangTypeConverter.cpp index 1b1848da354b0..7981fddfd6ebf 100644 --- a/lib/AST/ClangTypeConverter.cpp +++ b/lib/AST/ClangTypeConverter.cpp @@ -87,6 +87,10 @@ getClangBuiltinTypeFromKind(const clang::ASTContext &context, case clang::BuiltinType::Id: \ return context.SingletonId; #include "clang/Basic/AMDGPUTypes.def" +#define HLSL_INTANGIBLE_TYPE(Name, Id, SingletonId) \ + case clang::BuiltinType::Id: \ + return context.SingletonId; +#include "clang/Basic/HLSLIntangibleTypes.def" } // Not a valid BuiltinType. diff --git a/lib/ClangImporter/ClangAdapter.cpp b/lib/ClangImporter/ClangAdapter.cpp index f832a5af21f05..691eef5ae1d43 100644 --- a/lib/ClangImporter/ClangAdapter.cpp +++ b/lib/ClangImporter/ClangAdapter.cpp @@ -450,6 +450,11 @@ OmissionTypeName importer::getClangTypeNameForOmission(clang::ASTContext &ctx, #define AMDGPU_TYPE(Name, Id, ...) case clang::BuiltinType::Id: #include "clang/Basic/AMDGPUTypes.def" return OmissionTypeName(); + + // HLSL intangible builtin types that don't have Swift equivalents. +#define HLSL_INTANGIBLE_TYPE(Name, Id, ...) case clang::BuiltinType::Id: +#include "clang/Basic/HLSLIntangibleTypes.def" + return OmissionTypeName(); } } diff --git a/lib/ClangImporter/ImportType.cpp b/lib/ClangImporter/ImportType.cpp index 89921480a0a6a..58adbd18c9582 100644 --- a/lib/ClangImporter/ImportType.cpp +++ b/lib/ClangImporter/ImportType.cpp @@ -372,6 +372,10 @@ namespace { #include "clang/Basic/AMDGPUTypes.def" return Type(); + // HLSL intangible builtin types that don't have Swift equivalents. +#define HLSL_INTANGIBLE_TYPE(Name, Id, ...) case clang::BuiltinType::Id: +#include "clang/Basic/HLSLIntangibleTypes.def" + return Type(); } llvm_unreachable("Invalid BuiltinType."); diff --git a/lib/IRGen/GenCall.cpp b/lib/IRGen/GenCall.cpp index be7ada6d0ee73..eb046de34f752 100644 --- a/lib/IRGen/GenCall.cpp +++ b/lib/IRGen/GenCall.cpp @@ -1343,6 +1343,11 @@ namespace { #include "clang/Basic/AMDGPUTypes.def" llvm_unreachable("AMDGPU type in ABI lowering"); + // We should never see HLSL intangible types at all. +#define HLSL_INTANGIBLE_TYPE(Name, Id, ...) case clang::BuiltinType::Id: +#include "clang/Basic/HLSLIntangibleTypes.def" + llvm_unreachable("HLSL intangible type in ABI lowering"); + // Handle all the integer types as opaque values. #define BUILTIN_TYPE(Id, SingletonId) #define SIGNED_TYPE(Id, SingletonId) \ From 51648473af0fc71072ef63fdd1d910868f06a6e5 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Thu, 17 Apr 2025 23:31:46 +0100 Subject: [PATCH 12/40] AST, ClangImporter: Fix `AMDGPU_TYPE` clang macro definitions Per fe61dbf1d3350d11ab975e45f805f3bfe885b8b7 (llvm-project). --- lib/AST/ClangTypeConverter.cpp | 2 +- lib/ClangImporter/ImportType.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/AST/ClangTypeConverter.cpp b/lib/AST/ClangTypeConverter.cpp index 7981fddfd6ebf..c47d498dfe409 100644 --- a/lib/AST/ClangTypeConverter.cpp +++ b/lib/AST/ClangTypeConverter.cpp @@ -83,7 +83,7 @@ getClangBuiltinTypeFromKind(const clang::ASTContext &context, case clang::BuiltinType::Id: \ return context.SingletonId; #include "clang/Basic/WebAssemblyReferenceTypes.def" -#define AMDGPU_TYPE(Name, Id, SingletonId) \ +#define AMDGPU_TYPE(Name, Id, SingletonId, Width, Align) \ case clang::BuiltinType::Id: \ return context.SingletonId; #include "clang/Basic/AMDGPUTypes.def" diff --git a/lib/ClangImporter/ImportType.cpp b/lib/ClangImporter/ImportType.cpp index 58adbd18c9582..b1646367f6683 100644 --- a/lib/ClangImporter/ImportType.cpp +++ b/lib/ClangImporter/ImportType.cpp @@ -368,7 +368,8 @@ namespace { return Type(); // AMDGPU builtin types that don't have Swift equivalents. -#define AMDGPU_TYPE(Name, Id, SingletonId) case clang::BuiltinType::Id: +#define AMDGPU_TYPE(Name, Id, SingletonId, Width, Align) \ + case clang::BuiltinType::Id: #include "clang/Basic/AMDGPUTypes.def" return Type(); From 8d7066b6be6b6865661cdb522387838d33137602 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Fri, 18 Apr 2025 14:58:14 +0100 Subject: [PATCH 13/40] ClangImporter: Conservatively handle new `clang::TargetInfo::BuiltinVaListKind` enum case Per 2d6e7c2b359d4cafca8eaca4c9ed308a3a8fa6c1 (llvm-project). --- lib/ClangImporter/ImportDecl.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/ClangImporter/ImportDecl.cpp b/lib/ClangImporter/ImportDecl.cpp index 2b33b78852599..a51ed15d43f56 100644 --- a/lib/ClangImporter/ImportDecl.cpp +++ b/lib/ClangImporter/ImportDecl.cpp @@ -380,6 +380,7 @@ getSwiftStdlibType(const clang::TypedefNameDecl *D, case clang::TargetInfo::PNaClABIBuiltinVaList: case clang::TargetInfo::SystemZBuiltinVaList: case clang::TargetInfo::X86_64ABIBuiltinVaList: + case clang::TargetInfo::XtensaABIBuiltinVaList: return std::make_pair(Type(), ""); } break; From 17d4c1991a9b6d89973b01552ed6574c1c616f54 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Fri, 18 Apr 2025 15:15:01 +0100 Subject: [PATCH 14/40] ClangImporter: Conservatively adjust uses of some Clang APIs (parameter added) Per 08bda1cc6b0d2f1d31a89a76b5c154a11086c420 (llvm-project). --- lib/ClangImporter/ClangImporter.cpp | 3 ++- lib/ClangImporter/ImportDecl.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/ClangImporter/ClangImporter.cpp b/lib/ClangImporter/ClangImporter.cpp index 564dfbbdbf1fb..e25679a4cfcdd 100644 --- a/lib/ClangImporter/ClangImporter.cpp +++ b/lib/ClangImporter/ClangImporter.cpp @@ -7149,7 +7149,8 @@ ClangImporter::instantiateCXXClassTemplate( ctsd = clang::ClassTemplateSpecializationDecl::Create( decl->getASTContext(), decl->getTemplatedDecl()->getTagKind(), decl->getDeclContext(), decl->getTemplatedDecl()->getBeginLoc(), - decl->getLocation(), decl, arguments, nullptr); + decl->getLocation(), decl, arguments, /*StrictPackMatch*/ false, + nullptr); decl->AddSpecialization(ctsd, InsertPos); } diff --git a/lib/ClangImporter/ImportDecl.cpp b/lib/ClangImporter/ImportDecl.cpp index a51ed15d43f56..544edd9071be5 100644 --- a/lib/ClangImporter/ImportDecl.cpp +++ b/lib/ClangImporter/ImportDecl.cpp @@ -3302,7 +3302,7 @@ namespace { decl->getLocation(), const_cast(decl), clang::TemplateSpecializationKind::TSK_ImplicitInstantiation, - /*Complain*/ false); + /*Complain*/ false, /*PrimaryStrictPackMatch*/ false); // If the template can't be instantiated, bail. if (notInstantiated) return nullptr; From 5e0912508c98fa0b3d1b000cd3bed7d95681079a Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Fri, 18 Apr 2025 15:37:42 +0100 Subject: [PATCH 15/40] ClangImporter: Adjust use of `clang::tooling::dependencies::ModuleDeps::CASFileSystemRootID` (type changed) Per c3f10e5f166bb10afc091f21f549f0b1047701d0 (llvm-project). --- lib/ClangImporter/ClangModuleDependencyScanner.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ClangImporter/ClangModuleDependencyScanner.cpp b/lib/ClangImporter/ClangModuleDependencyScanner.cpp index 650473f7e5299..13a1a0913dcaf 100644 --- a/lib/ClangImporter/ClangModuleDependencyScanner.cpp +++ b/lib/ClangImporter/ClangModuleDependencyScanner.cpp @@ -256,7 +256,7 @@ ModuleDependencyVector ClangImporter::bridgeClangModuleDependencies( // CASFileSystemRootID. std::string RootID = clangModuleDep.CASFileSystemRootID - ? clangModuleDep.CASFileSystemRootID->toString() + ? clangModuleDep.CASFileSystemRootID.value() : ""; std::string IncludeTree = From 36b92178dbbf5bfb9c8bc000db30c8b13a5d2e04 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Fri, 18 Apr 2025 19:28:31 +0100 Subject: [PATCH 16/40] ClangImporter, Index: Refactor uses of obsoleted `clang::FileManager::getFile` Per 99b1a2ac078fe52300d270b3e77ddbababa8f951 (llvm-project). --- lib/ClangImporter/ClangImporter.cpp | 14 +++++++------- lib/Index/IndexRecord.cpp | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/ClangImporter/ClangImporter.cpp b/lib/ClangImporter/ClangImporter.cpp index e25679a4cfcdd..973630a3cf548 100644 --- a/lib/ClangImporter/ClangImporter.cpp +++ b/lib/ClangImporter/ClangImporter.cpp @@ -1815,14 +1815,14 @@ bool ClangImporter::importHeader(StringRef header, ModuleDecl *adapter, off_t expectedSize, time_t expectedModTime, StringRef cachedContents, SourceLoc diagLoc) { clang::FileManager &fileManager = Impl.Instance->getFileManager(); - auto headerFile = fileManager.getFile(header, /*OpenFile=*/true); + auto headerFile = fileManager.getOptionalFileRef(header, /*OpenFile=*/true); // Prefer importing the header directly if the header content matches by // checking size and mod time. This allows correct import if some no-modular // headers are already imported into clang importer. If mod time is zero, then // the module should be built from CAS and there is no mod time to verify. - if (headerFile && (*headerFile)->getSize() == expectedSize && + if (headerFile && headerFile->getSize() == expectedSize && (expectedModTime == 0 || - (*headerFile)->getModificationTime() == expectedModTime)) { + headerFile->getModificationTime() == expectedModTime)) { return importBridgingHeader(header, adapter, diagLoc, false, true); } @@ -1849,7 +1849,7 @@ bool ClangImporter::importBridgingHeader(StringRef header, ModuleDecl *adapter, } clang::FileManager &fileManager = Impl.Instance->getFileManager(); - auto headerFile = fileManager.getFile(header, /*OpenFile=*/true); + auto headerFile = fileManager.getOptionalFileRef(header, /*OpenFile=*/true); if (!headerFile) { Impl.diagnose(diagLoc, diag::bridging_header_missing, header); return true; @@ -1998,9 +1998,9 @@ std::string ClangImporter::getBridgingHeaderContents( return ""; } - if (auto fileInfo = fileManager.getFile(headerPath)) { - fileSize = (*fileInfo)->getSize(); - fileModTime = (*fileInfo)->getModificationTime(); + if (auto fileInfo = fileManager.getOptionalFileRef(headerPath)) { + fileSize = fileInfo->getSize(); + fileModTime = fileInfo->getModificationTime(); } return result; } diff --git a/lib/Index/IndexRecord.cpp b/lib/Index/IndexRecord.cpp index 559cfb72546b0..93b1059a20b67 100644 --- a/lib/Index/IndexRecord.cpp +++ b/lib/Index/IndexRecord.cpp @@ -602,7 +602,7 @@ static void emitTransitiveClangSymbolicInterfacesForSwiftModuleImports( case FileUnitKind::DWARFModule: case FileUnitKind::ClangModule: { auto *LFU = cast(FU); - if (auto F = fileMgr.getFile(LFU->getFilename())) { + if (fileMgr.getOptionalFileRef(LFU->getFilename())) { if (FU->getKind() == FileUnitKind::ClangModule) { auto clangModUnit = cast(LFU); if (auto clangMod = clangModUnit->getUnderlyingClangModule()) { From c8ea55c1004a746ab9455350abf1864d3f348b86 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Fri, 18 Apr 2025 23:33:56 +0100 Subject: [PATCH 17/40] ClangImporter, IDETool: Conservatively adjust uses of `clang::CompilerInstance::createDiagnostics` (parameter added) Per df9a14d7bbf1180e4f1474254c9d7ed6bcb4ce55 (llvm-project). --- lib/ClangImporter/ClangImporter.cpp | 22 ++++++++++++---------- lib/ClangImporter/ClangIncludePaths.cpp | 2 +- lib/IDETool/CompilerInvocation.cpp | 6 ++++-- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/lib/ClangImporter/ClangImporter.cpp b/lib/ClangImporter/ClangImporter.cpp index 973630a3cf548..788372c64fa52 100644 --- a/lib/ClangImporter/ClangImporter.cpp +++ b/lib/ClangImporter/ClangImporter.cpp @@ -977,8 +977,8 @@ bool ClangImporter::canReadPCH(StringRef PCHFilename) { CI.setInvocation(std::move(invocation)); CI.setTarget(&Impl.Instance->getTarget()); - CI.setDiagnostics( - &*clang::CompilerInstance::createDiagnostics(new clang::DiagnosticOptions())); + CI.setDiagnostics(&*clang::CompilerInstance::createDiagnostics( + Impl.Instance->getVirtualFileSystem(), new clang::DiagnosticOptions())); // Note: Reusing the file manager is safe; this is a component that's already // reused when building PCM files for the module cache. @@ -1155,7 +1155,7 @@ std::optional> ClangImporter::getClangCC1Arguments( new ClangDiagnosticConsumer(Impl, *tempDiagOpts, ctx.ClangImporterOpts.DumpClangDiagnostics); auto clangDiags = clang::CompilerInstance::createDiagnostics( - tempDiagOpts.get(), tempDiagClient, + *VFS, tempDiagOpts.get(), tempDiagClient, /*owned*/ true); // If using direct cc1 module build, use extra args to setup ClangImporter. @@ -1430,7 +1430,7 @@ ClangImporter::create(ASTContext &ctx, auto actualDiagClient = std::make_unique( importer->Impl, instance.getDiagnosticOpts(), importerOpts.DumpClangDiagnostics); - instance.createDiagnostics(actualDiagClient.release()); + instance.createDiagnostics(*VFS, actualDiagClient.release()); } // Set up the file manager. @@ -1942,13 +1942,14 @@ std::string ClangImporter::getBridgingHeaderContents( invocation->getPreprocessorOpts().resetNonModularOptions(); + clang::FileManager &fileManager = Impl.Instance->getFileManager(); + clang::CompilerInstance rewriteInstance( Impl.Instance->getPCHContainerOperations(), &Impl.Instance->getModuleCache()); rewriteInstance.setInvocation(invocation); - rewriteInstance.createDiagnostics(new clang::IgnoringDiagConsumer); - - clang::FileManager &fileManager = Impl.Instance->getFileManager(); + rewriteInstance.createDiagnostics(fileManager.getVirtualFileSystem(), + new clang::IgnoringDiagConsumer); rewriteInstance.setFileManager(&fileManager); rewriteInstance.createSourceManager(fileManager); rewriteInstance.setTarget(&Impl.Instance->getTarget()); @@ -2047,14 +2048,15 @@ ClangImporter::cloneCompilerInstanceForPrecompiling() { // Share the CASOption and the underlying CAS. invocation->setCASOption(Impl.Invocation->getCASOptsPtr()); + clang::FileManager &fileManager = Impl.Instance->getFileManager(); + auto clonedInstance = std::make_unique( Impl.Instance->getPCHContainerOperations(), &Impl.Instance->getModuleCache()); clonedInstance->setInvocation(std::move(invocation)); - clonedInstance->createDiagnostics(&Impl.Instance->getDiagnosticClient(), + clonedInstance->createDiagnostics(fileManager.getVirtualFileSystem(), + &Impl.Instance->getDiagnosticClient(), /*ShouldOwnClient=*/false); - - clang::FileManager &fileManager = Impl.Instance->getFileManager(); clonedInstance->setFileManager(&fileManager); clonedInstance->createSourceManager(fileManager); clonedInstance->setTarget(&Impl.Instance->getTarget()); diff --git a/lib/ClangImporter/ClangIncludePaths.cpp b/lib/ClangImporter/ClangIncludePaths.cpp index d2185fd152ded..82bdb353fa777 100644 --- a/lib/ClangImporter/ClangIncludePaths.cpp +++ b/lib/ClangImporter/ClangIncludePaths.cpp @@ -129,7 +129,7 @@ ClangImporter::createClangDriver( llvm::IntrusiveRefCntPtr vfs) { auto *silentDiagConsumer = new clang::DiagnosticConsumer(); auto clangDiags = clang::CompilerInstance::createDiagnostics( - new clang::DiagnosticOptions(), silentDiagConsumer); + *vfs, new clang::DiagnosticOptions(), silentDiagConsumer); clang::driver::Driver clangDriver(ClangImporterOpts.clangPath, LangOpts.Target.str(), *clangDiags, "clang LLVM compiler", vfs); diff --git a/lib/IDETool/CompilerInvocation.cpp b/lib/IDETool/CompilerInvocation.cpp index da49990804c78..986fb92a2f564 100644 --- a/lib/IDETool/CompilerInvocation.cpp +++ b/lib/IDETool/CompilerInvocation.cpp @@ -276,9 +276,11 @@ bool ide::initInvocationByClangArguments(ArrayRef ArgList, new clang::DiagnosticOptions() }; + const auto VFS = llvm::vfs::getRealFileSystem(); + clang::TextDiagnosticBuffer DiagBuf; llvm::IntrusiveRefCntPtr ClangDiags = - clang::CompilerInstance::createDiagnostics(DiagOpts.get(), &DiagBuf, + clang::CompilerInstance::createDiagnostics(*VFS, DiagOpts.get(), &DiagBuf, /*ShouldOwnClient=*/false); // Clang expects this to be like an actual command line. So we need to pass in @@ -356,7 +358,7 @@ bool ide::initInvocationByClangArguments(ArrayRef ArgList, if (!PPOpts.ImplicitPCHInclude.empty()) { clang::FileSystemOptions FileSysOpts; - clang::FileManager FileMgr(FileSysOpts); + clang::FileManager FileMgr(FileSysOpts, VFS); auto PCHContainerOperations = std::make_shared(); std::string HeaderFile = clang::ASTReader::getOriginalSourceFile( From 3eda91e51190146abd95b5adc61b33ecafe30be3 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Mon, 21 Apr 2025 05:40:33 +0100 Subject: [PATCH 18/40] ClangImporter, IRGen: Conservatively handle new `clang::HLSLAttributedResourceType` Per e00e9a3f8294c9b96cb0328bf136fab72aeec749 (llvm-project). --- lib/ClangImporter/ImportType.cpp | 10 ++++++++++ lib/IRGen/GenCall.cpp | 1 + 2 files changed, 11 insertions(+) diff --git a/lib/ClangImporter/ImportType.cpp b/lib/ClangImporter/ImportType.cpp index b1646367f6683..e6b65bf1431ac 100644 --- a/lib/ClangImporter/ImportType.cpp +++ b/lib/ClangImporter/ImportType.cpp @@ -422,6 +422,16 @@ namespace { return Type(); } + ImportResult VisitHLSLAttributedResourceType( + const clang::HLSLAttributedResourceType *type) { + Impl.addImportDiagnostic( + type, + Diagnostic(diag::unsupported_builtin_type, type->getTypeClassName()), + clang::SourceLocation()); + // FIXME: (?) HLSL types are not supported in Swift. + return Type(); + } + ImportResult VisitCountAttributedType(const clang::CountAttributedType *type) { return Visit(type->desugar()); diff --git a/lib/IRGen/GenCall.cpp b/lib/IRGen/GenCall.cpp index eb046de34f752..ad39c5d4bae2b 100644 --- a/lib/IRGen/GenCall.cpp +++ b/lib/IRGen/GenCall.cpp @@ -1213,6 +1213,7 @@ namespace { } case clang::Type::ArrayParameter: + case clang::Type::HLSLAttributedResource: llvm_unreachable("HLSL type in ABI lowering"); From 124608b481bed2aa075937b0c9215047b5f9bd6c Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Mon, 21 Apr 2025 05:48:43 +0100 Subject: [PATCH 19/40] IRGen: Conservatively handle new HLSL `clang::ParameterABI` enum cases Per 89fb8490a99e612f7a574e8678b21a90f689f5b4 (llvm-project). --- lib/IRGen/GenCall.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/IRGen/GenCall.cpp b/lib/IRGen/GenCall.cpp index ad39c5d4bae2b..56ba198bc3371 100644 --- a/lib/IRGen/GenCall.cpp +++ b/lib/IRGen/GenCall.cpp @@ -1690,6 +1690,9 @@ void SignatureExpansion::expandExternalSignatureTypes() { paramTI.getStorageType(), paramTI); break; } + case clang::ParameterABI::HLSLOut: + case clang::ParameterABI::HLSLInOut: + llvm_unreachable("not implemented"); } // If the coercion type is a struct which can be flattened, we need to From a090bfed1babdb7aa8ab1d017e0f14b3f99c5b9c Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Mon, 21 Apr 2025 06:14:45 +0100 Subject: [PATCH 20/40] ClangImporter: Refactor call to obsoleted `clang::ASTWriter::getMacroID` Per 5d62a79bb79fee20f92f26dc55fd78440b9945ca (llvm-project). --- lib/ClangImporter/SwiftLookupTable.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ClangImporter/SwiftLookupTable.cpp b/lib/ClangImporter/SwiftLookupTable.cpp index a367e6c487723..a5fd89a07329f 100644 --- a/lib/ClangImporter/SwiftLookupTable.cpp +++ b/lib/ClangImporter/SwiftLookupTable.cpp @@ -1107,7 +1107,8 @@ namespace { ids = StoredSingleEntry::forSerializedDecl( astWriter.getDeclID(decl).getRawValue()); } else if (auto *macro = mappedEntry.dyn_cast()) { - ids = StoredSingleEntry::forSerializedMacro(astWriter.getMacroID(macro)); + ids = StoredSingleEntry::forSerializedMacro( + astWriter.getMacroRef(macro, /*Name=*/nullptr)); } else { auto *moduleMacro = mappedEntry.get(); StoredSingleEntry::SerializationID nameID = From 5996a95c21149f0dab5840c452bb04d35bfa489c Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Mon, 21 Apr 2025 06:46:59 +0100 Subject: [PATCH 21/40] IRGen: Adjust uses of `clang::FieldDecl::getBitWidthValue` (parameter removed) Per cfe26358e3051755961fb1f3b46328dc2c326895 (llvm-project). --- lib/IRGen/GenStruct.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/IRGen/GenStruct.cpp b/lib/IRGen/GenStruct.cpp index f6b6647cfc6aa..2d1589f9c38da 100644 --- a/lib/IRGen/GenStruct.cpp +++ b/lib/IRGen/GenStruct.cpp @@ -1396,7 +1396,7 @@ class ClangRecordLowering { // Collect all of the following bitfields. unsigned bitStart = layout.getFieldOffset(clangField->getFieldIndex()); - unsigned bitEnd = bitStart + clangField->getBitWidthValue(ClangContext); + unsigned bitEnd = bitStart + clangField->getBitWidthValue(); while (cfi != cfe && (*cfi)->isBitField()) { clangField = *cfi++; @@ -1412,7 +1412,7 @@ class ClangRecordLowering { bitStart = nextStart; } - bitEnd = nextStart + clangField->getBitWidthValue(ClangContext); + bitEnd = nextStart + clangField->getBitWidthValue(); } addOpaqueBitField(bitStart, bitEnd); From 66a6df9a4445434bf54faf6d2c845bbc6d82e270 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Mon, 21 Apr 2025 07:12:47 +0100 Subject: [PATCH 22/40] IRGen: Conservatively adjust use of `llvm::DIBuilder::createObjectPointerType` (parameter added) Per a5fb2bbb2ad8488482843e2298fbe6f6a1d45bbd (llvm-project). --- lib/IRGen/IRGenDebugInfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/IRGen/IRGenDebugInfo.cpp b/lib/IRGen/IRGenDebugInfo.cpp index 7dbfeca194219..da8089ba56fec 100644 --- a/lib/IRGen/IRGenDebugInfo.cpp +++ b/lib/IRGen/IRGenDebugInfo.cpp @@ -1942,7 +1942,7 @@ class IRGenDebugInfoImpl : public IRGenDebugInfo { nullptr, PtrSize, 0, /* DWARFAddressSpace */ std::nullopt, MangledName); - return DBuilder.createObjectPointerType(PTy); + return DBuilder.createObjectPointerType(PTy, /*Implicit=*/false); } case TypeKind::BuiltinExecutor: { return createDoublePointerSizedStruct( From f0236c262f3692a7d216e8f265722613ccebb716 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Mon, 21 Apr 2025 07:27:38 +0100 Subject: [PATCH 23/40] DriverTool, IRGen: Adjust uses of `llvm::Module::setTargetTriple` (parameter type changed) Per 979c275097a642e9b96c6b0a12f013c831af3a6e (llvm-project). --- lib/DriverTool/swift_llvm_opt_main.cpp | 3 ++- lib/IRGen/IRGen.cpp | 4 ++-- lib/IRGen/IRGenModule.cpp | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/DriverTool/swift_llvm_opt_main.cpp b/lib/DriverTool/swift_llvm_opt_main.cpp index 00b97178dee56..37b757b82a0fb 100644 --- a/lib/DriverTool/swift_llvm_opt_main.cpp +++ b/lib/DriverTool/swift_llvm_opt_main.cpp @@ -174,7 +174,8 @@ int swift_llvm_opt_main(ArrayRef argv, void *MainAddr) { // If we are supposed to override the target triple, do so now. if (!options.TargetTriple.empty()) - M->setTargetTriple(llvm::Triple::normalize(options.TargetTriple)); + M->setTargetTriple( + llvm::Triple(llvm::Triple::normalize(options.TargetTriple))); // Figure out what stream we are supposed to write to... std::unique_ptr Out; diff --git a/lib/IRGen/IRGen.cpp b/lib/IRGen/IRGen.cpp index 35b9dba2614cc..723725a29f7e7 100644 --- a/lib/IRGen/IRGen.cpp +++ b/lib/IRGen/IRGen.cpp @@ -1169,8 +1169,8 @@ static void embedBitcode(llvm::Module *M, const IRGenOptions &Opts) static void initLLVMModule(const IRGenModule &IGM, SILModule &SIL) { auto *Module = IGM.getModule(); assert(Module && "Expected llvm:Module for IR generation!"); - - Module->setTargetTriple(IGM.Triple.str()); + + Module->setTargetTriple(IGM.Triple); if (IGM.Context.LangOpts.SDKVersion) { if (Module->getSDKVersion().empty()) diff --git a/lib/IRGen/IRGenModule.cpp b/lib/IRGen/IRGenModule.cpp index 5a00d2ecbb492..c0078f2024b27 100644 --- a/lib/IRGen/IRGenModule.cpp +++ b/lib/IRGen/IRGenModule.cpp @@ -2438,7 +2438,7 @@ bool swift::writeEmptyOutputFilesFor( auto *clangImporter = static_cast( Context.getClangModuleLoader()); llvmModule->setTargetTriple( - clangImporter->getTargetInfo().getTargetOpts().Triple); + llvm::Triple(clangImporter->getTargetInfo().getTargetOpts().Triple)); // Add LLVM module flags. auto &clangASTContext = clangImporter->getClangASTContext(); From 4e972c0e75906f3f03dfacdaffbe87941dc8e547 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Mon, 21 Apr 2025 08:07:43 +0100 Subject: [PATCH 24/40] IRGen: Adjust uses of `llvm::BasicBlock::getFirstNonPHIOrDbg` (return type changed) Per 81d18ad86419fc612c7071e888d11aa923eaeb8a (llvm-project). --- lib/IRGen/IRGenDebugInfo.cpp | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/lib/IRGen/IRGenDebugInfo.cpp b/lib/IRGen/IRGenDebugInfo.cpp index da8089ba56fec..b872a8d859726 100644 --- a/lib/IRGen/IRGenDebugInfo.cpp +++ b/lib/IRGen/IRGenDebugInfo.cpp @@ -3853,19 +3853,23 @@ void IRGenDebugInfoImpl::emitDbgIntrinsic( } // Insert a dbg.value at the current insertion point. - if (isa(Storage) && !Var->getArg() && - ParentBlock->getFirstNonPHIOrDbg()) - // SelectionDAGISel only generates debug info for a dbg.value - // that is associated with a llvm::Argument if either its !DIVariable - // is marked as argument or there is no non-debug intrinsic instruction - // before it. So In the case of associating a llvm::Argument with a - // non-argument debug variable -- usually via a !DIExpression -- we - // need to make sure that dbg.value is before any non-phi / no-dbg - // instruction. - DBuilder.insertDbgValueIntrinsic(Storage, Var, Expr, DL, - ParentBlock->getFirstNonPHIOrDbg()); - else - DBuilder.insertDbgValueIntrinsic(Storage, Var, Expr, DL, ParentBlock); + if (isa(Storage) && !Var->getArg()) { + const auto InsertPt = ParentBlock->getFirstNonPHIOrDbg(); + if (InsertPt != ParentBlock->end()) { + // SelectionDAGISel only generates debug info for a dbg.value + // that is associated with a llvm::Argument if either its !DIVariable + // is marked as argument or there is no non-debug intrinsic instruction + // before it. So In the case of associating a llvm::Argument with a + // non-argument debug variable -- usually via a !DIExpression -- we + // need to make sure that dbg.value is before any non-phi / no-dbg + // instruction. + DBuilder.insertDbgValueIntrinsic(Storage, Var, Expr, DL, &*InsertPt); + + return; + } + } + + DBuilder.insertDbgValueIntrinsic(Storage, Var, Expr, DL, ParentBlock); } void IRGenDebugInfoImpl::emitGlobalVariableDeclaration( From e124bca3e11edc3154b52e095dcbc4269730aabe Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Mon, 21 Apr 2025 08:12:00 +0100 Subject: [PATCH 25/40] IRGen: Adjust uses of `llvm::DIBuilder::insertDbgValueIntrinsic` (parameter type changed) Per 1083ec647f16314bcc9af8c4d6b11f50d288bca6 (llvm-project). --- lib/IRGen/IRGenDebugInfo.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/IRGen/IRGenDebugInfo.cpp b/lib/IRGen/IRGenDebugInfo.cpp index b872a8d859726..8553bddf7b7dd 100644 --- a/lib/IRGen/IRGenDebugInfo.cpp +++ b/lib/IRGen/IRGenDebugInfo.cpp @@ -3863,13 +3863,13 @@ void IRGenDebugInfoImpl::emitDbgIntrinsic( // non-argument debug variable -- usually via a !DIExpression -- we // need to make sure that dbg.value is before any non-phi / no-dbg // instruction. - DBuilder.insertDbgValueIntrinsic(Storage, Var, Expr, DL, &*InsertPt); + DBuilder.insertDbgValueIntrinsic(Storage, Var, Expr, DL, InsertPt); return; } } - DBuilder.insertDbgValueIntrinsic(Storage, Var, Expr, DL, ParentBlock); + DBuilder.insertDbgValueIntrinsic(Storage, Var, Expr, DL, ParentBlock->end()); } void IRGenDebugInfoImpl::emitGlobalVariableDeclaration( From d15a148d097bd5cf8da91f7b031b0eb0fd2547e4 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Mon, 21 Apr 2025 20:03:28 +0100 Subject: [PATCH 26/40] IRGen: Conservatively adjust uses of `llvm::PassBuilder::registerOptimizerLastEPCallback` (lambda parameter added) Per 390300d9f41df6ad71f0f4196ef4885d4bd5dc48 (llvm-project). --- lib/IRGen/IRGen.cpp | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/lib/IRGen/IRGen.cpp b/lib/IRGen/IRGen.cpp index 723725a29f7e7..e57c08d2db75f 100644 --- a/lib/IRGen/IRGen.cpp +++ b/lib/IRGen/IRGen.cpp @@ -342,7 +342,8 @@ void swift::performLLVMOptimizations(const IRGenOptions &Opts, FPM.addPass(SwiftARCOptPass()); }); PB.registerOptimizerLastEPCallback([&](ModulePassManager &MPM, - OptimizationLevel Level) { + OptimizationLevel Level, + llvm::ThinOrFullLTOPhase) { if (Level != OptimizationLevel::O0) MPM.addPass(createModuleToFunctionPassAdaptor(SwiftARCContractPass())); if (Level == OptimizationLevel::O0) @@ -357,7 +358,8 @@ void swift::performLLVMOptimizations(const IRGenOptions &Opts, if (Opts.Sanitizers & SanitizerKind::Address) { PB.registerOptimizerLastEPCallback([&](ModulePassManager &MPM, - OptimizationLevel Level) { + OptimizationLevel Level, + llvm::ThinOrFullLTOPhase) { AddressSanitizerOptions ASOpts; ASOpts.CompileKernel = false; ASOpts.Recover = bool(Opts.SanitizersWithRecoveryInstrumentation & @@ -376,17 +378,19 @@ void swift::performLLVMOptimizations(const IRGenOptions &Opts, } if (Opts.Sanitizers & SanitizerKind::Thread) { - PB.registerOptimizerLastEPCallback( - [&](ModulePassManager &MPM, OptimizationLevel Level) { - MPM.addPass(ModuleThreadSanitizerPass()); - MPM.addPass(createModuleToFunctionPassAdaptor(ThreadSanitizerPass())); - }); + PB.registerOptimizerLastEPCallback([&](ModulePassManager &MPM, + OptimizationLevel Level, + llvm::ThinOrFullLTOPhase) { + MPM.addPass(ModuleThreadSanitizerPass()); + MPM.addPass(createModuleToFunctionPassAdaptor(ThreadSanitizerPass())); + }); } if (Opts.SanitizeCoverage.CoverageType != llvm::SanitizerCoverageOptions::SCK_None) { PB.registerOptimizerLastEPCallback([&](ModulePassManager &MPM, - OptimizationLevel Level) { + OptimizationLevel Level, + llvm::ThinOrFullLTOPhase) { std::vector allowlistFiles; std::vector ignorelistFiles; MPM.addPass(SanitizerCoveragePass(Opts.SanitizeCoverage, @@ -395,14 +399,15 @@ void swift::performLLVMOptimizations(const IRGenOptions &Opts, } if (RunSwiftSpecificLLVMOptzns && !Opts.DisableLLVMMergeFunctions) { - PB.registerOptimizerLastEPCallback( - [&](ModulePassManager &MPM, OptimizationLevel Level) { - if (Level != OptimizationLevel::O0) { - const PointerAuthSchema &schema = Opts.PointerAuth.FunctionPointers; - unsigned key = (schema.isEnabled() ? schema.getKey() : 0); - MPM.addPass(SwiftMergeFunctionsPass(schema.isEnabled(), key)); - } - }); + PB.registerOptimizerLastEPCallback([&](ModulePassManager &MPM, + OptimizationLevel Level, + llvm::ThinOrFullLTOPhase) { + if (Level != OptimizationLevel::O0) { + const PointerAuthSchema &schema = Opts.PointerAuth.FunctionPointers; + unsigned key = (schema.isEnabled() ? schema.getKey() : 0); + MPM.addPass(SwiftMergeFunctionsPass(schema.isEnabled(), key)); + } + }); } if (Opts.GenerateProfile) { From c950146889760d6eca3682fabb3492f5d0f19d19 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Mon, 21 Apr 2025 20:43:37 +0100 Subject: [PATCH 27/40] IRGen: Adjust use of `llvm::PassBuilder::buildO0DefaultPipeline` (parameter type changed) Per 5445edb5d6667333f829f03932c2fc6a607e8306 (llvm-project). --- lib/IRGen/IRGen.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/IRGen/IRGen.cpp b/lib/IRGen/IRGen.cpp index e57c08d2db75f..b9580fba1f112 100644 --- a/lib/IRGen/IRGen.cpp +++ b/lib/IRGen/IRGen.cpp @@ -429,7 +429,13 @@ void swift::performLLVMOptimizations(const IRGenOptions &Opts, bool isThinLTO = Opts.LLVMLTOKind == IRGenLLVMLTOKind::Thin; bool isFullLTO = Opts.LLVMLTOKind == IRGenLLVMLTOKind::Full; if (!Opts.shouldOptimize() || Opts.DisableLLVMOptzns) { - MPM = PB.buildO0DefaultPipeline(level, isFullLTO || isThinLTO); + auto phase = llvm::ThinOrFullLTOPhase::None; + if (isFullLTO) { + phase = llvm::ThinOrFullLTOPhase::FullLTOPreLink; + } else if (isThinLTO) { + phase = llvm::ThinOrFullLTOPhase::ThinLTOPreLink; + } + MPM = PB.buildO0DefaultPipeline(level, phase); } else if (isThinLTO) { MPM = PB.buildThinLTOPreLinkDefaultPipeline(level); } else if (isFullLTO) { From 0c509f6891cc35a2892cc7a7d13de80617a403aa Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Mon, 21 Apr 2025 22:09:03 +0100 Subject: [PATCH 28/40] Immediate: Adjust uses of `llvm::jitlink::Symbol::{get,set}Name` (type signature changed) Per 2ccf7ed277df28651b94bbee9fccefdf22fb074f (llvm-project). --- lib/Immediate/SwiftMaterializationUnit.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/Immediate/SwiftMaterializationUnit.cpp b/lib/Immediate/SwiftMaterializationUnit.cpp index 7203a8ab141c8..0465188f2b270 100644 --- a/lib/Immediate/SwiftMaterializationUnit.cpp +++ b/lib/Immediate/SwiftMaterializationUnit.cpp @@ -197,11 +197,11 @@ renameFunctionBodies(llvm::orc::MaterializationResponsibility &MR, if (!Sym->hasName() || !Sym->isCallable()) continue; - if (ToRename.count(Sym->getName())) { - // FIXME: Get rid of the temporary when Swift's llvm-project is - // updated to LLVM 17. - auto NewName = G.allocateCString(Twine(mangle(Sym->getName()))); - Sym->setName({NewName.data(), NewName.size() - 1}); + const StringRef Name = *Sym->getName(); + + if (ToRename.count(Name)) { + auto NewName = G.intern(mangle(Name)); + Sym->setName(NewName); } } } From 657f5028fb45991569d6f58770e3edb0196ec500 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Thu, 24 Apr 2025 18:20:41 +0100 Subject: [PATCH 29/40] SILGen, SILOptimizer: Fix assertion failures in `llvm::APInt` ctor Constructing an unsigned 1-bit `APInt` with a value of -1 now hits an assertion. Previously, the value would just be masked to become 1. Fix this by constructing 1-bit `BuiltinIntegerType` literals with a value of 1 instead of -1. --- lib/SILGen/SILGenDecl.cpp | 9 ++++----- lib/SILOptimizer/LoopTransforms/BoundsCheckOpts.cpp | 6 +++--- lib/SILOptimizer/Mandatory/DefiniteInitialization.cpp | 2 +- lib/SILOptimizer/Transforms/SimplifyCFG.cpp | 4 ++-- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/lib/SILGen/SILGenDecl.cpp b/lib/SILGen/SILGenDecl.cpp index cde0970462de2..ad708d95c2491 100644 --- a/lib/SILGen/SILGenDecl.cpp +++ b/lib/SILGen/SILGenDecl.cpp @@ -1995,12 +1995,11 @@ void SILGenFunction::emitStmtCondition(StmtCondition Cond, JumpDest FalseDest, emitOSVersionRangeCheck(loc, versionRange.value(), isMacCatalyst); if (availability->isUnavailability()) { // If this is an unavailability check, invert the result - // by emitting a call to Builtin.xor_Int1(lhs, -1). + // by emitting a call to Builtin.xor_Int1(lhs, 1). SILType i1 = SILType::getBuiltinIntegerType(1, getASTContext()); - SILValue minusOne = B.createIntegerLiteral(loc, i1, -1); - booleanTestValue = - B.createBuiltinBinaryFunction(loc, "xor", i1, i1, - {booleanTestValue, minusOne}); + SILValue one = B.createIntegerLiteral(loc, i1, 1); + booleanTestValue = B.createBuiltinBinaryFunction( + loc, "xor", i1, i1, {booleanTestValue, one}); } } break; diff --git a/lib/SILOptimizer/LoopTransforms/BoundsCheckOpts.cpp b/lib/SILOptimizer/LoopTransforms/BoundsCheckOpts.cpp index 0e6802be83382..46e8c289f18b0 100644 --- a/lib/SILOptimizer/LoopTransforms/BoundsCheckOpts.cpp +++ b/lib/SILOptimizer/LoopTransforms/BoundsCheckOpts.cpp @@ -558,7 +558,7 @@ static SILValue getSub(SILLocation Loc, SILValue Val, unsigned SubVal, SmallVector Args(1, Val); Args.push_back(B.createIntegerLiteral(Loc, Val->getType(), SubVal)); Args.push_back(B.createIntegerLiteral( - Loc, SILType::getBuiltinIntegerType(1, B.getASTContext()), -1)); + Loc, SILType::getBuiltinIntegerType(1, B.getASTContext()), 1)); auto *AI = B.createBuiltinBinaryFunctionWithOverflow( Loc, "ssub_with_overflow", Args); @@ -570,7 +570,7 @@ static SILValue getAdd(SILLocation Loc, SILValue Val, unsigned AddVal, SmallVector Args(1, Val); Args.push_back(B.createIntegerLiteral(Loc, Val->getType(), AddVal)); Args.push_back(B.createIntegerLiteral( - Loc, SILType::getBuiltinIntegerType(1, B.getASTContext()), -1)); + Loc, SILType::getBuiltinIntegerType(1, B.getASTContext()), 1)); auto *AI = B.createBuiltinBinaryFunctionWithOverflow( Loc, "sadd_with_overflow", Args); @@ -1342,7 +1342,7 @@ BoundsCheckOpts::findAndOptimizeInductionVariables(SILLoop *loop) { if (isComparisonKnownTrue(builtin, *ivar)) { if (!trueVal) trueVal = builder.createIntegerLiteral(builtin->getLoc(), - builtin->getType(), -1); + builtin->getType(), 1); builtin->replaceAllUsesWith(trueVal); changed = true; continue; diff --git a/lib/SILOptimizer/Mandatory/DefiniteInitialization.cpp b/lib/SILOptimizer/Mandatory/DefiniteInitialization.cpp index a385a2475d442..65cfe2b47537d 100644 --- a/lib/SILOptimizer/Mandatory/DefiniteInitialization.cpp +++ b/lib/SILOptimizer/Mandatory/DefiniteInitialization.cpp @@ -2976,7 +2976,7 @@ static SILValue testAllControlVariableBits(SILLocation Loc, if (IVType->getFixedWidth() == 1) return CondVal; - SILValue AllBitsSet = B.createIntegerLiteral(Loc, CondVal->getType(), -1); + SILValue AllBitsSet = B.createIntegerLiteral(Loc, CondVal->getType(), 1); if (!CmpEqFn.get()) CmpEqFn = getBinaryFunction("cmp_eq", CondVal->getType(), B.getASTContext()); diff --git a/lib/SILOptimizer/Transforms/SimplifyCFG.cpp b/lib/SILOptimizer/Transforms/SimplifyCFG.cpp index 95a835cb07a14..0ce619a37ef84 100644 --- a/lib/SILOptimizer/Transforms/SimplifyCFG.cpp +++ b/lib/SILOptimizer/Transforms/SimplifyCFG.cpp @@ -304,7 +304,7 @@ static SILValue createValueForEdge(SILInstruction *UserInst, if (auto *CBI = dyn_cast(DominatingTerminator)) return Builder.createIntegerLiteral( - CBI->getLoc(), CBI->getCondition()->getType(), EdgeIdx == 0 ? -1 : 0); + CBI->getLoc(), CBI->getCondition()->getType(), EdgeIdx == 0 ? 1 : 0); auto *SEI = cast(DominatingTerminator); auto *DstBlock = SEI->getSuccessors()[EdgeIdx].getBB(); @@ -1480,7 +1480,7 @@ static SILValue invertExpectAndApplyTo(SILBuilder &Builder, if (!IL) return V; SILValue NegatedExpectedValue = Builder.createIntegerLiteral( - IL->getLoc(), Args[1]->getType(), IL->getValue() == 0 ? -1 : 0); + IL->getLoc(), Args[1]->getType(), IL->getValue() == 0 ? 1 : 0); return Builder.createBuiltin(BI->getLoc(), BI->getName(), BI->getType(), {}, {V, NegatedExpectedValue}); } From 906a2fa6f4dd5b2d37aa40f8e5090acd2538adcf Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Fri, 25 Apr 2025 20:43:18 +0100 Subject: [PATCH 30/40] ClangImporter: Fix potential null deref of file system --- lib/ClangImporter/ClangImporter.cpp | 6 +++--- lib/ClangImporter/ClangIncludePaths.cpp | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/ClangImporter/ClangImporter.cpp b/lib/ClangImporter/ClangImporter.cpp index 788372c64fa52..44d55ab9a0826 100644 --- a/lib/ClangImporter/ClangImporter.cpp +++ b/lib/ClangImporter/ClangImporter.cpp @@ -1139,6 +1139,8 @@ ClangImporter::getClangDriverArguments(ASTContext &ctx, bool ignoreClangTarget) std::optional> ClangImporter::getClangCC1Arguments( ASTContext &ctx, llvm::IntrusiveRefCntPtr VFS, bool ignoreClangTarget) { + ASSERT(VFS && "Expected non-null file system"); + std::unique_ptr CI; // Set up a temporary diagnostic client to report errors from parsing the @@ -1240,9 +1242,7 @@ std::optional> ClangImporter::getClangCC1Arguments( // to missing files and report the error that clang would throw manually. // rdar://77516546 is tracking that the clang importer should be more // resilient and provide a module even if there were building it. - auto TempVFS = clang::createVFSFromCompilerInvocation( - *CI, *clangDiags, - VFS ? VFS : Impl.SwiftContext.SourceMgr.getFileSystem()); + auto TempVFS = clang::createVFSFromCompilerInvocation(*CI, *clangDiags, VFS); std::vector FilteredModuleMapFiles; for (auto ModuleMapFile : CI->getFrontendOpts().ModuleMapFiles) { diff --git a/lib/ClangImporter/ClangIncludePaths.cpp b/lib/ClangImporter/ClangIncludePaths.cpp index 82bdb353fa777..0bcb3e4e88e7b 100644 --- a/lib/ClangImporter/ClangIncludePaths.cpp +++ b/lib/ClangImporter/ClangIncludePaths.cpp @@ -127,9 +127,12 @@ std::pair vfs) { + + auto diagVFS = vfs ? vfs : llvm::vfs::getRealFileSystem(); + auto *silentDiagConsumer = new clang::DiagnosticConsumer(); auto clangDiags = clang::CompilerInstance::createDiagnostics( - *vfs, new clang::DiagnosticOptions(), silentDiagConsumer); + *diagVFS, new clang::DiagnosticOptions(), silentDiagConsumer); clang::driver::Driver clangDriver(ClangImporterOpts.clangPath, LangOpts.Target.str(), *clangDiags, "clang LLVM compiler", vfs); From 442825d9de10037931006cd5ddc54118cd101b30 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Wed, 30 Apr 2025 21:45:43 +0100 Subject: [PATCH 31/40] [rebranch] IRGen: Fix omission in hash computation after switching API Issue introduced by 0d2d6cb8a06d90bbb1567222ce87d566e62e1fd3. `llvm::getPointerAuthStableSipHash` produces the combined result of the obsoleted `clang::CodeGen::computeStableStringHash` and our `getDiscriminatorForHash`, so we no longer need to call both. --- lib/IRGen/GenPointerAuth.cpp | 40 +++++++++++++++--------------------- 1 file changed, 16 insertions(+), 24 deletions(-) diff --git a/lib/IRGen/GenPointerAuth.cpp b/lib/IRGen/GenPointerAuth.cpp index 42b78ecc01bbe..b28db161be422 100644 --- a/lib/IRGen/GenPointerAuth.cpp +++ b/lib/IRGen/GenPointerAuth.cpp @@ -325,16 +325,10 @@ PointerAuthInfo::getOtherDiscriminator(IRGenModule &IGM, llvm_unreachable("bad kind"); } -static llvm::ConstantInt *getDiscriminatorForHash(IRGenModule &IGM, - uint64_t rawHash) { - uint16_t reducedHash = (rawHash % 0xFFFF) + 1; - return llvm::ConstantInt::get(IGM.Int64Ty, reducedHash); -} - static llvm::ConstantInt *getDiscriminatorForString(IRGenModule &IGM, StringRef string) { - uint64_t rawHash = llvm::getPointerAuthStableSipHash(string); - return getDiscriminatorForHash(IGM, rawHash); + return llvm::ConstantInt::get(IGM.Int64Ty, + llvm::getPointerAuthStableSipHash(string)); } static std::string mangle(AssociatedTypeDecl *assocType) { @@ -571,7 +565,8 @@ static void hashStringForFunctionType(IRGenModule &IGM, CanSILFunctionType type, } } -static uint64_t getTypeHash(IRGenModule &IGM, CanSILFunctionType type) { +static llvm::ConstantInt *getTypeDiscriminator(IRGenModule &IGM, + CanSILFunctionType type) { // The hash we need to do here ignores: // - thickness, so that we can promote thin-to-thick without rehashing; // - error results, so that we can promote nonthrowing-to-throwing @@ -591,10 +586,11 @@ static uint64_t getTypeHash(IRGenModule &IGM, CanSILFunctionType type) { hashStringForFunctionType( IGM, type, Out, genericSig.getCanonicalSignature().getGenericEnvironment()); - return llvm::getPointerAuthStableSipHash(Out.str()); + return getDiscriminatorForString(IGM, Out.str()); } -static uint64_t getYieldTypesHash(IRGenModule &IGM, CanSILFunctionType type) { +static llvm::ConstantInt * +getCoroutineYieldTypesDiscriminator(IRGenModule &IGM, CanSILFunctionType type) { SmallString<32> buffer; llvm::raw_svector_ostream out(buffer); auto genericSig = type->getInvocationGenericSignature(); @@ -630,7 +626,7 @@ static uint64_t getYieldTypesHash(IRGenModule &IGM, CanSILFunctionType type) { out << ":"; } - return llvm::getPointerAuthStableSipHash(out.str()); + return getDiscriminatorForString(IGM, out.str()); } llvm::ConstantInt * @@ -650,8 +646,7 @@ PointerAuthEntity::getTypeDiscriminator(IRGenModule &IGM) const { llvm::ConstantInt *&cache = IGM.getPointerAuthCaches().Types[fnType]; if (cache) return cache; - auto hash = getTypeHash(IGM, fnType); - cache = getDiscriminatorForHash(IGM, hash); + cache = ::getTypeDiscriminator(IGM, fnType); return cache; } @@ -668,15 +663,6 @@ PointerAuthEntity::getTypeDiscriminator(IRGenModule &IGM) const { llvm_unreachable("invalid representation"); }; - auto getCoroutineYieldTypesDiscriminator = [&](CanSILFunctionType fnType) { - llvm::ConstantInt *&cache = IGM.getPointerAuthCaches().Types[fnType]; - if (cache) return cache; - - auto hash = getYieldTypesHash(IGM, fnType); - cache = getDiscriminatorForHash(IGM, hash); - return cache; - }; - switch (StoredKind) { case Kind::None: case Kind::Special: @@ -688,7 +674,13 @@ PointerAuthEntity::getTypeDiscriminator(IRGenModule &IGM) const { case Kind::CoroutineYieldTypes: { auto fnType = Storage.get(StoredKind); - return getCoroutineYieldTypesDiscriminator(fnType); + + llvm::ConstantInt *&cache = IGM.getPointerAuthCaches().Types[fnType]; + if (cache) + return cache; + + cache = getCoroutineYieldTypesDiscriminator(IGM, fnType); + return cache; } case Kind::CanSILFunctionType: { From df229ca665e1ead3ae0449c41cdbb11b6bd0ccd4 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Tue, 29 Apr 2025 21:09:50 +0100 Subject: [PATCH 32/40] [rebranch][test] IRGen: Adjust `icmp` check that is now marked `samesign` Per b7db403e701029c801fd990dceeb219de9fb800c (llvm-project). --- test/IRGen/annotated_cond_fail.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/IRGen/annotated_cond_fail.swift b/test/IRGen/annotated_cond_fail.swift index bb754384aa3c9..ef50e578426da 100644 --- a/test/IRGen/annotated_cond_fail.swift +++ b/test/IRGen/annotated_cond_fail.swift @@ -19,7 +19,7 @@ public func test(_ a: [Int], _ i: Int) -> Int { // CHECK: [[SIZE_ADDR:%.*]] = getelementptr // CHECK: [[SIZE:%.*]] = load i64, ptr [[SIZE_ADDR]] -// CHECK: [[C1:%.*]] = icmp ult i64 [[IDX]], [[SIZE]] +// CHECK: [[C1:%.*]] = icmp samesign ult i64 [[IDX]], [[SIZE]] // CHECK: br i1 [[C1]], {{.*}}!annotation ![[ARRAY_INDEX_OUT_OF_BOUNDS]] From b7b60b760ec470bb00fbc730a45e104c60bc6019 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Tue, 29 Apr 2025 21:53:35 +0100 Subject: [PATCH 33/40] [rebranch][test] IRGen: Adjust some `icmp` checks that swapped arguments --- test/IRGen/integer-comparison.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/IRGen/integer-comparison.swift b/test/IRGen/integer-comparison.swift index ac7d4677ce13a..d5052c461cf4c 100644 --- a/test/IRGen/integer-comparison.swift +++ b/test/IRGen/integer-comparison.swift @@ -4,11 +4,11 @@ func f(_ x: Int, _ y: UInt32) -> Bool { x < y } // CHECK-LABEL: define {{.*}} @"$s4main1fySbSi_s6UInt32VtF"(i64 %0, i32 %1) // CHECK: %2 = zext i32 %1 to i64 -// CHECK-NEXT: %3 = icmp sgt i64 %2, %0 +// CHECK-NEXT: %3 = icmp slt i64 %0, %2 // CHECK-NEXT: ret i1 %3 func g(_ x: UInt32, _ y: Int) -> Bool { x < y } // CHECK-LABEL: define {{.*}} @"$s4main1gySbs6UInt32V_SitF"(i32 %0, i64 %1) // CHECK: %2 = zext i32 %0 to i64 -// CHECK-NEXT: %3 = icmp slt i64 %2, %1 +// CHECK-NEXT: %3 = icmp sgt i64 %1, %2 // CHECK-NEXT: ret i1 %3 From b6b1b067be366b3f115e9f65cceaa2e7985a0b81 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Thu, 8 May 2025 09:56:58 +0100 Subject: [PATCH 34/40] [rebranch][test] LLVMPasses, IRGen: Switch some remaining tests from `nocapture` to `captures(none)` Per 29441e4f5fa5f5c7709f7cf180815ba97f611297 (llvm-project). --- test/IRGen/argument_attrs.sil | 6 +++--- test/LLVMPasses/allocation-deletion.ll | 4 ++-- test/LLVMPasses/basic.ll | 2 +- test/LLVMPasses/contract.ll | 4 ++-- test/LLVMPasses/crash.ll | 2 +- test/LLVMPasses/disable_llvm_optzns.ll | 2 +- test/LLVMPasses/missing_runtime_declarations.ll | 6 +++--- test/LLVMPasses/release_motion_landingpad.ll | 2 +- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/test/IRGen/argument_attrs.sil b/test/IRGen/argument_attrs.sil index 905842f443816..bba5ed69b1869 100644 --- a/test/IRGen/argument_attrs.sil +++ b/test/IRGen/argument_attrs.sil @@ -16,7 +16,7 @@ entry(%1 : $*Builtin.Int32, %2 : $*Builtin.Int32, %3 : $*Builtin.Int32, %4 : $Hu return undef : $() } -// CHECK-LABEL: declare{{( dllimport)?}} swiftcc void @arguments_in_decl(ptr captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(40), ptr noalias, ptr noalias nocapture, ptr) +// CHECK-LABEL: declare{{( dllimport)?}} swiftcc void @arguments_in_decl(ptr captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(40), ptr noalias, ptr noalias captures(none), ptr) sil @arguments_in_decl : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> () // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @arguments_in_def_out(ptr noalias captures(none) sret({{.*}}) %0, ptr captures(none) dereferenceable(4) %1, ptr noalias captures(none) dereferenceable(4) %2, ptr noalias captures(none) dereferenceable(4) %3, ptr noalias captures(none) dereferenceable(40) %4, ptr noalias %5, ptr noalias captures(none) %6, ptr %T) @@ -31,7 +31,7 @@ entry(%0 : $*Builtin.Int32, %1 : $*Builtin.Int32, %2 : $*Builtin.Int32, %3 : $*B return undef : $() } -// CHECK-LABEL: declare{{( dllimport)?}} swiftcc void @arguments_in_decl_out(ptr noalias captures(none) sret({{.*}}), ptr captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(40), ptr noalias, ptr noalias nocapture, ptr) +// CHECK-LABEL: declare{{( dllimport)?}} swiftcc void @arguments_in_decl_out(ptr noalias captures(none) sret({{.*}}), ptr captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(40), ptr noalias, ptr noalias captures(none), ptr) sil @arguments_in_decl_out : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> @out Builtin.Int32 // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @arguments_in_def_huge_ret(ptr noalias captures(none) sret({{.*}}V) %0, ptr captures(none) dereferenceable(4) %1, ptr noalias captures(none) dereferenceable(4) %2, ptr noalias captures(none) dereferenceable(4) %3, ptr noalias captures(none) dereferenceable(40) %4, ptr noalias %5, ptr noalias captures(none) %6, ptr %T) @@ -46,7 +46,7 @@ entry(%1 : $*Builtin.Int32, %2 : $*Builtin.Int32, %3 : $*Builtin.Int32, %4 : $Hu return %y : $Huge } -// CHECK-LABEL: declare{{( dllimport)?}} swiftcc void @arguments_in_decl_huge_ret(ptr noalias captures(none) sret({{.*}}), ptr captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(40), ptr noalias, ptr noalias nocapture, ptr) +// CHECK-LABEL: declare{{( dllimport)?}} swiftcc void @arguments_in_decl_huge_ret(ptr noalias captures(none) sret({{.*}}), ptr captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(40), ptr noalias, ptr noalias captures(none), ptr) sil @arguments_in_decl_huge_ret : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> Huge diff --git a/test/LLVMPasses/allocation-deletion.ll b/test/LLVMPasses/allocation-deletion.ll index c9db70bf7a6db..3dc2ebb2ad3f7 100644 --- a/test/LLVMPasses/allocation-deletion.ll +++ b/test/LLVMPasses/allocation-deletion.ll @@ -7,7 +7,7 @@ target triple = "x86_64-apple-macosx10.9" %swift.heapmetadata = type { ptr, ptr } declare ptr @swift_allocObject(ptr , i64, i64) nounwind -declare void @swift_release(ptr nocapture) +declare void @swift_release(ptr captures(none)) declare void @swift_retain(ptr ) nounwind declare { i64, i64, i64 } @swift_retainAndReturnThree(ptr , i64, i64 , i64 ) @@ -36,7 +36,7 @@ entry: ; trivial_alloc_eliminate1 - Show that we can eliminate an allocation with a ; trivial destructor. @trivial_dtor_metadata = internal constant %swift.heapmetadata { ptr @trivial_dtor, ptr null } -define internal i64 @trivial_dtor(ptr nocapture) nounwind readonly { +define internal i64 @trivial_dtor(ptr captures(none)) nounwind readonly { entry: %1 = getelementptr inbounds %swift.refcounted, ptr %0, i64 1 %length = load i64, ptr %1, align 8 diff --git a/test/LLVMPasses/basic.ll b/test/LLVMPasses/basic.ll index be8b54b3e16dc..f53e1f9fc66a1 100644 --- a/test/LLVMPasses/basic.ll +++ b/test/LLVMPasses/basic.ll @@ -16,7 +16,7 @@ declare void @swift_unknownObjectRelease(ptr) declare ptr @llvm.objc.retain(ptr) declare void @llvm.objc.release(ptr) declare ptr @swift_allocObject(ptr , i64, i64) nounwind -declare void @swift_release(ptr nocapture) +declare void @swift_release(ptr captures(none)) declare ptr @swift_retain(ptr returned) nounwind declare ptr @swift_bridgeObjectRetain(ptr) declare void @swift_bridgeObjectRelease(ptr) diff --git a/test/LLVMPasses/contract.ll b/test/LLVMPasses/contract.ll index d5081e5c9e3f9..23c05a02096b3 100644 --- a/test/LLVMPasses/contract.ll +++ b/test/LLVMPasses/contract.ll @@ -10,9 +10,9 @@ target triple = "x86_64-apple-macosx10.9" declare ptr @swift_allocObject(ptr , i64, i64) nounwind declare ptr @swift_bridgeObjectRetain(ptr) declare void @swift_bridgeObjectRelease(ptr ) -declare void @swift_release(ptr nocapture) +declare void @swift_release(ptr captures(none)) declare ptr @swift_retain(ptr ) nounwind -declare void @swift_unknownObjectRelease(ptr nocapture) +declare void @swift_unknownObjectRelease(ptr captures(none)) declare ptr @swift_unknownObjectRetain(ptr ) nounwind declare void @__swift_fixLifetime(ptr) declare void @noread_user(ptr) readnone diff --git a/test/LLVMPasses/crash.ll b/test/LLVMPasses/crash.ll index 020ce65262495..1aa748c1a9254 100644 --- a/test/LLVMPasses/crash.ll +++ b/test/LLVMPasses/crash.ll @@ -8,7 +8,7 @@ target triple = "x86_64-apple-macosx10.9" declare { ptr, i64, ptr } @_Tsop1pFT3lhsNs6String3rhsS__S_(ptr, i64, ptr, ptr, i64, ptr) declare { ptr, i64, ptr } @_TNs6String24convertFromStringLiteralFT3valp_S_(ptr) -declare void @swift_release(ptr nocapture) +declare void @swift_release(ptr captures(none)) @0 = private unnamed_addr constant [3 x i8] c"So\00" diff --git a/test/LLVMPasses/disable_llvm_optzns.ll b/test/LLVMPasses/disable_llvm_optzns.ll index e71f22ae88a5f..c0a4ba020c4bd 100644 --- a/test/LLVMPasses/disable_llvm_optzns.ll +++ b/test/LLVMPasses/disable_llvm_optzns.ll @@ -16,7 +16,7 @@ declare void @swift_unknownObjectRelease(ptr) declare ptr @llvm.objc.retain(ptr) declare void @llvm.objc.release(ptr) declare ptr @swift_allocObject(ptr , i64, i64) nounwind -declare void @swift_release(ptr nocapture) +declare void @swift_release(ptr captures(none)) declare ptr @swift_retain(ptr returned) nounwind declare ptr @swift_bridgeObjectRetain(ptr) declare void @swift_bridgeObjectRelease(ptr) diff --git a/test/LLVMPasses/missing_runtime_declarations.ll b/test/LLVMPasses/missing_runtime_declarations.ll index 3b5c20414afc0..f20263bc8472f 100644 --- a/test/LLVMPasses/missing_runtime_declarations.ll +++ b/test/LLVMPasses/missing_runtime_declarations.ll @@ -3,11 +3,11 @@ target datalayout = "e-p:64:64:64-S128-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f16:16:16-f32:32:32-f64:64:64-f128:128:128-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64" target triple = "x86_64-apple-macosx10.9" -; CHECK: declare void @swift_bridgeObjectRelease(ptr nocapture) +; CHECK: declare void @swift_bridgeObjectRelease(ptr captures(none)) %a = type opaque -declare void @swift_bridgeObjectRelease(ptr nocapture) -declare ptr @swift_bridgeObjectRetain(ptr nocapture) +declare void @swift_bridgeObjectRelease(ptr captures(none)) +declare ptr @swift_bridgeObjectRetain(ptr captures(none)) ; CHECK-LABEL: define void @testcase1(ptr %0) { ; CHECK: entry: diff --git a/test/LLVMPasses/release_motion_landingpad.ll b/test/LLVMPasses/release_motion_landingpad.ll index 3a3c5ae4045f9..f6bee19d82dc5 100644 --- a/test/LLVMPasses/release_motion_landingpad.ll +++ b/test/LLVMPasses/release_motion_landingpad.ll @@ -3,7 +3,7 @@ target datalayout = "e-p:64:64:64-S128-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f16:16:16-f32:32:32-f64:64:64-f128:128:128-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64" target triple = "x86_64-apple-macosx10.9" -declare void @swift_release(ptr nocapture) +declare void @swift_release(ptr captures(none)) declare void @swift_retain(ptr) nounwind declare ptr @_Znwm(i64) declare i32 @__gxx_personality_v0(...) From 00c93349ca5279f4c2bea222c411119531cf6a08 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Thu, 8 May 2025 14:28:12 +0100 Subject: [PATCH 35/40] [rebranch] Partially revert "IRGen, LLVMPasses: Switch from obsoleted `nocapture` to `captures(none)`" This reverts most test changes in commit f93aba0770e7ff73997d3afed2c1c50a765b2e05. These changes will be done a bit differenty on main instead: https://github.com/swiftlang/swift/pull/81375. --- .../IRGen/differentiable_function.sil | 4 +- test/DebugInfo/ErrorVar.swift | 2 +- ...tributed_actor_accessor_thunks_32bit.swift | 14 +- ...tributed_actor_accessor_thunks_64bit.swift | 2 +- test/IRGen/abi_v7k.swift | 4 +- test/IRGen/abitypes_objc.swift | 34 ++-- test/IRGen/access_markers.sil | 4 +- test/IRGen/async_dynamic_replacement.swift | 2 +- test/IRGen/big_types_corner_cases.sil | 28 +-- test/IRGen/big_types_corner_cases.swift | 38 ++-- test/IRGen/big_types_corner_cases_tiny.swift | 2 +- test/IRGen/big_types_tests.sil | 2 +- test/IRGen/builtin_pack_length.swift | 2 +- test/IRGen/builtins.swift | 18 +- test/IRGen/c_layout.sil | 8 +- test/IRGen/casts.sil | 2 +- test/IRGen/class_field_other_module.swift | 4 +- ...ormances_class_with_defaulted_method.swift | 2 +- test/IRGen/coroutine_accessors.swift | 4 +- ...outine_accessors_backdeploy_async_56.swift | 2 +- ...outine_accessors_backdeploy_async_57.swift | 2 +- test/IRGen/dependent_reabstraction.swift | 2 +- test/IRGen/enum.sil | 42 ++-- test/IRGen/enum_derived.swift | 4 +- test/IRGen/enum_future.sil | 42 ++-- test/IRGen/enum_resilience.swift | 2 +- test/IRGen/errors.sil | 6 +- test/IRGen/existentials_objc.sil | 4 +- test/IRGen/extern_c_abitypes.swift | 12 +- test/IRGen/fixlifetime.sil | 4 +- test/IRGen/function_param_convention.sil | 2 +- test/IRGen/function_types.sil | 4 +- test/IRGen/generic_casts.swift | 4 +- test/IRGen/generic_metatypes.swift | 2 +- test/IRGen/generic_metatypes_future.swift | 2 +- test/IRGen/generic_ternary.swift | 2 +- test/IRGen/indexing.sil | 6 +- test/IRGen/indirect_argument.sil | 36 ++-- test/IRGen/indirect_return.swift | 2 +- test/IRGen/inout_noalias.sil | 2 +- test/IRGen/lazy_multi_file.swift | 2 +- test/IRGen/lifetime.sil | 2 +- .../moveonly_split_module_source_deinit.swift | 2 +- test/IRGen/moveonly_value_functions.swift | 6 +- .../moveonly_value_functions_onone.swift | 8 +- test/IRGen/objc_block_storage.sil | 10 +- test/IRGen/objc_class_export.swift | 4 +- .../objc_generic_protocol_conformance.swift | 2 +- test/IRGen/objc_simd.sil | 6 +- test/IRGen/objc_structs.swift | 10 +- test/IRGen/objc_super.swift | 2 +- test/IRGen/partial_apply.sil | 20 +- test/IRGen/partial_apply_coro.sil | 56 ++--- test/IRGen/partial_apply_generic.swift | 2 +- test/IRGen/pre_specialize.swift | 9 +- test/IRGen/protocol_accessor_multifile.swift | 2 +- test/IRGen/protocol_resilience.sil | 10 +- test/IRGen/protocol_resilience_thunks.swift | 4 +- test/IRGen/same_type_constraints.swift | 2 +- test/IRGen/select_enum.sil | 2 +- test/IRGen/sil_generic_witness_methods.swift | 2 +- test/IRGen/sil_witness_methods.sil | 8 +- test/IRGen/sil_witness_tables.swift | 4 +- test/IRGen/struct_resilience.swift | 8 +- test/IRGen/struct_with_resilient_type.swift | 2 +- test/IRGen/typed_throws.sil | 24 +-- test/IRGen/typed_throws.swift | 8 +- test/IRGen/typed_throws_abi.swift | 192 +++++++++--------- test/IRGen/typed_throws_thunks.swift | 16 +- .../typelayout_based_value_witness.swift | 4 +- test/IRGen/unconditional_checked_cast.sil | 2 +- test/IRGen/witness_method.sil | 4 +- test/IRGen/yield_once_big.sil | 6 +- test/IRGen/yield_once_indirect.sil | 2 +- ...ional_conformance_basic_conformances.swift | 8 +- ...onformance_basic_conformances_future.swift | 8 +- .../conditional_conformance_subclass.swift | 4 +- ...ditional_conformance_subclass_future.swift | 4 +- .../conditional_conformance_with_assoc.swift | 4 +- ...tional_conformance_with_assoc_future.swift | 4 +- .../Interop/Cxx/class/method/inreg-sret.swift | 4 +- .../class/protocol-conformance-irgen.swift | 2 +- .../Cxx/class/returns-large-class-irgen.swift | 2 +- .../Cxx/extern-var/extern-var-irgen.swift | 2 +- .../inline-static-member-var-irgen.swift | 2 +- .../Interop/Cxx/static/static-var-irgen.swift | 2 +- .../stdlib/msvc-abi-use-vector-iterator.swift | 2 +- .../Cxx/templates/mangling-irgen.swift | 4 +- ...irt_witness_method_empty_conformance.swift | 2 +- test/SILOptimizer/eager_specialize.sil | 4 +- test/SILOptimizer/eager_specialize_ossa.sil | 4 +- 91 files changed, 432 insertions(+), 433 deletions(-) diff --git a/test/AutoDiff/IRGen/differentiable_function.sil b/test/AutoDiff/IRGen/differentiable_function.sil index d347d801b5112..9acbeef82cd5a 100644 --- a/test/AutoDiff/IRGen/differentiable_function.sil +++ b/test/AutoDiff/IRGen/differentiable_function.sil @@ -33,7 +33,7 @@ bb0: return %result : $@differentiable(reverse) @callee_guaranteed (Float) -> Float } -// CHECK-LABEL: define{{.*}}test_form_diff_func(ptr noalias captures(none) sret(<{ %swift.function, %swift.function, %swift.function }>) +// CHECK-LABEL: define{{.*}}test_form_diff_func(ptr noalias nocapture sret(<{ %swift.function, %swift.function, %swift.function }>) // CHECK-SAME: [[OUT:%.*]]) // CHECK: [[OUT_ORIG:%.*]] = getelementptr{{.*}}[[OUT]], i32 0, i32 0 // CHECK: [[OUT_ORIG_FN:%.*]] = getelementptr{{.*}}[[OUT_ORIG]], i32 0, i32 0 @@ -60,7 +60,7 @@ bb0(%0 : $@differentiable(reverse) @callee_guaranteed (Float) -> Float): return %result : $(@callee_guaranteed (Float) -> Float, @callee_guaranteed (Float) -> (Float, @owned @callee_guaranteed (Float) -> Float), @callee_guaranteed (Float) -> (Float, @owned @callee_guaranteed (Float) -> Float)) } -// CHECK-LABEL: define{{.*}}@test_extract_components(ptr noalias captures(none) sret(<{ %swift.function, %swift.function, %swift.function }>) +// CHECK-LABEL: define{{.*}}@test_extract_components(ptr noalias nocapture sret(<{ %swift.function, %swift.function, %swift.function }>) // CHECK-SAME: [[OUT:%.*]], ptr{{.*}}[[IN:%.*]]) // CHECK: [[ORIG:%.*]] = getelementptr{{.*}}[[IN]], i32 0, i32 0 // CHECK: [[ORIG_FN_ADDR:%.*]] = getelementptr{{.*}}[[ORIG]], i32 0, i32 0 diff --git a/test/DebugInfo/ErrorVar.swift b/test/DebugInfo/ErrorVar.swift index 3025b9931ed43..75c7fccf7a13f 100644 --- a/test/DebugInfo/ErrorVar.swift +++ b/test/DebugInfo/ErrorVar.swift @@ -14,7 +14,7 @@ func simple(_ placeholder: Int64) throws -> () { // CHECK: define {{.*}}void @"$s8ErrorVar6simpleyys5Int64VKF"( // CHECK-SAME: i64 // CHECK-SAME: %swift.refcounted* {{.*}}swiftself - // CHECK-SAME: %swift.error** noalias captures(none) dereferenceable(4) + // CHECK-SAME: %swift.error** noalias nocapture dereferenceable(4) // CHECK: #dbg_declare // CHECK: #dbg_declare({{.*}}, ![[ERROR:[0-9]+]], !DIExpression(DW_OP_deref) // CHECK-DAG: ![[ERRTY:.*]] = !DICompositeType({{.*}}identifier: "$ss5Error_pD" diff --git a/test/Distributed/distributed_actor_accessor_thunks_32bit.swift b/test/Distributed/distributed_actor_accessor_thunks_32bit.swift index 3ea45ea4d043d..ce84f48c868ea 100644 --- a/test/Distributed/distributed_actor_accessor_thunks_32bit.swift +++ b/test/Distributed/distributed_actor_accessor_thunks_32bit.swift @@ -94,7 +94,7 @@ public distributed actor MyOtherActor { // CHECK: define hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC7simple1yySiYaKFTE" -// CHECK: define linkonce_odr hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC7simple1yySiYaKFTETF"(%swift.context* swiftasync %0, %swift.opaque* captures(none) %1, i8* %2, i8* %3, {{.*}}, %T27distributed_actor_accessors7MyActorC* [[ACTOR:%.*]], %swift.type* [[DECODER_TYPE:%.*]], i8** [[DECODER_PROTOCOL_WITNESS:%.*]]) +// CHECK: define linkonce_odr hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC7simple1yySiYaKFTETF"(%swift.context* swiftasync %0, %swift.opaque* nocapture %1, i8* %2, i8* %3, {{.*}}, %T27distributed_actor_accessors7MyActorC* [[ACTOR:%.*]], %swift.type* [[DECODER_TYPE:%.*]], i8** [[DECODER_PROTOCOL_WITNESS:%.*]]) /// Read the current offset and cast an element to `Int` @@ -119,7 +119,7 @@ public distributed actor MyOtherActor { // CHECK: missing-witness1: // CHECK-NEXT: call void @llvm.trap() // CHECK-NEXT: unreachable -// CHECK: call swiftcc void @"$s27FakeDistributedActorSystems0A17InvocationDecoderC18decodeNextArgumentxyKSeRzSERzlF"(%swift.opaque* noalias captures(none) sret(%swift.opaque) [[ARG_0_RES_SLOT]], %swift.type* %arg_type, i8** [[ENCODABLE_WITNESS]], i8** [[DECODABLE_WITNESS]], %T27FakeDistributedActorSystems0A17InvocationDecoderC* swiftself [[DECODER]], %swift.error** noalias captures(none) dereferenceable(4) %swifterror) +// CHECK: call swiftcc void @"$s27FakeDistributedActorSystems0A17InvocationDecoderC18decodeNextArgumentxyKSeRzSERzlF"(%swift.opaque* noalias nocapture sret(%swift.opaque) [[ARG_0_RES_SLOT]], %swift.type* %arg_type, i8** [[ENCODABLE_WITNESS]], i8** [[DECODABLE_WITNESS]], %T27FakeDistributedActorSystems0A17InvocationDecoderC* swiftself [[DECODER]], %swift.error** noalias nocapture dereferenceable(4) %swifterror) // CHECK: store %swift.error* null, %swift.error** %swifterror // CHECK-NEXT: [[ARG_0_VAL_ADDR:%.*]] = bitcast i8* [[ARG_0_VALUE_BUF]] to %TSi* @@ -196,7 +196,7 @@ public distributed actor MyOtherActor { // CHECK: define hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC7simple3ySiSSYaKFTE" /// !!! in `simple3` interesting bits are: argument value extraction (because string is exploded into N arguments) and call to distributed thunk -// CHECK: define linkonce_odr hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC7simple3ySiSSYaKFTETF"(%swift.context* swiftasync %0, %swift.opaque* captures(none) [[ARG_DECODER:%.*]], i8* [[ARG_TYPES:%.*]], i8* [[RESULT_BUFF:%.*]], i8* [[SUBS:%.*]], i8* [[WITNESS_TABLES:%.*]], i32 [[NUM_WITNESS_TABLES:%.*]], %T27distributed_actor_accessors7MyActorC* [[ACTOR]], %swift.type* [[DECODER_TYPE:%.*]], i8** [[DECODER_PROTOCOL_WITNESS:%.*]]) +// CHECK: define linkonce_odr hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC7simple3ySiSSYaKFTETF"(%swift.context* swiftasync %0, %swift.opaque* nocapture [[ARG_DECODER:%.*]], i8* [[ARG_TYPES:%.*]], i8* [[RESULT_BUFF:%.*]], i8* [[SUBS:%.*]], i8* [[WITNESS_TABLES:%.*]], i32 [[NUM_WITNESS_TABLES:%.*]], %T27distributed_actor_accessors7MyActorC* [[ACTOR]], %swift.type* [[DECODER_TYPE:%.*]], i8** [[DECODER_PROTOCOL_WITNESS:%.*]]) // CHECK: [[TYPED_RESULT_BUFF:%.*]] = bitcast i8* [[RESULT_BUFF]] to %TSi* @@ -260,7 +260,7 @@ public distributed actor MyOtherActor { // CHECK: define hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC16single_case_enumyAA7SimpleEOAFYaKFTE" -// CHECK: define linkonce_odr hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC16single_case_enumyAA7SimpleEOAFYaKFTETF"(%swift.context* swiftasync %0, %swift.opaque* captures(none) [[ARG_DECODER:%.*]], i8* [[ARG_TYPES:%.*]], i8* [[RESULT_BUFF:%.*]], i8* [[SUBS:%.*]], i8* [[WITNESS_TABLES:%.*]], i32 [[NUM_WITNESS_TABLES:%.*]], %T27distributed_actor_accessors7MyActorC* [[ACTOR]], %swift.type* [[DECODER_TYPE]], %swift.type* [[ACTOR_TYPE]], i8** [[DECODER_PROTOCOL_WITNESS:%.*]]) +// CHECK: define linkonce_odr hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC16single_case_enumyAA7SimpleEOAFYaKFTETF"(%swift.context* swiftasync %0, %swift.opaque* nocapture [[ARG_DECODER:%.*]], i8* [[ARG_TYPES:%.*]], i8* [[RESULT_BUFF:%.*]], i8* [[SUBS:%.*]], i8* [[WITNESS_TABLES:%.*]], i32 [[NUM_WITNESS_TABLES:%.*]], %T27distributed_actor_accessors7MyActorC* [[ACTOR]], %swift.type* [[DECODER_TYPE]], %swift.type* [[ACTOR_TYPE]], i8** [[DECODER_PROTOCOL_WITNESS:%.*]]) /// Let's check that the call doesn't have any arguments and returns nothing. @@ -307,7 +307,7 @@ public distributed actor MyOtherActor { // CHECK: define hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC7complexyAA11LargeStructVSaySiG_AA3ObjCSSSgAFtYaKFTE" -// CHECK: define linkonce_odr hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC7complexyAA11LargeStructVSaySiG_AA3ObjCSSSgAFtYaKFTETF"(%swift.context* swiftasync {{.*}}, %swift.opaque* captures(none) [[ARG_DECODER:%.*]], i8* [[ARG_TYPES:%.*]], i8* [[RESULT_BUFF:%.*]], i8* [[SUBS:%.*]], i8* [[WITNESS_TABLES:%.*]], i32 [[NUM_WITNESS_TABLES:%.*]], %T27distributed_actor_accessors7MyActorC* [[ACTOR]], %swift.type* [[DECODER_TYPE:%.*]], %swift.type* [[ACTOR_TYPE]], i8** [[DECODER_PROTOCOL_WITNESS:%.*]]) +// CHECK: define linkonce_odr hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC7complexyAA11LargeStructVSaySiG_AA3ObjCSSSgAFtYaKFTETF"(%swift.context* swiftasync {{.*}}, %swift.opaque* nocapture [[ARG_DECODER:%.*]], i8* [[ARG_TYPES:%.*]], i8* [[RESULT_BUFF:%.*]], i8* [[SUBS:%.*]], i8* [[WITNESS_TABLES:%.*]], i32 [[NUM_WITNESS_TABLES:%.*]], %T27distributed_actor_accessors7MyActorC* [[ACTOR]], %swift.type* [[DECODER_TYPE:%.*]], %swift.type* [[ACTOR_TYPE]], i8** [[DECODER_PROTOCOL_WITNESS:%.*]]) /// First, let's check that all of the different argument types here are loaded correctly. @@ -366,7 +366,7 @@ public distributed actor MyOtherActor { /// ---> Accessor for `genericArgs` -// CHECK: define linkonce_odr hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC11genericArgsyyx_Sayq_GtYaKSeRzSERzSeR_SER_r0_lFTETF"(%swift.context* swiftasync %0, %swift.opaque* captures(none) [[ARG_DECODER:%.*]], i8* [[ARG_TYPES:%.*]], i8* [[RESULT_BUF:%.*]], i8* [[GENERIC_SUBS:%.*]], i8* [[WITNESS_TABLES:%.*]], i32 [[NUM_WITNESS_TABLES:%.*]], %T27distributed_actor_accessors7MyActorC* [[ACTOR:%.*]], %swift.type* [[DECODER_TYPE:%.*]], %swift.type* [[ACTOR_TYPE]], i8** [[DECODER_PROTOCOL_WITNESS:%.*]]) +// CHECK: define linkonce_odr hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC11genericArgsyyx_Sayq_GtYaKSeRzSERzSeR_SER_r0_lFTETF"(%swift.context* swiftasync %0, %swift.opaque* nocapture [[ARG_DECODER:%.*]], i8* [[ARG_TYPES:%.*]], i8* [[RESULT_BUF:%.*]], i8* [[GENERIC_SUBS:%.*]], i8* [[WITNESS_TABLES:%.*]], i32 [[NUM_WITNESS_TABLES:%.*]], %T27distributed_actor_accessors7MyActorC* [[ACTOR:%.*]], %swift.type* [[DECODER_TYPE:%.*]], %swift.type* [[ACTOR_TYPE]], i8** [[DECODER_PROTOCOL_WITNESS:%.*]]) /// ---> Load `T` @@ -422,7 +422,7 @@ public distributed actor MyOtherActor { /// Let's check that there is argument decoding since parameter list is empty -// CHECK: define linkonce_odr hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors12MyOtherActorC5emptyyyYaKFTETF"(%swift.context* swiftasync {{.*}}, %swift.opaque* captures(none) [[ARG_DECODER:%.*]], i8* [[ARG_TYPES:%.*]], i8* [[RESULT_BUFF:%.*]], i8* [[SUBS:%.*]], i8* [[WITNESS_TABLES:%.*]], i32 [[NUM_WITNESS_TABLES:%.*]], %T27distributed_actor_accessors12MyOtherActorC* {{.*}}, %swift.type* [[DECODER_TYPE:%.*]], %swift.type* [[ACTOR_TYPE]], i8** [[DECODER_PROTOCOL_WITNESS:%.*]]) +// CHECK: define linkonce_odr hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors12MyOtherActorC5emptyyyYaKFTETF"(%swift.context* swiftasync {{.*}}, %swift.opaque* nocapture [[ARG_DECODER:%.*]], i8* [[ARG_TYPES:%.*]], i8* [[RESULT_BUFF:%.*]], i8* [[SUBS:%.*]], i8* [[WITNESS_TABLES:%.*]], i32 [[NUM_WITNESS_TABLES:%.*]], %T27distributed_actor_accessors12MyOtherActorC* {{.*}}, %swift.type* [[DECODER_TYPE:%.*]], %swift.type* [[ACTOR_TYPE]], i8** [[DECODER_PROTOCOL_WITNESS:%.*]]) // CHECK-NEXT: entry: // CHECK-NEXT: {{.*}} = alloca %swift.context* // CHECK-NEXT: %swifterror = alloca %swift.error* diff --git a/test/Distributed/distributed_actor_accessor_thunks_64bit.swift b/test/Distributed/distributed_actor_accessor_thunks_64bit.swift index 3a79a53f786fa..43a5ad5da4df0 100644 --- a/test/Distributed/distributed_actor_accessor_thunks_64bit.swift +++ b/test/Distributed/distributed_actor_accessor_thunks_64bit.swift @@ -116,7 +116,7 @@ public distributed actor MyOtherActor { // CHECK: missing-witness1: // CHECK-NEXT: call void @llvm.trap() // CHECK-NEXT: unreachable -// CHECK: call swiftcc void @"$s27FakeDistributedActorSystems0A17InvocationDecoderC18decodeNextArgumentxyKSeRzSERzlF"(ptr noalias sret(%swift.opaque) [[ARG_0_VALUE_BUF]], ptr %arg_type, ptr [[ENCODABLE_WITNESS]], ptr [[DECODABLE_WITNESS]], ptr swiftself [[DECODER]], ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) +// CHECK: call swiftcc void @"$s27FakeDistributedActorSystems0A17InvocationDecoderC18decodeNextArgumentxyKSeRzSERzlF"(ptr noalias sret(%swift.opaque) [[ARG_0_VALUE_BUF]], ptr %arg_type, ptr [[ENCODABLE_WITNESS]], ptr [[DECODABLE_WITNESS]], ptr swiftself [[DECODER]], ptr noalias nocapture swifterror dereferenceable(8) %swifterror) // CHECK: store ptr null, ptr %swifterror // CHECK-NEXT: %._value = getelementptr inbounds{{.*}} %TSi, ptr [[ARG_0_VALUE_BUF]], i32 0, i32 0 diff --git a/test/IRGen/abi_v7k.swift b/test/IRGen/abi_v7k.swift index e2e5bd766650e..cec49c0801a88 100644 --- a/test/IRGen/abi_v7k.swift +++ b/test/IRGen/abi_v7k.swift @@ -296,7 +296,7 @@ func testRet3() -> MyRect2 { } // Returning tuple?: (Int x 6)? -// CHECK-LABEL: define hidden swiftcc void @"$s8test_v7k7minMax2{{.*}}"(ptr noalias captures(none) sret({{.*}}) %0, i32 %1, i32 %2) +// CHECK-LABEL: define hidden swiftcc void @"$s8test_v7k7minMax2{{.*}}"(ptr noalias nocapture sret({{.*}}) %0, i32 %1, i32 %2) // V7K-LABEL: _$s8test_v7k7minMax2 // We will indirectly return an optional with the address in r0, input parameters will be in r1 and r2 // V7K: str r0, [sp, [[IDX:#[0-9]+]]] @@ -324,7 +324,7 @@ func minMax2(x : Int, y : Int) -> (min: Int, max: Int, min2: Int, max2: Int, min } // Returning struct?: {Int x 6}? -// CHECK-LABEL: define hidden swiftcc void @"$s8test_v7k7minMax3{{.*}}"(ptr noalias captures(none) sret({{.*}}) %0, i32 %1, i32 %2) +// CHECK-LABEL: define hidden swiftcc void @"$s8test_v7k7minMax3{{.*}}"(ptr noalias nocapture sret({{.*}}) %0, i32 %1, i32 %2) // V7K-LABEL: _$s8test_v7k7minMax3 struct Ret { var min:Int diff --git a/test/IRGen/abitypes_objc.swift b/test/IRGen/abitypes_objc.swift index 640d8e500e666..698776b4703ac 100644 --- a/test/IRGen/abitypes_objc.swift +++ b/test/IRGen/abitypes_objc.swift @@ -27,20 +27,20 @@ class Foo { // x86_64-macosx: define internal { <2 x float>, <2 x float> } @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(ptr %0, ptr %1) {{[#0-9]*}} { // x86_64-ios: define hidden swiftcc { float, float, float, float } @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}F"(ptr swiftself %0) {{.*}} { // x86_64-ios: define internal { <2 x float>, <2 x float> } @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(ptr %0, ptr %1) {{[#0-9]*}} { - // i386-ios: define hidden swiftcc void @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}F"(ptr noalias captures(none) sret({{.*}}) %0, ptr swiftself %1) {{.*}} { - // i386-ios: define internal void @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(ptr noalias captures(none) sret({{.*}}) %0, ptr %1, ptr %2) {{[#0-9]*}} { + // i386-ios: define hidden swiftcc void @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}F"(ptr noalias nocapture sret({{.*}}) %0, ptr swiftself %1) {{.*}} { + // i386-ios: define internal void @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(ptr noalias nocapture sret({{.*}}) %0, ptr %1, ptr %2) {{[#0-9]*}} { // armv7-ios: define hidden swiftcc { float, float, float, float } @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}F"(ptr swiftself %0) {{.*}} { - // armv7-ios: define internal void @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(ptr noalias captures(none) sret({{.*}}) %0, ptr %1, ptr %2) {{[#0-9]*}} { + // armv7-ios: define internal void @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(ptr noalias nocapture sret({{.*}}) %0, ptr %1, ptr %2) {{[#0-9]*}} { // armv7s-ios: define hidden swiftcc { float, float, float, float } @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}F"(ptr swiftself %0) {{.*}} { - // armv7s-ios: define internal void @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(ptr noalias captures(none) sret({{.*}}) %0, ptr %1, ptr %2) {{[#0-9]*}} { + // armv7s-ios: define internal void @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(ptr noalias nocapture sret({{.*}}) %0, ptr %1, ptr %2) {{[#0-9]*}} { // arm64-ios: define hidden swiftcc { float, float, float, float } @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}F"(ptr swiftself %0) {{.*}} { // arm64-ios: define internal [[ARM64_MYRECT]] @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(ptr %0, ptr %1) {{[#0-9]*}} { // x86_64-tvos: define hidden swiftcc { float, float, float, float } @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}F"(ptr swiftself %0) {{.*}} { // x86_64-tvos: define internal { <2 x float>, <2 x float> } @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(ptr %0, ptr %1) {{[#0-9]*}} { // arm64-tvos: define hidden swiftcc { float, float, float, float } @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}F"(ptr swiftself %0) {{.*}} { // arm64-tvos: define internal [[ARM64_MYRECT]] @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(ptr %0, ptr %1) {{[#0-9]*}} { - // i386-watchos: define hidden swiftcc void @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}F"(ptr noalias captures(none) sret({{.*}}) %0, ptr swiftself %1) {{.*}} { - // i386-watchos: define internal void @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(ptr noalias captures(none) sret({{.*}}) %0, ptr %1, ptr %2) {{[#0-9]*}} { + // i386-watchos: define hidden swiftcc void @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}F"(ptr noalias nocapture sret({{.*}}) %0, ptr swiftself %1) {{.*}} { + // i386-watchos: define internal void @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(ptr noalias nocapture sret({{.*}}) %0, ptr %1, ptr %2) {{[#0-9]*}} { // armv7k-watchos: define hidden swiftcc { float, float, float, float } @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}F"(ptr swiftself %0) {{.*}} { // armv7k-watchos: define internal [[ARMV7K_MYRECT]] @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(ptr %0, ptr %1) {{[#0-9]*}} { // armv64_32-watchos: define hidden swiftcc { float, float, float, float } @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}F"(ptr swiftself %0) {{.*}} { @@ -157,7 +157,7 @@ class Foo { // armv7-ios: define hidden swiftcc float @"$s8abitypes3FooC4barc{{[_0-9a-zA-Z]*}}F"(ptr %0, ptr swiftself %1) {{.*}} { // armv7-ios: [[RESULT:%.*]] = alloca [[RECTTYPE:%.*MyRect.*]], align 4 // armv7-ios: load ptr, ptr @"\01L_selector(newRect)", align 4 - // armv7-ios: call void @objc_msgSend_stret(ptr noalias captures(none) sret({{.*}}) %call.aggresult + // armv7-ios: call void @objc_msgSend_stret(ptr noalias nocapture sret({{.*}}) %call.aggresult // armv7-ios: [[GEP1:%.*]] = getelementptr inbounds [[RECTTYPE]], ptr [[RESULT]], i32 0, i32 1 // armv7-ios: [[GEP2:%.*]] = getelementptr inbounds {{.*}}, ptr [[GEP1]], i32 0, i32 0 // armv7-ios: [[RETVAL:%.*]] = load float, ptr [[GEP2]], align 4 @@ -167,7 +167,7 @@ class Foo { // armv7s-ios: define hidden swiftcc float @"$s8abitypes3FooC4barc{{[_0-9a-zA-Z]*}}F"(ptr %0, ptr swiftself %1) {{.*}} { // armv7s-ios: [[RESULT:%.*]] = alloca [[RECTTYPE:%.*MyRect.*]], align 4 // armv7s-ios: load ptr, ptr @"\01L_selector(newRect)", align 4 - // armv7s-ios: call void @objc_msgSend_stret(ptr noalias captures(none) sret({{.*}}) %call.aggresult + // armv7s-ios: call void @objc_msgSend_stret(ptr noalias nocapture sret({{.*}}) %call.aggresult // armv7s-ios: [[GEP1:%.*]] = getelementptr inbounds [[RECTTYPE]], ptr [[RESULT]], i32 0, i32 1 // armv7s-ios: [[GEP2:%.*]] = getelementptr inbounds {{.*}}, ptr [[GEP1]], i32 0, i32 0 // armv7s-ios: [[RETVAL:%.*]] = load float, ptr [[GEP2]], align 4 @@ -185,7 +185,7 @@ class Foo { } // x86_64-macosx: define hidden swiftcc { double, double, double } @"$s8abitypes3FooC3baz{{[_0-9a-zA-Z]*}}F"(ptr swiftself %0) {{.*}} { - // x86_64-macosx: define internal void @"$s8abitypes3FooC3baz{{[_0-9a-zA-Z]*}}FTo"(ptr noalias captures(none) sret({{.*}}) %0, ptr %1, ptr %2) {{[#0-9]*}} { + // x86_64-macosx: define internal void @"$s8abitypes3FooC3baz{{[_0-9a-zA-Z]*}}FTo"(ptr noalias nocapture sret({{.*}}) %0, ptr %1, ptr %2) {{[#0-9]*}} { @objc dynamic func baz() -> Trio { return Trio(i: 1.0, j: 2.0, k: 3.0) } @@ -480,17 +480,17 @@ class Foo { return g.invert(b) } - // x86_64-macosx: define hidden swiftcc void @"$s8abitypes3FooC10throwsTestyySbKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) {{.*}} { + // x86_64-macosx: define hidden swiftcc void @"$s8abitypes3FooC10throwsTestyySbKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) {{.*}} { // x86_64-macosx: [[SEL:%[0-9]+]] = load ptr, ptr @"\01L_selector(negateThrowing:error:)", align 8 // x86_64-macosx: call signext i8 @objc_msgSend(ptr {{%[0-9]+}}, ptr [[SEL]], i8 signext {{%[0-9]+}}, ptr {{%[0-9]+}}) // x86_64-macosx: } - // x86_64-ios: define hidden swiftcc void @"$s8abitypes3FooC10throwsTestyySbKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) {{.*}} { + // x86_64-ios: define hidden swiftcc void @"$s8abitypes3FooC10throwsTestyySbKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) {{.*}} { // x86_64-ios: [[SEL:%[0-9]+]] = load ptr, ptr @"\01L_selector(negateThrowing:error:)", align 8 // x86_64-ios: call zeroext i1 @objc_msgSend(ptr {{%[0-9]+}}, ptr [[SEL]], i1 zeroext {{%[0-9]+}}, ptr {{%[0-9]+}}) // x86_64-ios: } - // i386-ios: define hidden swiftcc void @"$s8abitypes3FooC10throwsTestyySbKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) dereferenceable(4) %2) {{.*}} { + // i386-ios: define hidden swiftcc void @"$s8abitypes3FooC10throwsTestyySbKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture dereferenceable(4) %2) {{.*}} { // i386-ios: [[SEL:%[0-9]+]] = load ptr, ptr @"\01L_selector(negateThrowing:error:)", align 4 // i386-ios: call signext i8 @objc_msgSend(ptr {{%[0-9]+}}, ptr [[SEL]], i8 signext {{%[0-9]+}}, ptr {{%[0-9]+}}) // i386-ios: } @@ -547,18 +547,18 @@ class Foo { } // arm64-ios: define hidden swiftcc { i64, i64, i64, i64 } @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}F"(ptr %0, i64 %1, i64 %2, i64 %3, i64 %4, ptr swiftself %5) {{.*}} { - // arm64-ios: define internal void @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}FTo"(ptr noalias captures(none) sret({{.*}}) %0, ptr %1, ptr %2, ptr %3, ptr %4) {{[#0-9]*}} { + // arm64-ios: define internal void @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}FTo"(ptr noalias nocapture sret({{.*}}) %0, ptr %1, ptr %2, ptr %3, ptr %4) {{[#0-9]*}} { // // arm64e-ios: define hidden swiftcc { i64, i64, i64, i64 } @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}F"(ptr %0, i64 %1, i64 %2, i64 %3, i64 %4, ptr swiftself %5) {{.*}} { - // arm64e-ios: define internal void @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}FTo"(ptr noalias captures(none) sret({{.*}}) %0, ptr %1, ptr %2, ptr %3, ptr %4) {{.*}} { + // arm64e-ios: define internal void @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}FTo"(ptr noalias nocapture sret({{.*}}) %0, ptr %1, ptr %2, ptr %3, ptr %4) {{.*}} { // // arm64-tvos: define hidden swiftcc { i64, i64, i64, i64 } @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}F"(ptr %0, i64 %1, i64 %2, i64 %3, i64 %4, ptr swiftself %5) {{.*}} { - // arm64-tvos: define internal void @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}FTo"(ptr noalias captures(none) sret({{.*}}) %0, ptr %1, ptr %2, ptr %3, ptr %4) {{[#0-9]*}} { + // arm64-tvos: define internal void @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}FTo"(ptr noalias nocapture sret({{.*}}) %0, ptr %1, ptr %2, ptr %3, ptr %4) {{[#0-9]*}} { // arm64-macosx: define hidden swiftcc { i64, i64, i64, i64 } @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}F"(ptr %0, i64 %1, i64 %2, i64 %3, i64 %4, ptr swiftself %5) {{.*}} { - // arm64-macosx: define internal void @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}FTo"(ptr noalias captures(none) sret({{.*}}) %0, ptr %1, ptr %2, ptr %3, ptr %4) {{.*}} { + // arm64-macosx: define internal void @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}FTo"(ptr noalias nocapture sret({{.*}}) %0, ptr %1, ptr %2, ptr %3, ptr %4) {{.*}} { // // arm64-watchos: define hidden swiftcc { i64, i64, i64, i64 } @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}F"(ptr %0, i64 %1, i64 %2, i64 %3, i64 %4, ptr swiftself %5) {{.*}} { - // arm64-watchos: define internal void @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}FTo"(ptr noalias captures(none) sret({{.*}}) %0, ptr %1, ptr %2, ptr %3, ptr %4) {{[#0-9]*}} { + // arm64-watchos: define internal void @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}FTo"(ptr noalias nocapture sret({{.*}}) %0, ptr %1, ptr %2, ptr %3, ptr %4) {{[#0-9]*}} { @objc dynamic func callJustReturn(_ r: StructReturns, with v: BigStruct) -> BigStruct { return r.justReturn(v) } diff --git a/test/IRGen/access_markers.sil b/test/IRGen/access_markers.sil index ceb722b20d264..2d50adbc076fb 100644 --- a/test/IRGen/access_markers.sil +++ b/test/IRGen/access_markers.sil @@ -95,13 +95,13 @@ sil @testPairedBox : $(@guaranteed { var () }) -> () { bb0(%0 : ${ var () }): // CHECK: entry: %2 = project_box %0 : ${ var () }, 0 - // CHECK-NEXT: call {{.*}}void @writeEmptyTuple(ptr captures(none) undef) + // CHECK-NEXT: call {{.*}}void @writeEmptyTuple(ptr nocapture undef) %3 = begin_access [modify] [dynamic] %2 : $*() %write_fn = function_ref @writeEmptyTuple : $@convention(thin) (@inout ()) -> () apply %write_fn(%3) : $@convention(thin) (@inout ()) -> () end_access %3 : $*() - // CHECK-NEXT: call {{.*}}void @readEmptyTuple(ptr noalias captures(none) undef) + // CHECK-NEXT: call {{.*}}void @readEmptyTuple(ptr noalias nocapture undef) %5 = begin_access [read] [dynamic] %2 : $*() %read_fn = function_ref @readEmptyTuple : $@convention(thin) (@in_guaranteed ()) -> () apply %read_fn(%5) : $@convention(thin) (@in_guaranteed ()) -> () diff --git a/test/IRGen/async_dynamic_replacement.swift b/test/IRGen/async_dynamic_replacement.swift index fb0e699ac4d35..bef67f42375f3 100644 --- a/test/IRGen/async_dynamic_replacement.swift +++ b/test/IRGen/async_dynamic_replacement.swift @@ -26,7 +26,7 @@ public func calls_number() async -> Int { // CHECK-LABEL: define {{.*}}swifttailcc void @"$s25async_dynamic_replacement32indirectReturnDynamicReplaceableSi_S6ityYaKF"(ptr {{.*}}%0, ptr swiftasync %1) // CHECK: forward_to_replaced: -// CHECK: musttail call swifttailcc void {{.*}}(ptr noalias captures(none) %0, ptr swiftasync {{.*}}) +// CHECK: musttail call swifttailcc void {{.*}}(ptr noalias nocapture %0, ptr swiftasync {{.*}}) public dynamic func indirectReturnDynamicReplaceable() async throws -> (Int, Int, Int, Int, Int, Int, Int) { return (0, 0, 0, 0, 0, 0, 0) } diff --git a/test/IRGen/big_types_corner_cases.sil b/test/IRGen/big_types_corner_cases.sil index cd1b8a307e5d0..270cd16c66cf1 100644 --- a/test/IRGen/big_types_corner_cases.sil +++ b/test/IRGen/big_types_corner_cases.sil @@ -38,7 +38,7 @@ public struct BigBigStruct { } // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @testBitfieldInBlock -// CHECK: call void {{%.*}}(ptr noalias captures(none) sret({{.*}}) {{%.*}}, ptr {{%.*}}, ptr byval({{.*}}) align 8 {{%.*}}) +// CHECK: call void {{%.*}}(ptr noalias nocapture sret({{.*}}) {{%.*}}, ptr {{%.*}}, ptr byval({{.*}}) align 8 {{%.*}}) sil @testBitfieldInBlock : $@convention(thin) (@owned @convention(block) (BitfieldOne) -> BitfieldOne, BitfieldOne) -> BitfieldOne { entry(%b : $@convention(block) (BitfieldOne) -> BitfieldOne, %x : $BitfieldOne): %r = apply %b(%x) : $@convention(block) (BitfieldOne) -> BitfieldOne @@ -46,7 +46,7 @@ entry(%b : $@convention(block) (BitfieldOne) -> BitfieldOne, %x : $BitfieldOne): } // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @testTupleExtract -// CHECK: call void {{%.*}}(ptr noalias captures(none) sret({{.*}}) {{%.*}}, ptr {{%.*}}, ptr byval({{.*}}) align 8 {{%.*}}) +// CHECK: call void {{%.*}}(ptr noalias nocapture sret({{.*}}) {{%.*}}, ptr {{%.*}}, ptr byval({{.*}}) align 8 {{%.*}}) sil @testTupleExtract : $@convention(thin) (@owned (BitfieldOne, @convention(block) (BitfieldOne) -> BitfieldOne), BitfieldOne) -> BitfieldOne { entry(%b : $(BitfieldOne, @convention(block) (BitfieldOne) -> (BitfieldOne)), %x : $BitfieldOne): %a = tuple_extract %b : $(BitfieldOne, @convention(block) (BitfieldOne) -> (BitfieldOne)), 1 @@ -54,9 +54,9 @@ entry(%b : $(BitfieldOne, @convention(block) (BitfieldOne) -> (BitfieldOne)), %x return %r : $BitfieldOne } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @testBigTempStruct(ptr noalias captures(none) sret({{.*}}) %0, ptr %1, ptr %Element) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @testBigTempStruct(ptr noalias nocapture sret({{.*}}) %0, ptr %1, ptr %Element) // CHECK: [[ALLOC:%.*]] = alloca %T22big_types_corner_cases13BigTempStructV -// CHECK: call swiftcc void @testBigTempStruct(ptr noalias captures(none) sret({{.*}}) [[ALLOC]], ptr %1, ptr %Element) +// CHECK: call swiftcc void @testBigTempStruct(ptr noalias nocapture sret({{.*}}) [[ALLOC]], ptr %1, ptr %Element) // CHECK: ret void sil @testBigTempStruct : $@convention(method) (@guaranteed _ArrayBuffer) -> @owned BigTempStruct { bb0(%0 : $_ArrayBuffer): @@ -66,9 +66,9 @@ bb0(%0 : $_ArrayBuffer): return %9 : $BigTempStruct } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @testTryApply(ptr noalias captures(none) sret({{.*}}) %0, ptr %1, ptr %2, ptr swiftself %3, ptr noalias captures(none) swifterror dereferenceable(8) %4) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @testTryApply(ptr noalias nocapture sret({{.*}}) %0, ptr %1, ptr %2, ptr swiftself %3, ptr noalias nocapture swifterror dereferenceable(8) %4) // CHECK: [[ALLOC:%.*]] = alloca %T22big_types_corner_cases9BigStructV -// CHECK: call swiftcc void {{.*}}(ptr noalias captures(none) sret({{.*}}) [[ALLOC]] +// CHECK: call swiftcc void {{.*}}(ptr noalias nocapture sret({{.*}}) [[ALLOC]] // CHECK: ret void sil @testTryApply : $@convention(thin)(() -> (@owned BigStruct, @error Error)) -> (@owned BigStruct, @error Error) { bb0(%0 : $() -> (@owned BigStruct, @error Error)): @@ -82,8 +82,8 @@ bb2(%err : $Error): throw %err : $Error } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @testFuncWithModBlockStorageApply(ptr captures(none) dereferenceable({{.*}}) %0, ptr noalias captures(none) dereferenceable({{.*}}) -// CHECK: call swiftcc void {{.*}}(ptr noalias captures(none) dereferenceable({{.*}}) %1 +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @testFuncWithModBlockStorageApply(ptr nocapture dereferenceable({{.*}}) %0, ptr noalias nocapture dereferenceable({{.*}}) +// CHECK: call swiftcc void {{.*}}(ptr noalias nocapture dereferenceable({{.*}}) %1 // CHECK: ret void sil @testFuncWithModBlockStorageApply : $@convention(thin) (@inout_aliasable @block_storage @callee_owned (@owned BigStruct) -> (), BigStruct) -> () { // %0 // user: %5 @@ -109,7 +109,7 @@ sil public_external @c_return_func : $@convention(thin) () -> () -> @owned BigSt // CHECK: [[RET:%.*]] = insertvalue { ptr, ptr } { ptr @"$s17part_apply_calleeTA", ptr undef }, ptr // CHECK: ret { ptr, ptr } [[RET]] -// CHECK-LABEL: define internal swiftcc void @"$s17part_apply_calleeTA"(ptr noalias captures(none) sret({{.*}}) %0, i64 %1, ptr swiftself %2) +// CHECK-LABEL: define internal swiftcc void @"$s17part_apply_calleeTA"(ptr noalias nocapture sret({{.*}}) %0, i64 %1, ptr swiftself %2) // CHECK: ret void sil @part_apply_caller : $@convention(thin) () -> @owned @callee_owned (@owned Builtin.Int64) -> @owned BigStruct { @@ -174,12 +174,12 @@ sil @get_optional_none : $@convention(method) <τ_0_0> (@thin Optional<τ_0_0>.T sil @short_circuit_operation : $@convention(thin) <τ_0_0> (@in Optional<τ_0_0>, @owned @callee_owned () -> (@out τ_0_0, @error Error)) -> (@out τ_0_0, @error Error) sil @autoclosure_partialapply : $@convention(thin) (@owned @callee_owned () -> (BigStruct, @error Error)) -> (@out BigStruct, @error Error) -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @closure(ptr noalias captures(none) sret({{.*}}) %0, ptr %1) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @closure(ptr noalias nocapture sret({{.*}}) %0, ptr %1) // CHECK-64: [[ALLOC1:%.*]] = alloca %T22big_types_corner_cases9BigStructV // CHECK-64: [[ALLOC2:%.*]] = alloca %T22big_types_corner_cases9BigStructV // CHECK-64: [[ALLOC3:%.*]] = alloca %T22big_types_corner_cases9BigStructVSg // CHECK-64: [[ALLOC4:%.*]] = alloca %T22big_types_corner_cases9BigStructVSg -// CHECK-64: call swiftcc void @"$s22big_types_corner_cases8SuperSubC1fyyFAA9BigStructVycfU_AFyKXKfu_TA"(ptr noalias captures(none) sret({{.*}}) [[ALLOC1]], ptr swiftself {{.*}}, ptr captures(none) swifterror %swifterror) +// CHECK-64: call swiftcc void @"$s22big_types_corner_cases8SuperSubC1fyyFAA9BigStructVycfU_AFyKXKfu_TA"(ptr noalias nocapture sret({{.*}}) [[ALLOC1]], ptr swiftself {{.*}}, ptr nocapture swifterror %swifterror) // CHECK: ret void sil @closure : $@convention(thin) (@owned SuperSub) -> BigStruct { bb0(%0 : $SuperSub): @@ -218,7 +218,7 @@ sil @returnBigStruct : $@convention(thin) () -> @owned BigStruct // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @closureToConvert() // CHECK: entry: // CHECK: [[ALLOC:%.*]] = alloca %T22big_types_corner_cases9BigStructV -// CHECK: call swiftcc void @returnBigStruct(ptr noalias captures(none) sret({{.*}}) [[ALLOC]]) +// CHECK: call swiftcc void @returnBigStruct(ptr noalias nocapture sret({{.*}}) [[ALLOC]]) // CHECK: ret void // CHECK-LABEL: } sil @closureToConvert : $@convention(thin) () -> () { @@ -246,11 +246,11 @@ bb0: sil @convertToThickHelper : $@convention(thin) (@owned BigStruct) -> () -// CHECK-LABAL: define {{.*}} swiftcc void @convertToThick(ptr noalias captures(none) dereferenceable({{.*}}) %0) +// CHECK-LABAL: define {{.*}} swiftcc void @convertToThick(ptr noalias nocapture dereferenceable({{.*}}) %0) // CHECK: entry: // CHECK: [[ALLOC:%.*]] = alloca %T22big_types_corner_cases9BigStructV, align 4 // CHECK: call void @llvm.memcpy.p0.p0.i64 -// CHECK: call swiftcc void @convertToThickHelper(ptr noalias captures(none) dereferenceable({{.*}}) [[ALLOC]], ptr swiftself null) +// CHECK: call swiftcc void @convertToThickHelper(ptr noalias nocapture dereferenceable({{.*}}) [[ALLOC]], ptr swiftself null) // CHECK: ret void // CHECK-LABEL: } sil @convertToThick : $@convention(thin) (@in BigStruct) -> () { diff --git a/test/IRGen/big_types_corner_cases.swift b/test/IRGen/big_types_corner_cases.swift index 15201ff63f3bd..d63789ac579ec 100644 --- a/test/IRGen/big_types_corner_cases.swift +++ b/test/IRGen/big_types_corner_cases.swift @@ -46,7 +46,7 @@ let bigStructGlobalArray : [BigStruct] = [ BigStruct() ] -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} internal swiftcc void @"$s22big_types_corner_cases21OptionalInoutFuncTypeC7executeyys5Error_pSgFyyXEfU_"(ptr captures(none) dereferenceable({{.*}}) %0, ptr %1, ptr captures(none) dereferenceable({{.*}}) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} internal swiftcc void @"$s22big_types_corner_cases21OptionalInoutFuncTypeC7executeyys5Error_pSgFyyXEfU_"(ptr nocapture dereferenceable({{.*}}) %0, ptr %1, ptr nocapture dereferenceable({{.*}}) // CHECK: call void @"$s22big_types_corner_cases9BigStructVSgs5Error_pSgIegng_SgWOe // CHECK: call void @"$s22big_types_corner_cases9BigStructVSgs5Error_pSgIegng_SgWOy // CHECK: ret void @@ -66,9 +66,9 @@ public func f3_uses_f2() { } // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s22big_types_corner_cases10f3_uses_f2yyF"() -// CHECK: call swiftcc void @"$s22big_types_corner_cases9BigStructVACycfC"(ptr noalias captures(none) sret({{.*}}) +// CHECK: call swiftcc void @"$s22big_types_corner_cases9BigStructVACycfC"(ptr noalias nocapture sret({{.*}}) // CHECK: call swiftcc { ptr, ptr } @"$s22big_types_corner_cases13f2_returns_f1AA9BigStructVADcyF"() -// CHECK: call swiftcc void {{.*}}(ptr noalias captures(none) sret({{.*}}) {{.*}}, ptr noalias captures(none) dereferenceable({{.*}}) {{.*}}, ptr swiftself {{.*}}) +// CHECK: call swiftcc void {{.*}}(ptr noalias nocapture sret({{.*}}) {{.*}}, ptr noalias nocapture dereferenceable({{.*}}) {{.*}}, ptr swiftself {{.*}}) // CHECK: ret void public func f4_tuple_use_of_f2() { @@ -81,7 +81,7 @@ public func f4_tuple_use_of_f2() { // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s22big_types_corner_cases18f4_tuple_use_of_f2yyF"() // CHECK: [[TUPLE:%.*]] = call swiftcc { ptr, ptr } @"$s22big_types_corner_cases13f2_returns_f1AA9BigStructVADcyF"() // CHECK: [[TUPLE_EXTRACT:%.*]] = extractvalue { ptr, ptr } [[TUPLE]], 0 -// CHECK: call swiftcc void [[TUPLE_EXTRACT]](ptr noalias captures(none) sret({{.*}}) {{.*}}, ptr noalias captures(none) dereferenceable({{.*}}) {{.*}}, ptr swiftself %{{.*}}) +// CHECK: call swiftcc void [[TUPLE_EXTRACT]](ptr noalias nocapture sret({{.*}}) {{.*}}, ptr noalias nocapture dereferenceable({{.*}}) {{.*}}, ptr swiftself %{{.*}}) // CHECK: ret void public class BigClass { @@ -95,8 +95,8 @@ public class BigClass { } } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} hidden swiftcc void @"$s22big_types_corner_cases8BigClassC03useE6Struct0aH0yAA0eH0V_tF"(ptr noalias captures(none) dereferenceable({{.*}}) %0, ptr swiftself %1) -// CHECK: call swiftcc void {{.*}}(ptr noalias captures(none) dereferenceable({{.*}}) %0, ptr swiftself +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} hidden swiftcc void @"$s22big_types_corner_cases8BigClassC03useE6Struct0aH0yAA0eH0V_tF"(ptr noalias nocapture dereferenceable({{.*}}) %0, ptr swiftself %1) +// CHECK: call swiftcc void {{.*}}(ptr noalias nocapture dereferenceable({{.*}}) %0, ptr swiftself // CHECK: ret void public struct MyStruct { @@ -134,17 +134,17 @@ public func enumCallee(_ x: LargeEnum) { case .Empty2: break } } -// CHECK-64-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s22big_types_corner_cases10enumCalleeyyAA9LargeEnumOF"(ptr noalias captures(none) dereferenceable({{.*}}) %0) #0 { +// CHECK-64-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s22big_types_corner_cases10enumCalleeyyAA9LargeEnumOF"(ptr noalias nocapture dereferenceable({{.*}}) %0) #0 { // CHECK-64: alloca %T22big_types_corner_cases9LargeEnumO05InnerF0O // CHECK-64: alloca %T22big_types_corner_cases9LargeEnumO // CHECK-64: $ss5print_9separator10terminatoryypd_S2StF // CHECK-64: ret void -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} internal swiftcc void @"$s22big_types_corner_cases8SuperSubC1fyyFAA9BigStructVycfU_"(ptr noalias captures(none) sret({{.*}}) %0, ptr %1) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} internal swiftcc void @"$s22big_types_corner_cases8SuperSubC1fyyFAA9BigStructVycfU_"(ptr noalias nocapture sret({{.*}}) %0, ptr %1) // CHECK-64: [[ALLOC1:%.*]] = alloca %T22big_types_corner_cases9BigStructV // CHECK-64: [[ALLOC2:%.*]] = alloca %T22big_types_corner_cases9BigStructV // CHECK-64: [[ALLOC3:%.*]] = alloca %T22big_types_corner_cases9BigStructVSg -// CHECK-64: call swiftcc void @"$s22big_types_corner_cases9SuperBaseC4boomAA9BigStructVyF"(ptr noalias captures(none) sret({{.*}}) [[ALLOC1]], ptr swiftself {{.*}}) +// CHECK-64: call swiftcc void @"$s22big_types_corner_cases9SuperBaseC4boomAA9BigStructVyF"(ptr noalias nocapture sret({{.*}}) [[ALLOC1]], ptr swiftself {{.*}}) // CHECK: ret void class SuperBase { func boom() -> BigStruct { @@ -164,10 +164,10 @@ class SuperSub : SuperBase { } } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s22big_types_corner_cases10MUseStructV16superclassMirrorAA03BigF0VSgvg"(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias captures(none) swiftself dereferenceable({{.*}}) %1) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s22big_types_corner_cases10MUseStructV16superclassMirrorAA03BigF0VSgvg"(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture swiftself dereferenceable({{.*}}) %1) // CHECK: [[ALLOC:%.*]] = alloca %T22big_types_corner_cases9BigStructVSg // CHECK: [[LOAD:%.*]] = load ptr, ptr %.callInternalLet.data -// CHECK: call swiftcc void %{{[0-9]+}}(ptr noalias captures(none) sret({{.*}}) [[ALLOC]], ptr swiftself [[LOAD]]) +// CHECK: call swiftcc void %{{[0-9]+}}(ptr noalias nocapture sret({{.*}}) [[ALLOC]], ptr swiftself [[LOAD]]) // CHECK: ret void public struct MUseStruct { var x = BigStruct() @@ -296,9 +296,9 @@ public extension QueryHandler { body(query) } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s22big_types_corner_cases12QueryHandlerPAAE13forceHandle_25query8ReturnedQyd___AA9BigStructVSgtqd___tAA0E0Rd__lF"(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias %1, ptr noalias %2, ptr{{.*}}, ptr{{.*}}, ptr {{.*}}.QueryHandler, ptr {{.*}}.Query, ptr noalias swiftself %3) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s22big_types_corner_cases12QueryHandlerPAAE13forceHandle_25query8ReturnedQyd___AA9BigStructVSgtqd___tAA0E0Rd__lF"(ptr noalias nocapture sret({{.*}}) %0, ptr noalias %1, ptr noalias %2, ptr{{.*}}, ptr{{.*}}, ptr {{.*}}.QueryHandler, ptr {{.*}}.Query, ptr noalias swiftself %3) // CHECK: [[ALLOC:%.*]] = alloca %T22big_types_corner_cases9BigStructVSg -// CHECK: call swiftcc void {{.*}}(ptr noalias captures(none) sret({{.*}}) [[ALLOC]], ptr noalias {{.*}}, ptr noalias {{.*}}, ptr swiftself {{.*}}) +// CHECK: call swiftcc void {{.*}}(ptr noalias nocapture sret({{.*}}) [[ALLOC]], ptr noalias {{.*}}, ptr noalias {{.*}}, ptr swiftself {{.*}}) // CHECK: ret void func forceHandle_2(query: Q) -> (Q.Returned, BigStruct?) { guard let body = handle_2 as? (Q) -> (Q.Returned, BigStruct?) else { @@ -307,11 +307,11 @@ public extension QueryHandler { return body(query) } -// CHECK-LABEL-64: define{{( dllexport)?}}{{( protected)?}} swiftcc { i64, i64 } @"$s22big_types_corner_cases12QueryHandlerPAAE13forceHandle_35query8ReturnedQyd___SbAA9BigStructVcSgtqd___tAA0E0Rd__lF"(ptr noalias %0, ptr noalias captures(none) %1, ptr{{.*}}, ptr{{.*}}, ptr {{.*}}.QueryHandler, ptr {{.*}}.Query, ptr noalias captures(none) swiftself %2) +// CHECK-LABEL-64: define{{( dllexport)?}}{{( protected)?}} swiftcc { i64, i64 } @"$s22big_types_corner_cases12QueryHandlerPAAE13forceHandle_35query8ReturnedQyd___SbAA9BigStructVcSgtqd___tAA0E0Rd__lF"(ptr noalias %0, ptr noalias nocapture %1, ptr{{.*}}, ptr{{.*}}, ptr {{.*}}.QueryHandler, ptr {{.*}}.Query, ptr noalias nocapture swiftself %2) // CHECK-64: {{.*}} = call swiftcc { i64, i64 } {{.*}}(ptr noalias {{.*}}, ptr noalias {{.*}}, ptr swiftself {{.*}}) // CHECK-64: ret { i64, i64 } -// CHECK-LABEL-32: define{{( dllexport)?}}{{( protected)?}} swiftcc { i32, i32} @"$s22big_types_corner_cases12QueryHandlerPAAE13forceHandle_35query8ReturnedQyd___SbAA9BigStructVcSgtqd___tAA0E0Rd__lF"(ptr noalias %0, ptr noalias captures(none) %1, ptr{{.*}}, ptr{{.*}}, ptr {{.*}}.QueryHandler, ptr {{.*}}.Query, ptr noalias captures(none) swiftself %2) +// CHECK-LABEL-32: define{{( dllexport)?}}{{( protected)?}} swiftcc { i32, i32} @"$s22big_types_corner_cases12QueryHandlerPAAE13forceHandle_35query8ReturnedQyd___SbAA9BigStructVcSgtqd___tAA0E0Rd__lF"(ptr noalias %0, ptr noalias nocapture %1, ptr{{.*}}, ptr{{.*}}, ptr {{.*}}.QueryHandler, ptr {{.*}}.Query, ptr noalias nocapture swiftself %2) // CHECK-32: {{.*}} = call swiftcc { i32, i32 } {{.*}}(ptr noalias {{.*}}, ptr noalias {{.*}}, ptr swiftself {{.*}}) // CHECK-32: ret { i32, i32 } func forceHandle_3(query: Q) -> (Q.Returned, Filter?) { @@ -321,12 +321,12 @@ public extension QueryHandler { return body(query) } -// CHECK-LABEL-64: define{{( dllexport)?}}{{( protected)?}} swiftcc { i64, i64 } @"$s22big_types_corner_cases12QueryHandlerPAAE13forceHandle_45query8ReturnedQyd___SbAA9BigStructVcSgtqd___tKAA0E0Rd__lF"(ptr noalias %0, ptr noalias captures(none) %1, ptr{{.*}}, ptr{{.*}}, ptr {{.*}}.QueryHandler, ptr {{.*}}.Query, ptr noalias captures(none) swiftself %2, ptr swifterror %3) -// CHECK-64: {{.*}} = call swiftcc { i64, i64 } {{.*}}(ptr noalias {{.*}}, ptr noalias {{.*}}, ptr swiftself {{.*}}, ptr noalias captures(none) swifterror {{.*}}) +// CHECK-LABEL-64: define{{( dllexport)?}}{{( protected)?}} swiftcc { i64, i64 } @"$s22big_types_corner_cases12QueryHandlerPAAE13forceHandle_45query8ReturnedQyd___SbAA9BigStructVcSgtqd___tKAA0E0Rd__lF"(ptr noalias %0, ptr noalias nocapture %1, ptr{{.*}}, ptr{{.*}}, ptr {{.*}}.QueryHandler, ptr {{.*}}.Query, ptr noalias nocapture swiftself %2, ptr swifterror %3) +// CHECK-64: {{.*}} = call swiftcc { i64, i64 } {{.*}}(ptr noalias {{.*}}, ptr noalias {{.*}}, ptr swiftself {{.*}}, ptr noalias nocapture swifterror {{.*}}) // CHECK-64: ret { i64, i64 } -// CHECK-LABEL-32: define{{( dllexport)?}}{{( protected)?}} swiftcc { i32, i32} @"$s22big_types_corner_cases12QueryHandlerPAAE13forceHandle_45query8ReturnedQyd___SbAA9BigStructVcSgtqd___tKAA0E0Rd__lF"(ptr noalias %0, ptr noalias captures(none) %1, ptr{{.*}}, ptr{{.*}}, ptr {{.*}}.QueryHandler, ptr {{.*}}.Query, ptr noalias captures(none) swiftself %2, ptr swifterror %3) -// CHECK-32: {{.*}} = call swiftcc { i32, i32 } {{.*}}(ptr noalias {{.*}}, ptr noalias {{.*}}, ptr swiftself {{.*}}, ptr noalias captures(none) {{.*}}) +// CHECK-LABEL-32: define{{( dllexport)?}}{{( protected)?}} swiftcc { i32, i32} @"$s22big_types_corner_cases12QueryHandlerPAAE13forceHandle_45query8ReturnedQyd___SbAA9BigStructVcSgtqd___tKAA0E0Rd__lF"(ptr noalias %0, ptr noalias nocapture %1, ptr{{.*}}, ptr{{.*}}, ptr {{.*}}.QueryHandler, ptr {{.*}}.Query, ptr noalias nocapture swiftself %2, ptr swifterror %3) +// CHECK-32: {{.*}} = call swiftcc { i32, i32 } {{.*}}(ptr noalias {{.*}}, ptr noalias {{.*}}, ptr swiftself {{.*}}, ptr noalias nocapture {{.*}}) // CHECK-32: ret { i32, i32 } func forceHandle_4(query: Q) throws -> (Q.Returned, Filter?) { guard let body = handle_4 as? (Q) throws -> (Q.Returned, Filter?) else { diff --git a/test/IRGen/big_types_corner_cases_tiny.swift b/test/IRGen/big_types_corner_cases_tiny.swift index 5ac56700330e7..3907e86260804 100644 --- a/test/IRGen/big_types_corner_cases_tiny.swift +++ b/test/IRGen/big_types_corner_cases_tiny.swift @@ -6,6 +6,6 @@ // CHECK-LABEL: define internal void @{{.*}}WZ // CHECK: [[ALLOC:%.*]] = alloca %T27big_types_corner_cases_tiny30LoadableStructWithBiggerStringV -// CHECK: call swiftcc void {{.*}}(ptr noalias captures(none) sret({{.*}}) [[ALLOC]] +// CHECK: call swiftcc void {{.*}}(ptr noalias nocapture sret({{.*}}) [[ALLOC]] let model = ClassWithLoadableStructWithBiggerString().f() diff --git a/test/IRGen/big_types_tests.sil b/test/IRGen/big_types_tests.sil index dfea630d68daa..acd9a7161a75b 100644 --- a/test/IRGen/big_types_tests.sil +++ b/test/IRGen/big_types_tests.sil @@ -19,7 +19,7 @@ public struct BigStruct { var i8 : Int32 = 8 } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @testDestroyValue(ptr noalias captures(none) dereferenceable({{.*}}) #0 { +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @testDestroyValue(ptr noalias nocapture dereferenceable({{.*}}) #0 { // CHECK-NEXT: entry // CHECK-NEXT: ret void sil @testDestroyValue : $@convention(thin) (@owned BigStruct) -> () { diff --git a/test/IRGen/builtin_pack_length.swift b/test/IRGen/builtin_pack_length.swift index 10de5b275c66e..e543df1d4e020 100644 --- a/test/IRGen/builtin_pack_length.swift +++ b/test/IRGen/builtin_pack_length.swift @@ -31,7 +31,7 @@ func weirdPackCountUse1(_ x: repeat each T) -> Builtin.Word { } struct Pack { -// CHECK: define {{.*}} @"$s8builtins4PackV5countBwvgZ"(i64 returned [[PACK_COUNT:%.*]], ptr captures(none) readnone %"each T") +// CHECK: define {{.*}} @"$s8builtins4PackV5countBwvgZ"(i64 returned [[PACK_COUNT:%.*]], ptr nocapture readnone %"each T") // CHECK-NEXT: entry: // CHECK-NEXT: ret i64 [[PACK_COUNT]] static var count: Builtin.Word { diff --git a/test/IRGen/builtins.swift b/test/IRGen/builtins.swift index 9244a3ddd4356..58bb064e21e7a 100644 --- a/test/IRGen/builtins.swift +++ b/test/IRGen/builtins.swift @@ -638,11 +638,11 @@ func zeroInitializerEmpty() { // isUnique variants // ---------------------------------------------------------------------------- -// CHECK: define hidden {{.*}}void @"$s8builtins26acceptsBuiltinNativeObjectyyBoSgzF"(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK: define hidden {{.*}}void @"$s8builtins26acceptsBuiltinNativeObjectyyBoSgzF"(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { func acceptsBuiltinNativeObject(_ ref: inout Builtin.NativeObject?) {} // native -// CHECK-LABEL: define hidden {{.*}}i1 @"$s8builtins8isUniqueyBi1_BoSgzF"(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-LABEL: define hidden {{.*}}i1 @"$s8builtins8isUniqueyBi1_BoSgzF"(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { // CHECK-NEXT: entry: // CHECK: %[[LD_RC:.+]] = load ptr, ptr %0 // CHECK-NEXT: %[[RET:.+]] = call zeroext i1 @swift_isUniquelyReferenced_native(ptr %[[LD_RC]]) @@ -652,7 +652,7 @@ func isUnique(_ ref: inout Builtin.NativeObject?) -> Bool { } // native nonNull -// CHECK-LABEL: define hidden {{.*}}i1 @"$s8builtins8isUniqueyBi1_BozF"(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-LABEL: define hidden {{.*}}i1 @"$s8builtins8isUniqueyBi1_BozF"(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { // CHECK-NEXT: entry: // CHECK: %[[LD_RC:.+]] = load ptr, ptr %0 // CHECK: %[[RET:.+]] = call zeroext i1 @swift_isUniquelyReferenced_nonNull_native(ptr %[[LD_RC]]) @@ -661,11 +661,11 @@ func isUnique(_ ref: inout Builtin.NativeObject) -> Bool { return Builtin.isUnique(&ref) } -// CHECK: define hidden {{.*}}void @"$s8builtins16acceptsAnyObjectyyyXlSgzF"(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK: define hidden {{.*}}void @"$s8builtins16acceptsAnyObjectyyyXlSgzF"(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { func acceptsAnyObject(_ ref: inout Builtin.AnyObject?) {} // ObjC -// CHECK-LABEL: define hidden {{.*}}i1 @"$s8builtins8isUniqueyBi1_yXlSgzF"(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-LABEL: define hidden {{.*}}i1 @"$s8builtins8isUniqueyBi1_yXlSgzF"(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { // CHECK-NEXT: entry: // CHECK: [[ADDR:%.+]] = getelementptr inbounds{{.*}} [[OPTIONAL_ANYOBJECT_TY:%.*]], ptr %0, i32 0, i32 0 // CHECK-NEXT: [[REF:%.+]] = load ptr, ptr [[ADDR]] @@ -678,7 +678,7 @@ func isUnique(_ ref: inout Builtin.AnyObject?) -> Bool { // ObjC nonNull // CHECK-LABEL: define hidden {{.*}}i1 @"$s8builtins8isUniqueyBi1_yXlzF" -// CHECK-SAME: (ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-SAME: (ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { // CHECK-NEXT: entry: // CHECK: [[ADDR:%.+]] = getelementptr inbounds{{.*}} %AnyObject, ptr %0, i32 0, i32 0 // CHECK: [[REF:%.+]] = load ptr, ptr [[ADDR]] @@ -690,7 +690,7 @@ func isUnique(_ ref: inout Builtin.AnyObject) -> Bool { } // BridgeObject nonNull -// CHECK-LABEL: define hidden {{.*}}i1 @"$s8builtins8isUniqueyBi1_BbzF"(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-LABEL: define hidden {{.*}}i1 @"$s8builtins8isUniqueyBi1_BbzF"(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { // CHECK-NEXT: entry: // CHECK: %[[LD:.+]] = load ptr, ptr %0 // CHECK: %[[RET:.+]] = call zeroext i1 @swift_isUniquelyReferenced{{(NonObjC)?}}_nonNull_bridgeObject(ptr %[[LD]]) @@ -706,7 +706,7 @@ func assumeTrue(_ x: Builtin.Int1) { Builtin.assume_Int1(x) } // BridgeObject nonNull -// CHECK-LABEL: define hidden {{.*}}i1 @"$s8builtins15isUnique_nativeyBi1_BbzF"(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-LABEL: define hidden {{.*}}i1 @"$s8builtins15isUnique_nativeyBi1_BbzF"(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { // CHECK-NEXT: entry: // CHECK: %[[LD:.+]] = load ptr, ptr %0 // CHECK-NEXT: %[[RET:.+]] = call zeroext i1 @swift_isUniquelyReferenced_nonNull_native(ptr %[[LD]]) @@ -716,7 +716,7 @@ func isUnique_native(_ ref: inout Builtin.BridgeObject) -> Bool { } // ImplicitlyUnwrappedOptional argument to isUnique. -// CHECK-LABEL: define hidden {{.*}}i1 @"$s8builtins11isUniqueIUOyBi1_BoSgzF"(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-LABEL: define hidden {{.*}}i1 @"$s8builtins11isUniqueIUOyBi1_BoSgzF"(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { // CHECK-NEXT: entry: // CHECK: call zeroext i1 @swift_isUniquelyReferenced_native(ptr // CHECK: ret i1 diff --git a/test/IRGen/c_layout.sil b/test/IRGen/c_layout.sil index de1bf5c53832d..bf206477193f2 100644 --- a/test/IRGen/c_layout.sil +++ b/test/IRGen/c_layout.sil @@ -32,7 +32,7 @@ bb0: // CHECK-x86_64: [[RESULT:%.*]] = alloca %TSo11BitfieldOneV, align 8 // CHECK-x86_64: [[ARG:%.*]] = alloca %TSo11BitfieldOneV, align 8 // Make the first call and pull all the values out of the indirect result. -// CHECK-x86_64: call void @createBitfieldOne(ptr noalias captures(none) sret({{.*}}) [[RESULT]]) +// CHECK-x86_64: call void @createBitfieldOne(ptr noalias nocapture sret({{.*}}) [[RESULT]]) // CHECK-x86_64: [[ADDR_A:%.*]] = getelementptr inbounds{{.*}} %TSo11BitfieldOneV, ptr [[RESULT]], i32 0, i32 0 // CHECK-x86_64: [[ADDR_A_V:%.*]] = getelementptr inbounds{{.*}} %Ts6UInt32V, ptr [[ADDR_A]], i32 0, i32 0 // CHECK-x86_64: [[A:%.*]] = load i32, ptr [[ADDR_A_V]], align 8 @@ -102,7 +102,7 @@ sil public_external @consumeSIMDStruct : $@convention(c) (SIMDStruct) -> () // CHECK-x86_64-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @testSIMDStruct() // CHECK-SYSV-x86_64: call <3 x float> @createSIMDStruct -// CHECK-WIN-x86_64: call void @createSIMDStruct(ptr noalias captures(none) sret({{.*}}) % +// CHECK-WIN-x86_64: call void @createSIMDStruct(ptr noalias nocapture sret({{.*}}) % // CHECK-SYSV-x86_64: call void @consumeSIMDStruct(<3 x float> // CHECK-WIN-x86_64: call void @consumeSIMDStruct(ptr % sil @testSIMDStruct : $() -> () { @@ -389,8 +389,8 @@ entry(%b : $@convention(block) (CChar) -> CChar, %c : $CChar): } // CHECK-x86_64-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @testBitfieldInBlock -// CHECK-SYSV-x86_64: call void {{%.*}}(ptr noalias captures(none) sret({{.*}}) {{%.*}}, ptr {{%.*}}, ptr byval({{.*}}) align 8 {{%.*}}) -// CHECK-WIN-x86_64: call void {{%.*}}(ptr noalias captures(none) sret({{.*}}) {{%.*}}, ptr {{%.*}}, ptr {{%.*}}) +// CHECK-SYSV-x86_64: call void {{%.*}}(ptr noalias nocapture sret({{.*}}) {{%.*}}, ptr {{%.*}}, ptr byval({{.*}}) align 8 {{%.*}}) +// CHECK-WIN-x86_64: call void {{%.*}}(ptr noalias nocapture sret({{.*}}) {{%.*}}, ptr {{%.*}}, ptr {{%.*}}) sil @testBitfieldInBlock : $@convention(thin) (@owned @convention(block) (BitfieldOne) -> BitfieldOne, BitfieldOne) -> BitfieldOne { entry(%b : $@convention(block) (BitfieldOne) -> BitfieldOne, %x : $BitfieldOne): %r = apply %b(%x) : $@convention(block) (BitfieldOne) -> BitfieldOne diff --git a/test/IRGen/casts.sil b/test/IRGen/casts.sil index 64b00ad43cd60..13f0967353f4f 100644 --- a/test/IRGen/casts.sil +++ b/test/IRGen/casts.sil @@ -15,7 +15,7 @@ class B: A {} sil_vtable A {} sil_vtable B {} -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @unchecked_addr_cast(ptr noalias captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @unchecked_addr_cast(ptr noalias nocapture dereferenceable({{.*}}) %0) {{.*}} { sil @unchecked_addr_cast : $(@in A) -> B { entry(%a : $*A): %b = unchecked_addr_cast %a : $*A to $*B diff --git a/test/IRGen/class_field_other_module.swift b/test/IRGen/class_field_other_module.swift index 0b5622885f236..7785283301891 100644 --- a/test/IRGen/class_field_other_module.swift +++ b/test/IRGen/class_field_other_module.swift @@ -7,7 +7,7 @@ import other_class -// CHECK-LABEL: define {{(protected )?}}{{(dllexport )?}}swiftcc i32 @"$s24class_field_other_module12getSubclassXys5Int32V0c1_A00F0CF"(ptr captures(none) readonly %0) +// CHECK-LABEL: define {{(protected )?}}{{(dllexport )?}}swiftcc i32 @"$s24class_field_other_module12getSubclassXys5Int32V0c1_A00F0CF"(ptr nocapture readonly %0) // CHECK-NEXT: entry: // An Int32 after the heap object header // CHECK-NEXT: [[GEP:%.*]] = getelementptr inbounds{{.*}} i8, ptr %0, i64 16 @@ -17,7 +17,7 @@ public func getSubclassX(_ o: Subclass) -> Int32 { return o.x } -// CHECK-LABEL: define {{(protected )?}}{{(dllexport )?}}swiftcc i32 @"$s24class_field_other_module12getSubclassYys5Int32V0c1_A00F0CF"(ptr captures(none) readonly %0) +// CHECK-LABEL: define {{(protected )?}}{{(dllexport )?}}swiftcc i32 @"$s24class_field_other_module12getSubclassYys5Int32V0c1_A00F0CF"(ptr nocapture readonly %0) // CHECK-NEXT: entry: // An Int32 after an Int32 after the heap object header // CHECK-NEXT: [[GEP:%.*]] = getelementptr inbounds{{.*}} i8, ptr %0, i64 20 diff --git a/test/IRGen/conditional_conformances_class_with_defaulted_method.swift b/test/IRGen/conditional_conformances_class_with_defaulted_method.swift index 05b321bd9b5ca..1118b4ba4803d 100644 --- a/test/IRGen/conditional_conformances_class_with_defaulted_method.swift +++ b/test/IRGen/conditional_conformances_class_with_defaulted_method.swift @@ -12,4 +12,4 @@ extension Foo { } class Box {} extension Box: Foo where T: Foo {} -// CHECK-LABEL: define internal swiftcc void @"$s1x3BoxCyqd__GAA3FooA2aEP3baryyFTW"(ptr noalias captures(none) swiftself dereferenceable({{[48]}}) %0, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define internal swiftcc void @"$s1x3BoxCyqd__GAA3FooA2aEP3baryyFTW"(ptr noalias nocapture swiftself dereferenceable({{[48]}}) %0, ptr %Self, ptr %SelfWitnessTable) diff --git a/test/IRGen/coroutine_accessors.swift b/test/IRGen/coroutine_accessors.swift index f6700e3843bf1..0b3f586f9f41c 100644 --- a/test/IRGen/coroutine_accessors.swift +++ b/test/IRGen/coroutine_accessors.swift @@ -126,7 +126,7 @@ public var irm: Int { // CHECK-LABEL: define{{.*}} { ptr, ptr } @"$s19coroutine_accessors1SV3irmSivx"( // CHECK-SAME: ptr noalias [[FRAME:%[^,]+]], // CHECK-SAME: ptr swiftcoro [[ALLOCATOR:%[^,]+]], -// CHECK-SAME: ptr captures(none) swiftself dereferenceable({{8|16}}) [[SELF:%[^)]+]] +// CHECK-SAME: ptr nocapture swiftself dereferenceable({{8|16}}) [[SELF:%[^)]+]] // CHECK-SAME: ) // CHECK-SAME: { // CHECK: [[ID:%[^,]+]] = call token @llvm.coro.id.retcon.once.dynamic( @@ -293,7 +293,7 @@ public var force_yield_once_2_convention : () { // CHECK-LABEL: define{{.*}} { ptr, ptr } @increment_irm_yield_once_2( // ptr noalias %0 // CHECK-SAME: ptr swiftcoro [[ALLOCATOR:%[^,]+]] -// ptr captures(none) swiftself dereferenceable(16) %2 +// ptr nocapture swiftself dereferenceable(16) %2 // CHECK-SAME: ) // CHECK-SAME: { // : [[SIZE_32:%[^,]+]] = load i32 diff --git a/test/IRGen/coroutine_accessors_backdeploy_async_56.swift b/test/IRGen/coroutine_accessors_backdeploy_async_56.swift index 327fb4abd943a..5ad8a79ac62d4 100644 --- a/test/IRGen/coroutine_accessors_backdeploy_async_56.swift +++ b/test/IRGen/coroutine_accessors_backdeploy_async_56.swift @@ -126,7 +126,7 @@ public var i: Int { // CHECK-LABEL: define{{.*}} void @increment_i_async( // ptr swiftasync %0 -// CHECK-SAME: ptr captures(none) swiftself dereferenceable({{8|4}}) %1 +// CHECK-SAME: ptr nocapture swiftself dereferenceable({{8|4}}) %1 // CHECK-SAME: ) // CHECK-SAME: { // : [[SIZE_32:%[^,]+]] = load i32 diff --git a/test/IRGen/coroutine_accessors_backdeploy_async_57.swift b/test/IRGen/coroutine_accessors_backdeploy_async_57.swift index 987332e34c1c8..117c310ef3aea 100644 --- a/test/IRGen/coroutine_accessors_backdeploy_async_57.swift +++ b/test/IRGen/coroutine_accessors_backdeploy_async_57.swift @@ -101,7 +101,7 @@ public var i: Int { // CHECK-LABEL: define{{.*}} void @increment_i_async( // ptr swiftasync %0 -// CHECK-SAME: ptr captures(none) swiftself dereferenceable({{8|4}}) %1 +// CHECK-SAME: ptr nocapture swiftself dereferenceable({{8|4}}) %1 // CHECK-SAME: ) // CHECK-SAME: { // : [[SIZE_32:%[^,]+]] = load i32 diff --git a/test/IRGen/dependent_reabstraction.swift b/test/IRGen/dependent_reabstraction.swift index 5eed638512ca9..c0250b8f00b17 100644 --- a/test/IRGen/dependent_reabstraction.swift +++ b/test/IRGen/dependent_reabstraction.swift @@ -8,7 +8,7 @@ protocol A { } struct X : A { - // CHECK-LABEL: define internal swiftcc void @"$s23dependent_reabstraction1XVyxGAA1AA2aEP1byy1BQzFTW"(ptr noalias captures(none) dereferenceable({{.*}}) %0, ptr noalias captures(none) swiftself %1, ptr %Self, ptr %SelfWitnessTable) + // CHECK-LABEL: define internal swiftcc void @"$s23dependent_reabstraction1XVyxGAA1AA2aEP1byy1BQzFTW"(ptr noalias nocapture dereferenceable({{.*}}) %0, ptr noalias nocapture swiftself %1, ptr %Self, ptr %SelfWitnessTable) func b(_ b: X.Type) { let x: Any = b markUsed(b as X.Type) diff --git a/test/IRGen/enum.sil b/test/IRGen/enum.sil index fe7863687dfea..bea3454e41a98 100644 --- a/test/IRGen/enum.sil +++ b/test/IRGen/enum.sil @@ -238,7 +238,7 @@ dest(%u2 : $(Builtin.Int64, Builtin.Int64)): return %x : $() } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @singleton_switch_indirect(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @singleton_switch_indirect(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { // CHECK: entry: // CHECK: br label %[[DEST:[0-9]+]] // CHECK: [[DEST]]: @@ -274,7 +274,7 @@ entry(%0 : $Builtin.Int64, %1 : $Builtin.Int64): return %u : $Singleton } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @singleton_inject_indirect(i64 %0, i64 %1, ptr captures(none) dereferenceable({{.*}}) %2) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @singleton_inject_indirect(i64 %0, i64 %1, ptr nocapture dereferenceable({{.*}}) %2) {{.*}} { // CHECK: entry: // CHECK: [[DATA_0_ADDR:%.*]] = getelementptr inbounds{{.*}} <{ i64, i64 }>, ptr %2, i32 0, i32 0 // CHECK: store i64 %0, ptr [[DATA_0_ADDR]] @@ -349,7 +349,7 @@ end: return %x : $() } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @no_payload_switch_indirect(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @no_payload_switch_indirect(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { sil @no_payload_switch_indirect : $@convention(thin) (@inout NoPayloads) -> () { entry(%u : $*NoPayloads): // CHECK: [[TAG_ADDR:%.*]] = getelementptr inbounds{{.*}} %T4enum10NoPayloadsO, ptr %0, i32 0, i32 0 @@ -398,7 +398,7 @@ entry: return %u : $NoPayloads } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @no_payload_inject_z_indirect(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @no_payload_inject_z_indirect(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { // CHECK: entry: // CHECK: [[TAG_ADDR:%.*]] = getelementptr inbounds{{.*}} %T4enum10NoPayloadsO, ptr %0, i32 0, i32 0 // CHECK: store i8 2, ptr [[TAG_ADDR]] @@ -629,7 +629,7 @@ entry(%0 : $Builtin.Word): return %u : $SinglePayloadNoXI2 } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @single_payload_no_xi_inject_x_indirect([[WORD]] %0, ptr captures(none) dereferenceable({{.*}}) %1) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @single_payload_no_xi_inject_x_indirect([[WORD]] %0, ptr nocapture dereferenceable({{.*}}) %1) {{.*}} { // CHECK: entry: // CHECK: store [[WORD]] %0, ptr %1 // CHECK: [[T0:%.*]] = getelementptr inbounds{{.*}} %T4enum18SinglePayloadNoXI2O, ptr %1, i32 0, i32 1 @@ -655,7 +655,7 @@ entry: return %u : $SinglePayloadNoXI2 } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @single_payload_no_xi_inject_y_indirect(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @single_payload_no_xi_inject_y_indirect(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { // CHECK: entry: // CHECK: store [[WORD]] 0, ptr %0 // CHECK: [[T0:%.*]] = getelementptr inbounds{{.*}} %T4enum18SinglePayloadNoXI2O, ptr %0, i32 0, i32 1 @@ -992,7 +992,7 @@ entry(%0 : $Builtin.Int63): return %u : $SinglePayloadSpareBit } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @single_payload_spare_bit_inject_x_indirect(i64 %0, ptr captures(none) dereferenceable({{.*}}) %1) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @single_payload_spare_bit_inject_x_indirect(i64 %0, ptr nocapture dereferenceable({{.*}}) %1) {{.*}} { // CHECK-64: entry: // CHECK-64: [[T:%.*]] = trunc i64 %0 to i63 // CHECK-64: [[BYTE:%.*]] = zext i63 [[T]] to i64 @@ -1019,7 +1019,7 @@ entry: return %u : $SinglePayloadSpareBit } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @single_payload_spare_bit_inject_y_indirect(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @single_payload_spare_bit_inject_y_indirect(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { // CHECK-64: entry: // -- 0x8000_0000_0000_0000 // CHECK-64: store i64 -9223372036854775808, ptr %0 @@ -1304,7 +1304,7 @@ end(%z : $()): return %z : $() } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc i8 @dynamic_single_payload_empty_payload_load(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc i8 @dynamic_single_payload_empty_payload_load(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { // CHECK: entry: // CHECK: %1 = load i8, ptr %0 // CHECK: ret i8 %1 @@ -1315,7 +1315,7 @@ entry(%p : $*DynamicSinglePayload<()>): return %x : $DynamicSinglePayload<()> } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @dynamic_single_payload_empty_payload_store(ptr captures(none) dereferenceable({{.*}}) %0, i8 %1) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @dynamic_single_payload_empty_payload_store(ptr nocapture dereferenceable({{.*}}) %0, i8 %1) {{.*}} { // CHECK: entry: // CHECK: store i8 %1, ptr %0 // CHECK: ret void @@ -1440,7 +1440,7 @@ end: return %v : $() } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_no_spare_bits_switch_indirect(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_no_spare_bits_switch_indirect(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { sil @multi_payload_no_spare_bits_switch_indirect : $(@inout MultiPayloadNoSpareBits) -> () { entry(%u : $*MultiPayloadNoSpareBits): // CHECK-64: [[PAYLOAD:%.*]] = load i64, ptr %0 @@ -1494,7 +1494,7 @@ entry(%0 : $Builtin.Int64): return %u : $MultiPayloadNoSpareBits } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_no_spare_bit_inject_x_indirect(i64 %0, ptr captures(none) dereferenceable({{.*}}) %1) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_no_spare_bit_inject_x_indirect(i64 %0, ptr nocapture dereferenceable({{.*}}) %1) {{.*}} { // CHECK-64: entry: // CHECK-64: store i64 %0, ptr %1 // CHECK-64: [[T0:%.*]] = getelementptr inbounds{{.*}} %T4enum23MultiPayloadNoSpareBitsO, ptr %1, i32 0, i32 1 @@ -1547,7 +1547,7 @@ entry: return %u : $MultiPayloadNoSpareBits } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_no_spare_bit_inject_a_indirect(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_no_spare_bit_inject_a_indirect(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { // CHECK-64: entry: // CHECK-64: store i64 0, ptr %0 // CHECK-64: [[T0:%.*]] = getelementptr inbounds{{.*}} %T4enum23MultiPayloadNoSpareBitsO, ptr %0, i32 0, i32 1 @@ -1736,7 +1736,7 @@ entry(%0 : $Builtin.Int62): return %u : $MultiPayloadOneSpareBit } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_one_spare_bit_inject_x_indirect(i64 %0, ptr captures(none) dereferenceable({{.*}}) %1) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_one_spare_bit_inject_x_indirect(i64 %0, ptr nocapture dereferenceable({{.*}}) %1) {{.*}} { // CHECK-64: entry: // CHECK-64: [[NATIVECC_TRUNC:%.*]] = trunc i64 %0 to i62 // CHECK-64: [[BYTE:%.*]] = zext i62 [[NATIVECC_TRUNC]] to i64 @@ -1774,7 +1774,7 @@ entry(%0 : $Builtin.Int63): return %u : $MultiPayloadOneSpareBit } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_one_spare_bit_inject_y_indirect(i64 %0, ptr captures(none) dereferenceable({{.*}}) %1) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_one_spare_bit_inject_y_indirect(i64 %0, ptr nocapture dereferenceable({{.*}}) %1) {{.*}} { // CHECK-64: entry: // CHECK-64: [[NATIVECC_TRUNC:%.*]] = trunc i64 %0 to i63 // CHECK-64: [[BYTE:%.*]] = zext i63 [[NATIVECC_TRUNC]] to i64 @@ -1824,7 +1824,7 @@ entry: return %u : $MultiPayloadOneSpareBit } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_one_spare_bit_inject_a_indirect(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_one_spare_bit_inject_a_indirect(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { // CHECK-64: entry: // -- 0x8000_0000_0000_0000 // CHECK-64: store i64 -9223372036854775808, ptr %0 @@ -1968,7 +1968,7 @@ entry(%0 : $Builtin.Int62): return %u : $MultiPayloadTwoSpareBits } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_two_spare_bits_inject_x_indirect(i64 %0, ptr captures(none) dereferenceable({{.*}}) %1) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_two_spare_bits_inject_x_indirect(i64 %0, ptr nocapture dereferenceable({{.*}}) %1) {{.*}} { // CHECK-64: entry: // CHECK-64: [[NATIVECC_TRUNC:%.*]] = trunc i64 %0 to i62 // CHECK-64: [[BYTE:%.*]] = zext i62 [[NATIVECC_TRUNC]] to i64 @@ -2002,7 +2002,7 @@ entry(%0 : $Builtin.Int60): return %u : $MultiPayloadTwoSpareBits } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_two_spare_bits_inject_y_indirect(i64 %0, ptr captures(none) dereferenceable({{.*}}) %1) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_two_spare_bits_inject_y_indirect(i64 %0, ptr nocapture dereferenceable({{.*}}) %1) {{.*}} { // CHECK-64: entry: // CHECK-64: [[NATIVECC_TRUNC:%.*]] = trunc i64 %0 to i60 // CHECK-64: [[BYTE:%.*]] = zext i60 [[NATIVECC_TRUNC]] to i64 @@ -2049,7 +2049,7 @@ entry: return %u : $MultiPayloadTwoSpareBits } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_two_spare_bits_inject_a_indirect(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_two_spare_bits_inject_a_indirect(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { // CHECK-64: entry: // -- 0xC000_0000_0000_0000 // CHECK-64: store i64 -4611686018427387904, ptr %0 @@ -2254,7 +2254,7 @@ enum MultiPayloadNestedSpareBits { case B(MultiPayloadInnerSpareBits) } -// CHECK-64-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_nested_spare_bits_switch(ptr noalias captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-64-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_nested_spare_bits_switch(ptr noalias nocapture dereferenceable({{.*}}) %0) {{.*}} { // CHECK-64: entry: // CHECK-64: %1 = load [[WORD]], ptr %0 // CHECK-64: %2 = lshr [[WORD]] %1, 61 @@ -2326,7 +2326,7 @@ enum MultiPayloadAddressOnlyFixed { case Y(Builtin.Int32) } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_address_only_destroy(ptr noalias captures(none) dereferenceable({{.*}}) %0) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_address_only_destroy(ptr noalias nocapture dereferenceable({{.*}}) %0) sil @multi_payload_address_only_destroy : $@convention(thin) (@in MultiPayloadAddressOnlyFixed) -> () { entry(%m : $*MultiPayloadAddressOnlyFixed): destroy_addr %m : $*MultiPayloadAddressOnlyFixed diff --git a/test/IRGen/enum_derived.swift b/test/IRGen/enum_derived.swift index c15b4820f36ee..02f91193ec81d 100644 --- a/test/IRGen/enum_derived.swift +++ b/test/IRGen/enum_derived.swift @@ -48,8 +48,8 @@ extension def_enum.TrafficLight : Error {} extension def_enum.Term : Error {} -// CHECK-NORMAL-LABEL: define hidden {{.*}}i64 @"$s12enum_derived7PhantomO8rawValues5Int64Vvg"(i8 %0, ptr captures(none) readnone %T) local_unnamed_addr -// CHECK-TESTABLE-LABEL: define{{( dllexport)?}}{{( protected)?}} {{.*}}i64 @"$s12enum_derived7PhantomO8rawValues5Int64Vvg"(i8 %0, ptr captures(none) readnone %T) +// CHECK-NORMAL-LABEL: define hidden {{.*}}i64 @"$s12enum_derived7PhantomO8rawValues5Int64Vvg"(i8 %0, ptr nocapture readnone %T) local_unnamed_addr +// CHECK-TESTABLE-LABEL: define{{( dllexport)?}}{{( protected)?}} {{.*}}i64 @"$s12enum_derived7PhantomO8rawValues5Int64Vvg"(i8 %0, ptr nocapture readnone %T) enum Phantom : Int64 { case Up diff --git a/test/IRGen/enum_future.sil b/test/IRGen/enum_future.sil index 8ad6d46bacff7..f9b48420f53ce 100644 --- a/test/IRGen/enum_future.sil +++ b/test/IRGen/enum_future.sil @@ -242,7 +242,7 @@ dest(%u2 : $(Builtin.Int64, Builtin.Int64)): return %x : $() } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @singleton_switch_indirect(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @singleton_switch_indirect(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { // CHECK: entry: // CHECK: br label %[[DEST:[0-9]+]] // CHECK: [[DEST]]: @@ -278,7 +278,7 @@ entry(%0 : $Builtin.Int64, %1 : $Builtin.Int64): return %u : $Singleton } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @singleton_inject_indirect(i64 %0, i64 %1, ptr captures(none) dereferenceable({{.*}}) %2) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @singleton_inject_indirect(i64 %0, i64 %1, ptr nocapture dereferenceable({{.*}}) %2) {{.*}} { // CHECK: entry: // CHECK: [[DATA_0_ADDR:%.*]] = getelementptr inbounds{{.*}} <{ i64, i64 }>, ptr %2, i32 0, i32 0 // CHECK: store i64 %0, ptr [[DATA_0_ADDR]] @@ -353,7 +353,7 @@ end: return %x : $() } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @no_payload_switch_indirect(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @no_payload_switch_indirect(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { sil @no_payload_switch_indirect : $@convention(thin) (@inout NoPayloads) -> () { entry(%u : $*NoPayloads): // CHECK: [[TAG_ADDR:%.*]] = getelementptr inbounds{{.*}} %T11enum_future10NoPayloadsO, ptr %0, i32 0, i32 0 @@ -402,7 +402,7 @@ entry: return %u : $NoPayloads } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @no_payload_inject_z_indirect(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @no_payload_inject_z_indirect(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { // CHECK: entry: // CHECK: [[TAG_ADDR:%.*]] = getelementptr inbounds{{.*}} %T11enum_future10NoPayloadsO, ptr %0, i32 0, i32 0 // CHECK: store i8 2, ptr [[TAG_ADDR]] @@ -633,7 +633,7 @@ entry(%0 : $Builtin.Word): return %u : $SinglePayloadNoXI2 } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @single_payload_no_xi_inject_x_indirect([[WORD]] %0, ptr captures(none) dereferenceable({{.*}}) %1) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @single_payload_no_xi_inject_x_indirect([[WORD]] %0, ptr nocapture dereferenceable({{.*}}) %1) {{.*}} { // CHECK: entry: // CHECK: store [[WORD]] %0, ptr %1 // CHECK: [[T0:%.*]] = getelementptr inbounds{{.*}} %T11enum_future18SinglePayloadNoXI2O, ptr %1, i32 0, i32 1 @@ -659,7 +659,7 @@ entry: return %u : $SinglePayloadNoXI2 } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @single_payload_no_xi_inject_y_indirect(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @single_payload_no_xi_inject_y_indirect(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { // CHECK: entry: // CHECK: store [[WORD]] 0, ptr %0 // CHECK: [[T0:%.*]] = getelementptr inbounds{{.*}} %T11enum_future18SinglePayloadNoXI2O, ptr %0, i32 0, i32 1 @@ -996,7 +996,7 @@ entry(%0 : $Builtin.Int63): return %u : $SinglePayloadSpareBit } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @single_payload_spare_bit_inject_x_indirect(i64 %0, ptr captures(none) dereferenceable({{.*}}) %1) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @single_payload_spare_bit_inject_x_indirect(i64 %0, ptr nocapture dereferenceable({{.*}}) %1) {{.*}} { // CHECK-64: entry: // CHECK-64: [[T:%.*]] = trunc i64 %0 to i63 // CHECK-64: [[BYTE:%.*]] = zext i63 [[T]] to i64 @@ -1023,7 +1023,7 @@ entry: return %u : $SinglePayloadSpareBit } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @single_payload_spare_bit_inject_y_indirect(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @single_payload_spare_bit_inject_y_indirect(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { // CHECK-64: entry: // -- 0x8000_0000_0000_0000 // CHECK-64: store i64 -9223372036854775808, ptr %0 @@ -1308,7 +1308,7 @@ end(%z : $()): return %z : $() } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc i8 @dynamic_single_payload_empty_payload_load(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc i8 @dynamic_single_payload_empty_payload_load(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { // CHECK: entry: // CHECK: %1 = load i8, ptr %0 // CHECK: ret i8 %1 @@ -1319,7 +1319,7 @@ entry(%p : $*DynamicSinglePayload<()>): return %x : $DynamicSinglePayload<()> } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @dynamic_single_payload_empty_payload_store(ptr captures(none) dereferenceable({{.*}}) %0, i8 %1) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @dynamic_single_payload_empty_payload_store(ptr nocapture dereferenceable({{.*}}) %0, i8 %1) {{.*}} { // CHECK: entry: // CHECK: store i8 %1, ptr %0 // CHECK: ret void @@ -1444,7 +1444,7 @@ end: return %v : $() } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_no_spare_bits_switch_indirect(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_no_spare_bits_switch_indirect(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { sil @multi_payload_no_spare_bits_switch_indirect : $(@inout MultiPayloadNoSpareBits) -> () { entry(%u : $*MultiPayloadNoSpareBits): // CHECK-64: [[PAYLOAD:%.*]] = load i64, ptr %0 @@ -1498,7 +1498,7 @@ entry(%0 : $Builtin.Int64): return %u : $MultiPayloadNoSpareBits } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_no_spare_bit_inject_x_indirect(i64 %0, ptr captures(none) dereferenceable({{.*}}) %1) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_no_spare_bit_inject_x_indirect(i64 %0, ptr nocapture dereferenceable({{.*}}) %1) {{.*}} { // CHECK-64: entry: // CHECK-64: store i64 %0, ptr %1 // CHECK-64: [[T0:%.*]] = getelementptr inbounds{{.*}} %T11enum_future23MultiPayloadNoSpareBitsO, ptr %1, i32 0, i32 1 @@ -1551,7 +1551,7 @@ entry: return %u : $MultiPayloadNoSpareBits } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_no_spare_bit_inject_a_indirect(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_no_spare_bit_inject_a_indirect(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { // CHECK-64: entry: // CHECK-64: store i64 0, ptr %0 // CHECK-64: [[T0:%.*]] = getelementptr inbounds{{.*}} %T11enum_future23MultiPayloadNoSpareBitsO, ptr %0, i32 0, i32 1 @@ -1740,7 +1740,7 @@ entry(%0 : $Builtin.Int62): return %u : $MultiPayloadOneSpareBit } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_one_spare_bit_inject_x_indirect(i64 %0, ptr captures(none) dereferenceable({{.*}}) %1) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_one_spare_bit_inject_x_indirect(i64 %0, ptr nocapture dereferenceable({{.*}}) %1) {{.*}} { // CHECK-64: entry: // CHECK-64: [[NATIVECC_TRUNC:%.*]] = trunc i64 %0 to i62 // CHECK-64: [[VAL:%.*]] = zext i62 [[NATIVECC_TRUNC]] to i64 @@ -1778,7 +1778,7 @@ entry(%0 : $Builtin.Int63): return %u : $MultiPayloadOneSpareBit } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_one_spare_bit_inject_y_indirect(i64 %0, ptr captures(none) dereferenceable({{.*}}) %1) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_one_spare_bit_inject_y_indirect(i64 %0, ptr nocapture dereferenceable({{.*}}) %1) {{.*}} { // CHECK-64: entry: // CHECK-64: [[NATIVECC_TRUNC:%.*]] = trunc i64 %0 to i63 // CHECK-64: [[VAL:%.*]] = zext i63 [[NATIVECC_TRUNC]] to i64 @@ -1828,7 +1828,7 @@ entry: return %u : $MultiPayloadOneSpareBit } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_one_spare_bit_inject_a_indirect(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_one_spare_bit_inject_a_indirect(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { // CHECK-64: entry: // -- 0x8000_0000_0000_0000 // CHECK-64: store i64 -9223372036854775808, ptr %0 @@ -1972,7 +1972,7 @@ entry(%0 : $Builtin.Int62): return %u : $MultiPayloadTwoSpareBits } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_two_spare_bits_inject_x_indirect(i64 %0, ptr captures(none) dereferenceable({{.*}}) %1) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_two_spare_bits_inject_x_indirect(i64 %0, ptr nocapture dereferenceable({{.*}}) %1) {{.*}} { // CHECK-64: entry: // CHECK-64: [[NATIVECC_TRUNC:%.*]] = trunc i64 %0 to i62 // CHECK-64: [[VAL:%.*]] = zext i62 [[NATIVECC_TRUNC]] to i64 @@ -2006,7 +2006,7 @@ entry(%0 : $Builtin.Int60): return %u : $MultiPayloadTwoSpareBits } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_two_spare_bits_inject_y_indirect(i64 %0, ptr captures(none) dereferenceable({{.*}}) %1) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_two_spare_bits_inject_y_indirect(i64 %0, ptr nocapture dereferenceable({{.*}}) %1) {{.*}} { // CHECK-64: entry: // CHECK-64: [[NATIVECC_TRUNC:%.*]] = trunc i64 %0 to i60 // CHECK-64: [[VAL:%.*]] = zext i60 [[NATIVECC_TRUNC]] to i64 @@ -2053,7 +2053,7 @@ entry: return %u : $MultiPayloadTwoSpareBits } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_two_spare_bits_inject_a_indirect(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_two_spare_bits_inject_a_indirect(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { // CHECK-64: entry: // -- 0xC000_0000_0000_0000 // CHECK-64: store i64 -4611686018427387904, ptr %0 @@ -2258,7 +2258,7 @@ enum MultiPayloadNestedSpareBits { case B(MultiPayloadInnerSpareBits) } -// CHECK-64-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_nested_spare_bits_switch(ptr noalias captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-64-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_nested_spare_bits_switch(ptr noalias nocapture dereferenceable({{.*}}) %0) {{.*}} { // CHECK-64: entry: // CHECK-64: %1 = load [[WORD]], ptr %0 // CHECK-64: %2 = lshr [[WORD]] %1, 61 @@ -2330,7 +2330,7 @@ enum MultiPayloadAddressOnlyFixed { case Y(Builtin.Int32) } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_address_only_destroy(ptr noalias captures(none) dereferenceable({{.*}}) %0) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_address_only_destroy(ptr noalias nocapture dereferenceable({{.*}}) %0) sil @multi_payload_address_only_destroy : $@convention(thin) (@in MultiPayloadAddressOnlyFixed) -> () { entry(%m : $*MultiPayloadAddressOnlyFixed): destroy_addr %m : $*MultiPayloadAddressOnlyFixed diff --git a/test/IRGen/enum_resilience.swift b/test/IRGen/enum_resilience.swift index 0e3aa8c151146..3b73cb7ac1a3f 100644 --- a/test/IRGen/enum_resilience.swift +++ b/test/IRGen/enum_resilience.swift @@ -260,7 +260,7 @@ public func resilientEnumPartialApply(_ f: (Medium) -> Int) { } -// CHECK-LABEL: define internal swiftcc void @"$s14resilient_enum6MediumOSiIgnd_ACSiIegnr_TRTA"(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias %1, ptr swiftself %2) +// CHECK-LABEL: define internal swiftcc void @"$s14resilient_enum6MediumOSiIgnd_ACSiIegnr_TRTA"(ptr noalias nocapture sret({{.*}}) %0, ptr noalias %1, ptr swiftself %2) // Enums with resilient payloads from a different resilience domain diff --git a/test/IRGen/errors.sil b/test/IRGen/errors.sil index 217f619b8077c..fbb5d067594a3 100644 --- a/test/IRGen/errors.sil +++ b/test/IRGen/errors.sil @@ -79,8 +79,8 @@ entry(%0 : $AnyObject): // CHECK-wasm32: [[ERRORSLOT:%.*]] = alloca [[SWIFTERROR:.*]] ptr, align // CHECK-NEXT: store ptr null, ptr [[ERRORSLOT]], align - // CHECK-objc-NEXT: [[RESULT:%.*]] = call swiftcc ptr @try_apply_helper(ptr %0, ptr swiftself undef, ptr noalias captures(none) [[SWIFTERROR]]{{( )?}}dereferenceable({{.}}) [[ERRORSLOT]]) - // CHECK-native-NEXT: [[RESULT:%.*]] = call swiftcc ptr @try_apply_helper(ptr %0, ptr swiftself undef, ptr noalias captures(none) [[SWIFTERROR]]{{( )?}}dereferenceable({{.}}) [[ERRORSLOT]]) + // CHECK-objc-NEXT: [[RESULT:%.*]] = call swiftcc ptr @try_apply_helper(ptr %0, ptr swiftself undef, ptr noalias nocapture [[SWIFTERROR]]{{( )?}}dereferenceable({{.}}) [[ERRORSLOT]]) + // CHECK-native-NEXT: [[RESULT:%.*]] = call swiftcc ptr @try_apply_helper(ptr %0, ptr swiftself undef, ptr noalias nocapture [[SWIFTERROR]]{{( )?}}dereferenceable({{.}}) [[ERRORSLOT]]) // CHECK-NEXT: [[ERR:%.*]] = load ptr, ptr [[ERRORSLOT]], align // CHECK-NEXT: [[T0:%.*]] = icmp ne ptr [[ERR]], null // CHECK-NEXT: ptrtoint ptr [[ERR]] to i @@ -116,7 +116,7 @@ enum ColorError : Error { } // CHECK-LABEL: TestCallToWillThrowCallBack -// CHECK: call swiftcc void @swift_willThrow(ptr swiftself undef, ptr noalias captures(none) readonly [[SWIFTERROR]]{{( )?}}dereferenceable({{.}}) %2) +// CHECK: call swiftcc void @swift_willThrow(ptr swiftself undef, ptr noalias nocapture readonly [[SWIFTERROR]]{{( )?}}dereferenceable({{.}}) %2) // CHECK: store ptr %0 // CHECK: ret i64 undef sil hidden @TestCallToWillThrowCallBack : $@convention(thin) (@owned Error) -> (Int64, @error Error) { diff --git a/test/IRGen/existentials_objc.sil b/test/IRGen/existentials_objc.sil index 616a7c4b27b53..dc3be933dd6a3 100644 --- a/test/IRGen/existentials_objc.sil +++ b/test/IRGen/existentials_objc.sil @@ -22,7 +22,7 @@ bb0(%0 : $*Any, %1 : $T): return %3 : $() } -// CHECK-DAG: define{{( protected)?}} swiftcc void @init_opaque_existential(ptr noalias captures(none) sret({{.*}}) %0, ptr %1, ptr %T) {{.*}} { +// CHECK-DAG: define{{( protected)?}} swiftcc void @init_opaque_existential(ptr noalias nocapture sret({{.*}}) %0, ptr %1, ptr %T) {{.*}} { // CHECK: [[T0:%.*]] = getelementptr inbounds{{.*}} [[ANY:%Any]], ptr %0, i32 0, i32 1 // CHECK-NEXT: store ptr %T, ptr [[T0]], align 8 // CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds{{.*}} [[ANY]], ptr %0, i32 0, i32 0 @@ -37,7 +37,7 @@ bb0(%0 : $*Any, %1 : $*Any): return %3 : $() } -// CHECK-DAG: define{{( protected)?}} swiftcc void @take_opaque_existential(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias captures(none) dereferenceable({{.*}}) %1) {{.*}} { +// CHECK-DAG: define{{( protected)?}} swiftcc void @take_opaque_existential(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture dereferenceable({{.*}}) %1) {{.*}} { // CHECK: call ptr @"$sypWOb"(ptr %1, ptr %0) // CHECK-NEXT: ret void diff --git a/test/IRGen/extern_c_abitypes.swift b/test/IRGen/extern_c_abitypes.swift index 4a14163612ec4..34a9c818eb092 100644 --- a/test/IRGen/extern_c_abitypes.swift +++ b/test/IRGen/extern_c_abitypes.swift @@ -101,12 +101,12 @@ func test() { // assume %struct.c_struct and %TSo8c_structV have compatible layout // - // CHECK-x86_64: call void @c_roundtrip_c_struct(ptr noalias captures(none) sret(%TSo8c_structV) {{.*}}, ptr{{( byval\(%struct.c_struct\))?}}[[ALIGN:(align [0-9]+)?]] {{.*}}) - // CHECK-x86_64: call void @swift_roundtrip_c_struct(ptr noalias captures(none) sret(%TSo8c_structV) {{.*}}, ptr{{( byval\(%TSo8c_structV\))?}}[[ALIGN]] {{.*}}) - // CHECK-arm64: call void @c_roundtrip_c_struct(ptr noalias captures(none) sret(%TSo8c_structV) {{.*}}, ptr{{( byval\(%struct.c_struct\))?}}[[ALIGN:(align [0-9]+)?]] {{.*}}) - // CHECK-arm64: call void @swift_roundtrip_c_struct(ptr noalias captures(none) sret(%TSo8c_structV) {{.*}}, ptr{{( byval\(%TSo8c_structV\))?}}[[ALIGN]] {{.*}}) - // CHECK-wasm32: call void @c_roundtrip_c_struct(ptr noalias captures(none) sret(%TSo8c_structV) {{.*}}, ptr{{( byval\(%struct.c_struct\))?}}[[ALIGN:(align [0-9]+)?]] {{.*}}) - // CHECK-wasm32: call void @swift_roundtrip_c_struct(ptr noalias captures(none) sret(%TSo8c_structV) {{.*}}, ptr{{( byval\(%TSo8c_structV\))?}}[[ALIGN]] {{.*}}) + // CHECK-x86_64: call void @c_roundtrip_c_struct(ptr noalias nocapture sret(%TSo8c_structV) {{.*}}, ptr{{( byval\(%struct.c_struct\))?}}[[ALIGN:(align [0-9]+)?]] {{.*}}) + // CHECK-x86_64: call void @swift_roundtrip_c_struct(ptr noalias nocapture sret(%TSo8c_structV) {{.*}}, ptr{{( byval\(%TSo8c_structV\))?}}[[ALIGN]] {{.*}}) + // CHECK-arm64: call void @c_roundtrip_c_struct(ptr noalias nocapture sret(%TSo8c_structV) {{.*}}, ptr{{( byval\(%struct.c_struct\))?}}[[ALIGN:(align [0-9]+)?]] {{.*}}) + // CHECK-arm64: call void @swift_roundtrip_c_struct(ptr noalias nocapture sret(%TSo8c_structV) {{.*}}, ptr{{( byval\(%TSo8c_structV\))?}}[[ALIGN]] {{.*}}) + // CHECK-wasm32: call void @c_roundtrip_c_struct(ptr noalias nocapture sret(%TSo8c_structV) {{.*}}, ptr{{( byval\(%struct.c_struct\))?}}[[ALIGN:(align [0-9]+)?]] {{.*}}) + // CHECK-wasm32: call void @swift_roundtrip_c_struct(ptr noalias nocapture sret(%TSo8c_structV) {{.*}}, ptr{{( byval\(%TSo8c_structV\))?}}[[ALIGN]] {{.*}}) // CHECK-armv7k: call [3 x i32] @c_roundtrip_c_struct([3 x i32] {{.*}}) // CHECK-armv7k: call [3 x i32] @swift_roundtrip_c_struct([3 x i32] {{.*}}) var c_struct_val = c_struct(foo: 496, bar: 28, baz: 8) diff --git a/test/IRGen/fixlifetime.sil b/test/IRGen/fixlifetime.sil index df298bfb85831..c6c971758c49e 100644 --- a/test/IRGen/fixlifetime.sil +++ b/test/IRGen/fixlifetime.sil @@ -8,7 +8,7 @@ // unnecessary. // ONONE-NOT: @__swift_fixLifetime -// CHECK-objc-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @test(ptr %0, ptr %1, ptr %2, ptr %3, ptr %4, ptr noalias captures(none) dereferenceable({{.*}}) %5, {{(i64|i32)}} %6, {{(i64|i32)}} %7) {{.*}} { +// CHECK-objc-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @test(ptr %0, ptr %1, ptr %2, ptr %3, ptr %4, ptr noalias nocapture dereferenceable({{.*}}) %5, {{(i64|i32)}} %6, {{(i64|i32)}} %7) {{.*}} { // CHECK-objc: entry: // CHECK-objc: call void @__swift_fixLifetime(ptr // CHECK-objc: call void @__swift_fixLifetime(ptr @@ -20,7 +20,7 @@ // CHECK-objc: call void @__swift_fixLifetime(ptr [[TEMP]]) // CHECK-objc: call void @__swift_fixLifetime(ptr -// CHECK-native-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @test(ptr %0, ptr %1, ptr %2, ptr %3, ptr %4, ptr noalias captures(none) dereferenceable({{.*}}) %5, {{(i64|i32)}} %6, {{(i64|i32)}} %7) {{.*}} { +// CHECK-native-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @test(ptr %0, ptr %1, ptr %2, ptr %3, ptr %4, ptr noalias nocapture dereferenceable({{.*}}) %5, {{(i64|i32)}} %6, {{(i64|i32)}} %7) {{.*}} { // CHECK-native: entry: // CHECK-native: call void @__swift_fixLifetime(ptr // CHECK-native: call void @__swift_fixLifetime(ptr diff --git a/test/IRGen/function_param_convention.sil b/test/IRGen/function_param_convention.sil index a3190feccaa4c..124b964fefd72 100644 --- a/test/IRGen/function_param_convention.sil +++ b/test/IRGen/function_param_convention.sil @@ -10,7 +10,7 @@ struct X { // Make sure we can irgen a SIL function with various parameter attributes // without choking. This is just a basic reality check. -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @foo(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias captures(none) dereferenceable({{.*}}) %1, ptr captures(none) dereferenceable({{.*}}) %2, ptr noalias captures(none) dereferenceable({{.*}}) %3, i32 %4, i32 %5, i32 %6) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @foo(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture dereferenceable({{.*}}) %1, ptr nocapture dereferenceable({{.*}}) %2, ptr noalias nocapture dereferenceable({{.*}}) %3, i32 %4, i32 %5, i32 %6) {{.*}} { sil @foo : $@convention(thin) (@in X, @inout X, @in_guaranteed X, @owned X, X, @guaranteed X) -> @out X { bb0(%0 : $*X, %1 : $*X, %2 : $*X, %3 : $*X, %4 : $X, %5 : $X, %6 : $X): diff --git a/test/IRGen/function_types.sil b/test/IRGen/function_types.sil index d0857262b668b..c2d022bd9ba32 100644 --- a/test/IRGen/function_types.sil +++ b/test/IRGen/function_types.sil @@ -52,9 +52,9 @@ struct X {} sil @out_void_return : $@convention(thin) () -> @out X -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @use_void_return_value(ptr noalias captures(none) sret({{.*}}) %0) {{.*}} { +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @use_void_return_value(ptr noalias nocapture sret({{.*}}) %0) {{.*}} { // CHECK-NEXT: entry: -// CHECK-NEXT: call swiftcc void @out_void_return(ptr noalias captures(none) sret({{.*}}) %0) +// CHECK-NEXT: call swiftcc void @out_void_return(ptr noalias nocapture sret({{.*}}) %0) // CHECK-NEXT: ret void // CHECK-NEXT: } sil @use_void_return_value : $@convention(thin) () -> @out X { diff --git a/test/IRGen/generic_casts.swift b/test/IRGen/generic_casts.swift index 83ce916536feb..4d34360cb01e0 100644 --- a/test/IRGen/generic_casts.swift +++ b/test/IRGen/generic_casts.swift @@ -58,7 +58,7 @@ func intToAll(_ x: Int) -> T { return x as! T } -// CHECK: define hidden swiftcc i64 @"$s13generic_casts8anyToIntySiypF"(ptr noalias captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK: define hidden swiftcc i64 @"$s13generic_casts8anyToIntySiypF"(ptr noalias nocapture dereferenceable({{.*}}) %0) {{.*}} { func anyToInt(_ x: Any) -> Int { return x as! Int } @@ -104,7 +104,7 @@ func classExistentialToOpaqueArchetype(_ x: ObjCProto1) -> T { protocol P {} protocol Q {} -// CHECK: define hidden swiftcc void @"$s13generic_casts19compositionToMemberyAA1P_pAaC_AA1QpF{{.*}}"(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias captures(none) dereferenceable({{.*}}) %1) {{.*}} { +// CHECK: define hidden swiftcc void @"$s13generic_casts19compositionToMemberyAA1P_pAaC_AA1QpF{{.*}}"(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture dereferenceable({{.*}}) %1) {{.*}} { func compositionToMember(_ a: P & Q) -> P { return a } diff --git a/test/IRGen/generic_metatypes.swift b/test/IRGen/generic_metatypes.swift index e3c3533f752dc..7a37d2b923e76 100644 --- a/test/IRGen/generic_metatypes.swift +++ b/test/IRGen/generic_metatypes.swift @@ -58,7 +58,7 @@ func genericMetatypes(_ t: T.Type, _ u: U.Type) {} protocol Bas {} -// CHECK: define hidden swiftcc { ptr, ptr } @"$s17generic_metatypes14protocolTypeof{{.*}}"(ptr noalias captures(none) dereferenceable({{.*}}) %0) +// CHECK: define hidden swiftcc { ptr, ptr } @"$s17generic_metatypes14protocolTypeof{{.*}}"(ptr noalias nocapture dereferenceable({{.*}}) %0) func protocolTypeof(_ x: Bas) -> Bas.Type { // CHECK: [[METADATA_ADDR:%.*]] = getelementptr inbounds{{.*}} %T17generic_metatypes3BasP, ptr [[X:%.*]], i32 0, i32 1 // CHECK: [[METADATA:%.*]] = load ptr, ptr [[METADATA_ADDR]] diff --git a/test/IRGen/generic_metatypes_future.swift b/test/IRGen/generic_metatypes_future.swift index 6bcdd5e974ed6..f67ec6edcc5b2 100644 --- a/test/IRGen/generic_metatypes_future.swift +++ b/test/IRGen/generic_metatypes_future.swift @@ -59,7 +59,7 @@ func genericMetatypes(_ t: T.Type, _ u: U.Type) {} protocol Bas {} -// CHECK: define hidden swiftcc { ptr, ptr } @"$s17generic_metatypes14protocolTypeof{{.*}}"(ptr noalias captures(none) dereferenceable({{.*}}) %0) +// CHECK: define hidden swiftcc { ptr, ptr } @"$s17generic_metatypes14protocolTypeof{{.*}}"(ptr noalias nocapture dereferenceable({{.*}}) %0) func protocolTypeof(_ x: Bas) -> Bas.Type { // CHECK: [[METADATA_ADDR:%.*]] = getelementptr inbounds{{.*}} %T17generic_metatypes3BasP, ptr [[X:%.*]], i32 0, i32 1 // CHECK: [[METADATA:%.*]] = load ptr, ptr [[METADATA_ADDR]] diff --git a/test/IRGen/generic_ternary.swift b/test/IRGen/generic_ternary.swift index 7d679d68a50ef..f44288913f1b2 100644 --- a/test/IRGen/generic_ternary.swift +++ b/test/IRGen/generic_ternary.swift @@ -4,7 +4,7 @@ // struct OptionalStreamAdaptor { - // CHECK: define hidden swiftcc void @"$s15generic_ternary21OptionalStreamAdaptorV4next{{[_0-9a-zA-Z]*}}F"(ptr noalias sret({{.*}}) %0, ptr %"OptionalStreamAdaptor", ptr captures(none) swiftself dereferenceable({{.*}}) %1) + // CHECK: define hidden swiftcc void @"$s15generic_ternary21OptionalStreamAdaptorV4next{{[_0-9a-zA-Z]*}}F"(ptr noalias sret({{.*}}) %0, ptr %"OptionalStreamAdaptor", ptr nocapture swiftself dereferenceable({{.*}}) %1) mutating func next() -> Optional { return x[0].next() diff --git a/test/IRGen/indexing.sil b/test/IRGen/indexing.sil index 336da468b580f..9076f8adab6f3 100644 --- a/test/IRGen/indexing.sil +++ b/test/IRGen/indexing.sil @@ -12,7 +12,7 @@ struct SameSizeStride { var x, y: Builtin.Int32 } // This type has unequal stride and size. struct DifferentSizeStride { var x: Builtin.Int32, y: Builtin.Int16 } -// CHECK: define{{( protected)?}} {{.*}}void @same_size_stride(ptr noalias captures(none) dereferenceable({{.*}}) %0, i64 %1) {{.*}} { +// CHECK: define{{( protected)?}} {{.*}}void @same_size_stride(ptr noalias nocapture dereferenceable({{.*}}) %0, i64 %1) {{.*}} { // CHECK: getelementptr inbounds %T8indexing14SameSizeStrideV, ptr %0, i64 %1 sil @same_size_stride : $@convention(thin) (@in SameSizeStride, Builtin.Word) -> () { entry(%p : $*SameSizeStride, %i: $Builtin.Word): @@ -20,7 +20,7 @@ entry(%p : $*SameSizeStride, %i: $Builtin.Word): return undef : $() } -// CHECK: define{{( protected)?}} {{.*}}void @different_size_stride(ptr noalias captures(none) dereferenceable({{.*}}) %0, i64 %1) {{.*}} { +// CHECK: define{{( protected)?}} {{.*}}void @different_size_stride(ptr noalias nocapture dereferenceable({{.*}}) %0, i64 %1) {{.*}} { // CHECK: %2 = mul nsw i64 %1, 8 // CHECK-NEXT: %3 = getelementptr inbounds i8, ptr %0, i64 %2 sil @different_size_stride : $@convention(thin) (@in DifferentSizeStride, Builtin.Word) -> () { @@ -29,7 +29,7 @@ entry(%p : $*DifferentSizeStride, %i: $Builtin.Word): return undef : $() } -// CHECK: define{{( protected)?}} {{.*}}void @zero_size(ptr noalias captures(none) %0, i64 %1) {{.*}} { +// CHECK: define{{( protected)?}} {{.*}}void @zero_size(ptr noalias nocapture %0, i64 %1) {{.*}} { // CHECK: %2 = mul nsw i64 %1, 1 // CHECK-NEXT: %3 = getelementptr inbounds i8, ptr %0, i64 %2 sil @zero_size : $@convention(thin) (@in (), Builtin.Word) -> () { diff --git a/test/IRGen/indirect_argument.sil b/test/IRGen/indirect_argument.sil index d575de477b611..466fbc81686ac 100644 --- a/test/IRGen/indirect_argument.sil +++ b/test/IRGen/indirect_argument.sil @@ -15,9 +15,9 @@ struct HugeAlignment { } // TODO: could be the context param -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @huge_method(ptr noalias captures(none) swiftself dereferenceable({{.*}}) %0) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @huge_method(ptr noalias nocapture swiftself dereferenceable({{.*}}) %0) // CHECK-NOT: alloca -// CHECK: call swiftcc void @huge_method(ptr noalias captures(none) swiftself dereferenceable({{.*}}) %0) +// CHECK: call swiftcc void @huge_method(ptr noalias nocapture swiftself dereferenceable({{.*}}) %0) sil @huge_method : $@convention(method) (Huge) -> () { entry(%x : $Huge): %f = function_ref @huge_method : $@convention(method) (Huge) -> () @@ -25,9 +25,9 @@ entry(%x : $Huge): return %z : $() } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @huge_param(ptr noalias captures(none) dereferenceable({{.*}}) %0) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @huge_param(ptr noalias nocapture dereferenceable({{.*}}) %0) // CHECK-NOT: alloca -// CHECK: call swiftcc void @huge_param(ptr noalias captures(none) dereferenceable({{.*}}) %0) +// CHECK: call swiftcc void @huge_param(ptr noalias nocapture dereferenceable({{.*}}) %0) sil @huge_param : $@convention(thin) (Huge) -> () { entry(%x : $Huge): %f = function_ref @huge_param : $@convention(thin) (Huge) -> () @@ -35,9 +35,9 @@ entry(%x : $Huge): return %z : $() } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @huge_alignment_param(ptr noalias captures(none) dereferenceable({{.*}}) %0) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @huge_alignment_param(ptr noalias nocapture dereferenceable({{.*}}) %0) // CHECK-NOT: alloca -// CHECK: call swiftcc void @huge_alignment_param(ptr noalias captures(none) dereferenceable({{.*}}) %0) +// CHECK: call swiftcc void @huge_alignment_param(ptr noalias nocapture dereferenceable({{.*}}) %0) sil @huge_alignment_param : $@convention(thin) (HugeAlignment) -> () { entry(%x : $HugeAlignment): %f = function_ref @huge_alignment_param : $@convention(thin) (HugeAlignment) -> () @@ -45,9 +45,9 @@ entry(%x : $HugeAlignment): return %z : $() } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @huge_param_and_return(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias captures(none) dereferenceable({{.*}}) %1) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @huge_param_and_return(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture dereferenceable({{.*}}) %1) // CHECK: [[TMP_RET:%.*]] = alloca -// CHECK: call swiftcc void @huge_param_and_return(ptr noalias captures(none) sret({{.*}}) [[TMP_RET]], ptr noalias captures(none) dereferenceable({{.*}}) %1) +// CHECK: call swiftcc void @huge_param_and_return(ptr noalias nocapture sret({{.*}}) [[TMP_RET]], ptr noalias nocapture dereferenceable({{.*}}) %1) sil @huge_param_and_return : $@convention(thin) (Huge) -> Huge { entry(%x : $Huge): %f = function_ref @huge_param_and_return : $@convention(thin) (Huge) -> Huge @@ -55,9 +55,9 @@ entry(%x : $Huge): return %z : $Huge } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @huge_param_and_indirect_return(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias captures(none) dereferenceable({{.*}}) %1) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @huge_param_and_indirect_return(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture dereferenceable({{.*}}) %1) // CHECK-NOT: alloca -// CHECK: call swiftcc void @huge_param_and_indirect_return(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias captures(none) dereferenceable({{.*}}) %1) +// CHECK: call swiftcc void @huge_param_and_indirect_return(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture dereferenceable({{.*}}) %1) sil @huge_param_and_indirect_return : $@convention(thin) (Huge) -> @out Huge { entry(%o : $*Huge, %x : $Huge): %f = function_ref @huge_param_and_indirect_return : $@convention(thin) (Huge) -> @out Huge @@ -65,16 +65,16 @@ entry(%o : $*Huge, %x : $Huge): return %z : $() } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @huge_partial_application(ptr noalias captures(none) dereferenceable({{.*}}) %0, ptr noalias captures(none) dereferenceable({{.*}}) %1) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @huge_partial_application(ptr noalias nocapture dereferenceable({{.*}}) %0, ptr noalias nocapture dereferenceable({{.*}}) %1) // CHECK-NOT: alloca // CHECK: [[CLOSURE:%.*]] = call noalias ptr @swift_allocObject -// CHECK: call swiftcc {{.*}} @"$s24huge_partial_applicationTA{{(\.ptrauth)?}}"{{.*}}(ptr noalias captures(none) dereferenceable({{.*}}) %0, ptr swiftself [[CLOSURE]]) -// CHECK: define internal swiftcc void @"$s24huge_partial_applicationTA"(ptr noalias captures(none) dereferenceable({{.*}}) %0, ptr swiftself %1) +// CHECK: call swiftcc {{.*}} @"$s24huge_partial_applicationTA{{(\.ptrauth)?}}"{{.*}}(ptr noalias nocapture dereferenceable({{.*}}) %0, ptr swiftself [[CLOSURE]]) +// CHECK: define internal swiftcc void @"$s24huge_partial_applicationTA"(ptr noalias nocapture dereferenceable({{.*}}) %0, ptr swiftself %1) // CHECK-NOT: alloca // CHECK: [[GEP:%.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, %T17indirect_argument4HugeV }>, ptr %1, i32 0, i32 1 // CHECK-NOT: alloca // CHECK-NOT: tail -// CHECK: call swiftcc void @huge_partial_application(ptr noalias captures(none) dereferenceable({{.*}}) %0, ptr noalias captures(none) dereferenceable({{.*}}) [[GEP]] +// CHECK: call swiftcc void @huge_partial_application(ptr noalias nocapture dereferenceable({{.*}}) %0, ptr noalias nocapture dereferenceable({{.*}}) [[GEP]] // CHECK: call void @swift_release(ptr %1) sil @huge_partial_application : $@convention(thin) (Huge, Huge) -> () { entry(%x : $Huge, %y : $Huge): @@ -84,16 +84,16 @@ entry(%x : $Huge, %y : $Huge): return %z : $() } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @huge_partial_application_stret(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias captures(none) dereferenceable({{.*}}) %1, ptr noalias captures(none) dereferenceable({{.*}}) %2) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @huge_partial_application_stret(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture dereferenceable({{.*}}) %1, ptr noalias nocapture dereferenceable({{.*}}) %2) // CHECK: [[TMP_RET:%.*]] = alloca // CHECK: [[CLOSURE:%.*]] = call noalias ptr @swift_allocObject -// CHECK: call swiftcc {{.*}} @"$s30huge_partial_application_stretTA{{(\.ptrauth)?}}"{{.*}}(ptr noalias captures(none) sret({{.*}}) [[TMP_RET]], ptr noalias captures(none) dereferenceable({{.*}}) %1, ptr swiftself [[CLOSURE]]) -// CHECK: define internal swiftcc void @"$s30huge_partial_application_stretTA"(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias captures(none) dereferenceable({{.*}}) %1, ptr swiftself %2) +// CHECK: call swiftcc {{.*}} @"$s30huge_partial_application_stretTA{{(\.ptrauth)?}}"{{.*}}(ptr noalias nocapture sret({{.*}}) [[TMP_RET]], ptr noalias nocapture dereferenceable({{.*}}) %1, ptr swiftself [[CLOSURE]]) +// CHECK: define internal swiftcc void @"$s30huge_partial_application_stretTA"(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture dereferenceable({{.*}}) %1, ptr swiftself %2) // CHECK-NOT: alloca // CHECK: [[GEP:%.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, %T17indirect_argument4HugeV }>, ptr %2, i32 0, i32 1 // CHECK-NOT: alloca // CHECK-NOT: tail -// CHECK: call swiftcc void @huge_partial_application_stret(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias captures(none) dereferenceable({{.*}}) %1, ptr noalias captures(none) dereferenceable({{.*}}) [[GEP]]) +// CHECK: call swiftcc void @huge_partial_application_stret(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture dereferenceable({{.*}}) %1, ptr noalias nocapture dereferenceable({{.*}}) [[GEP]]) // CHECK: call void @swift_release(ptr %2) sil @huge_partial_application_stret : $@convention(thin) (Huge, Huge) -> Huge { entry(%x : $Huge, %y : $Huge): diff --git a/test/IRGen/indirect_return.swift b/test/IRGen/indirect_return.swift index 965548eb3a8c9..96b2a9bb02953 100644 --- a/test/IRGen/indirect_return.swift +++ b/test/IRGen/indirect_return.swift @@ -20,6 +20,6 @@ func foo() -> (String, String, String, Number, Number) { } // CHECK-LABEL: define{{.*}}testCall func testCall() { -// CHECK: call swiftcc void @"$s15indirect_return3fooSS_S2SAA6Number_pAaC_ptyF"(ptr noalias captures(none) %{{.*}} +// CHECK: call swiftcc void @"$s15indirect_return3fooSS_S2SAA6Number_pAaC_ptyF"(ptr noalias nocapture %{{.*}} print(foo()) } diff --git a/test/IRGen/inout_noalias.sil b/test/IRGen/inout_noalias.sil index 165db0f297b0c..6a3c4fe86bce6 100644 --- a/test/IRGen/inout_noalias.sil +++ b/test/IRGen/inout_noalias.sil @@ -2,7 +2,7 @@ import Swift -// CHECK: define{{.*}}swiftcc void @takeInoutAliasable(ptr captures(none) dereferenceable({{[0-9]+}}) %0, ptr %T) +// CHECK: define{{.*}}swiftcc void @takeInoutAliasable(ptr nocapture dereferenceable({{[0-9]+}}) %0, ptr %T) sil @takeInoutAliasable : $ (@inout_aliasable UnsafePointer) -> () { entry(%ptr : $*UnsafePointer): %retval = tuple () diff --git a/test/IRGen/lazy_multi_file.swift b/test/IRGen/lazy_multi_file.swift index 293aa232744e2..95444fc142e8d 100644 --- a/test/IRGen/lazy_multi_file.swift +++ b/test/IRGen/lazy_multi_file.swift @@ -14,7 +14,7 @@ class Subclass : LazyContainerClass { // an indirect return value. When it shrinks back, remove the optional // indirect out. // - // CHECK-LABEL: @"$s15lazy_multi_file8SubclassC6getStrSSyF"({{(ptr noalias captures(none) sret, )?}}ptr swiftself %0) {{.*}} { + // CHECK-LABEL: @"$s15lazy_multi_file8SubclassC6getStrSSyF"({{(ptr noalias nocapture sret, )?}}ptr swiftself %0) {{.*}} { func getStr() -> String { // CHECK: = getelementptr inbounds{{.*}} %T15lazy_multi_file8SubclassC, ptr %0, i32 0, i32 3 return str diff --git a/test/IRGen/lifetime.sil b/test/IRGen/lifetime.sil index a1f3c392a448e..84dd8e1d6f9bf 100644 --- a/test/IRGen/lifetime.sil +++ b/test/IRGen/lifetime.sil @@ -99,7 +99,7 @@ bb0(%x : $*Builtin.Int64): %0 = tuple () return %0 : $() } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @fixed_size(ptr noalias captures(none) dereferenceable(8) %0) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @fixed_size(ptr noalias nocapture dereferenceable(8) %0) // CHECK: [[XBUF:%.*]] = alloca i64 // CHECK-NEXT: call void @llvm.lifetime.start.p0({{(i32|i64)}} 8, ptr [[XBUF]]) // CHECK-NEXT: load diff --git a/test/IRGen/moveonly_split_module_source_deinit.swift b/test/IRGen/moveonly_split_module_source_deinit.swift index 24d9e5d5ec440..e9e1035d52683 100644 --- a/test/IRGen/moveonly_split_module_source_deinit.swift +++ b/test/IRGen/moveonly_split_module_source_deinit.swift @@ -7,7 +7,7 @@ // Make sure we call the deinit through the value witness table in the other module. -// REFERRING_MODULE-LABEL: define {{.*}}swiftcc void @"$s6serverAAV4mainyyKFZ"(ptr swiftself %0, ptr noalias captures(none) swifterror dereferenceable({{(8|4)}}) %1) {{.*}}{ +// REFERRING_MODULE-LABEL: define {{.*}}swiftcc void @"$s6serverAAV4mainyyKFZ"(ptr swiftself %0, ptr noalias nocapture swifterror dereferenceable({{(8|4)}}) %1) {{.*}}{ // REFERRING_MODULE: [[SERVER:%.*]] = alloca %T6server8MoveOnlyV // REFERRING_MODULE: [[VALUE_WITNESS_TABLE:%.*]] = getelementptr inbounds ptr, ptr %"$s6server8MoveOnlyVN.valueWitnesses" // REFERRING_MODULE: [[VALUE_WITNESS:%.*]] = load ptr, ptr [[VALUE_WITNESS_TABLE]] diff --git a/test/IRGen/moveonly_value_functions.swift b/test/IRGen/moveonly_value_functions.swift index d1093a5839032..f14abc9f87622 100644 --- a/test/IRGen/moveonly_value_functions.swift +++ b/test/IRGen/moveonly_value_functions.swift @@ -198,7 +198,7 @@ public func takeOuterDeinitingNC_1(_ t: consuming OuterDeinitingNC_1) { // CHECK: [[INNER_DEINITING_RELEASABLE_NC_METADATA:%[^,]+]] = extractvalue %swift.metadata_response [[RESPONSE]] // CHECK: call swiftcc void @"$s24moveonly_value_functions26InnerDeinitingReleasableNCVfD"( // CHECK-SAME: ptr [[INNER_DEINITING_RELEASABLE_NC_METADATA]], -// : ptr noalias captures(none) swiftself dereferenceable(64) %deinit.arg) +// : ptr noalias nocapture swiftself dereferenceable(64) %deinit.arg) // CHECK: } public func takeOuterNC_1(_ o: consuming OuterNC_1) { external_symbol() @@ -295,7 +295,7 @@ public func takeGenericContext_1OuterNC_1(_ e: consuming GenericContext_1 public func takeOuterSinglePayloadNC_1(_ e: consuming OuterSinglePayloadNC_1) {} // CHECK-LABEL: define{{.*}} @"$s24moveonly_value_functions26takeOuterSinglePayloadNC_2yyAA0efgH2_2OyxGnlF"( -// : ptr noalias captures(none) dereferenceable(64) %0, +// : ptr noalias nocapture dereferenceable(64) %0, // CHECK-SAME: ptr %T) // CHECK-SAME: { // CHECK: call{{.*}} @"$s24moveonly_value_functions22OuterSinglePayloadNC_2OyxGlWOh"( @@ -388,7 +388,7 @@ public func takeOuterMultiPayloadNC_1(_ e: consuming OuterMultiPayloadNC_1 // CHECK: } public func takeOuterMultiPayloadNC_2(_ e: consuming OuterMultiPayloadNC_2) {} // CHECK-LABEL: define{{.*}} @"$s24moveonly_value_functions25takeOuterMultiPayloadNC_3yyAA0efgH2_3OyxGnlF"( -// : ptr noalias captures(none) dereferenceable(64) %0, +// : ptr noalias nocapture dereferenceable(64) %0, // CHECK-SAME: ptr %T) // CHECK-SAME: { // CHECK: call{{.*}} @"$s24moveonly_value_functions21OuterMultiPayloadNC_3OyxGlWOh"( diff --git a/test/IRGen/moveonly_value_functions_onone.swift b/test/IRGen/moveonly_value_functions_onone.swift index 1e4f91fc6b11e..9530a4b82bc62 100644 --- a/test/IRGen/moveonly_value_functions_onone.swift +++ b/test/IRGen/moveonly_value_functions_onone.swift @@ -195,7 +195,7 @@ public func takeOuterDeinitingNC_1(_ t: consuming OuterDeinitingNC_1) { // CHECK: [[INNER_DEINITING_RELEASABLE_NC_METADATA:%[^,]+]] = extractvalue %swift.metadata_response [[RESPONSE]] // CHECK: call swiftcc void @"$s30moveonly_value_functions_onone26InnerDeinitingReleasableNCVfD"( // CHECK-SAME: ptr [[INNER_DEINITING_RELEASABLE_NC_METADATA]], -// : ptr noalias captures(none) swiftself dereferenceable(64) %deinit.arg) +// : ptr noalias nocapture swiftself dereferenceable(64) %deinit.arg) // CHECK: } public func takeOuterNC_1(_ o: consuming OuterNC_1) { external_symbol() @@ -288,7 +288,7 @@ public func takeGenericContext_1OuterNC_1(_ e: consuming GenericContext_1 public func takeOuterSinglePayloadNC_1(_ e: consuming OuterSinglePayloadNC_1) {} // CHECK-LABEL: define{{.*}} @"$s30moveonly_value_functions_onone26takeOuterSinglePayloadNC_2yyAA0fghI2_2OyxGnlF"( -// : ptr noalias captures(none) dereferenceable(64) %0, +// : ptr noalias nocapture dereferenceable(64) %0, // CHECK-SAME: ptr %T) // CHECK-SAME: { // CHECK: call{{.*}} @"$s30moveonly_value_functions_onone22OuterSinglePayloadNC_2OyxGlWOh"( @@ -305,7 +305,7 @@ public func takeOuterSinglePayloadNC_1(_ e: consuming OuterSinglePayloadNC_1< // CHECK: [[METADATA:%[^,]+]] = extractvalue %swift.metadata_response [[RESPONSE]], 0 // CHECK: call swiftcc void @"$s30moveonly_value_functions_onone26InnerDeinitingReleasableNCVfD"( // CHECK-SAME: ptr [[METADATA]], -// : ptr noalias captures(none) swiftself dereferenceable(64) %0) +// : ptr noalias nocapture swiftself dereferenceable(64) %0) // CHECK: } public func takeOuterSinglePayloadNC_2(_ e: consuming OuterSinglePayloadNC_2) {} @@ -383,7 +383,7 @@ public func takeOuterMultiPayloadNC_1(_ e: consuming OuterMultiPayloadNC_1 // CHECK: } public func takeOuterMultiPayloadNC_2(_ e: consuming OuterMultiPayloadNC_2) {} // CHECK-LABEL: define{{.*}} @"$s30moveonly_value_functions_onone25takeOuterMultiPayloadNC_3yyAA0fghI2_3OyxGnlF"( -// : ptr noalias captures(none) dereferenceable(64) %0, +// : ptr noalias nocapture dereferenceable(64) %0, // CHECK-SAME: ptr %T) // CHECK-SAME: { // CHECK: call{{.*}} @"$s30moveonly_value_functions_onone21OuterMultiPayloadNC_3OyxGlWOh"( diff --git a/test/IRGen/objc_block_storage.sil b/test/IRGen/objc_block_storage.sil index 4f2d66738dcae..64f23214c4d44 100644 --- a/test/IRGen/objc_block_storage.sil +++ b/test/IRGen/objc_block_storage.sil @@ -38,7 +38,7 @@ import gizmo // CHECK: ptr [[NSRECT_BLOCK_SIGNATURE]] // CHECK: } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @project_block_storage(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @project_block_storage(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { // CHECK-NEXT: entry: // CHECK-NEXT: %1 = getelementptr inbounds{{.*}} { %objc_block, ptr }, ptr %0, i32 0, i32 1 // CHECK-NEXT: %2 = load ptr, ptr %1, align 8 @@ -51,7 +51,7 @@ entry(%0 : $*@block_storage Builtin.RawPointer): return %p : $Builtin.RawPointer } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc fp128 @overaligned_project_block_storage(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc fp128 @overaligned_project_block_storage(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { // CHECK-NEXT: entry: // CHECK-NEXT: %1 = getelementptr inbounds{{.*}} { %objc_block, fp128 }, ptr %0, i32 0, i32 1 // CHECK-NEXT: %2 = load fp128, ptr %1, align 16 @@ -64,7 +64,7 @@ entry(%0 : $*@block_storage Builtin.FPIEEE128): return %p : $Builtin.FPIEEE128 } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @init_block_header_trivial(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @init_block_header_trivial(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { // CHECK: [[HEADER:%.*]] = getelementptr inbounds{{.*}} { %objc_block, ptr }, ptr %0, i32 0, i32 0 // CHECK: [[T0:%.*]] = getelementptr inbounds{{.*}} %objc_block, ptr [[HEADER]], i32 0, i32 0 // CHECK: store ptr [[BLOCK_ISA]], ptr [[T0]] @@ -109,7 +109,7 @@ entry(%0 : $*@block_storage Builtin.RawPointer, %1 : $Int): return %1 : $Int } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @init_block_header_nontrivial(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @init_block_header_nontrivial(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { // CHECK: [[HEADER:%.*]] = getelementptr inbounds // CHECK: [[T0:%.*]] = getelementptr inbounds{{.*}} %objc_block, ptr [[HEADER]], i32 0, i32 0 // CHECK: store ptr [[BLOCK_ISA]], ptr [[T0]] @@ -147,7 +147,7 @@ entry(%0 : $*@block_storage Builtin.NativeObject): sil public_external @invoke_nontrivial : $@convention(c) (@inout_aliasable @block_storage Builtin.NativeObject) -> () -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @init_block_header_stret(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @init_block_header_stret(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { // CHECK: [[HEADER:%.*]] = getelementptr inbounds // CHECK: [[T0:%.*]] = getelementptr inbounds{{.*}} %objc_block, ptr [[HEADER]], i32 0, i32 0 // CHECK: store ptr [[BLOCK_ISA]], ptr [[T0]] diff --git a/test/IRGen/objc_class_export.swift b/test/IRGen/objc_class_export.swift index c2b3b29460f34..4f3e467940a27 100644 --- a/test/IRGen/objc_class_export.swift +++ b/test/IRGen/objc_class_export.swift @@ -87,13 +87,13 @@ struct BigStructWithNativeObjects { return NSRect(origin: NSPoint(x: 0, y: 0), size: NSSize(width: 0, height: 0)) } - // CHECK: define internal void @"$s17objc_class_export3FooC6boundsSo6NSRectVyFTo"(ptr noalias captures(none) sret({{.*}}) %0, ptr %1, ptr %2) {{[#0-9]*}} { + // CHECK: define internal void @"$s17objc_class_export3FooC6boundsSo6NSRectVyFTo"(ptr noalias nocapture sret({{.*}}) %0, ptr %1, ptr %2) {{[#0-9]*}} { // CHECK: call swiftcc { double, double, double, double } @"$s17objc_class_export3FooC6boundsSo6NSRectVyF"(ptr swiftself %1) @objc func convertRectToBacking(r r: NSRect) -> NSRect { return r } - // CHECK: define internal void @"$s17objc_class_export3FooC20convertRectToBacking1rSo6NSRectVAG_tFTo"(ptr noalias captures(none) sret({{.*}}) %0, ptr %1, ptr %2, ptr byval({{.*}} align 8 %3) {{[#0-9]*}} { + // CHECK: define internal void @"$s17objc_class_export3FooC20convertRectToBacking1rSo6NSRectVAG_tFTo"(ptr noalias nocapture sret({{.*}}) %0, ptr %1, ptr %2, ptr byval({{.*}} align 8 %3) {{[#0-9]*}} { // CHECK: call swiftcc { double, double, double, double } @"$s17objc_class_export3FooC20convertRectToBacking1rSo6NSRectVAG_tF"(double {{.*}}, double {{.*}}, double {{.*}}, double {{.*}}, ptr swiftself %1) func doStuffToSwiftSlice(f f: [Int]) { diff --git a/test/IRGen/objc_generic_protocol_conformance.swift b/test/IRGen/objc_generic_protocol_conformance.swift index 7510c614e9658..a87cebe9733e9 100644 --- a/test/IRGen/objc_generic_protocol_conformance.swift +++ b/test/IRGen/objc_generic_protocol_conformance.swift @@ -9,4 +9,4 @@ protocol P { extension Foo: P {} // SIL-LABEL: sil private [transparent] [thunk] [ossa] @$sSo3FooCyxG33objc_generic_protocol_conformance1PA2dEP3fooyyFTW {{.*}} @pseudogeneric -// IR-LABEL: define internal swiftcc void @"$sSo3FooCyxG33objc_generic_protocol_conformance1PA2dEP3fooyyFTW"(ptr noalias captures(none) swiftself dereferenceable({{4|8}}) %0, ptr{{( %Self)?}}, ptr{{( %SelfWitnessTable)?}}) +// IR-LABEL: define internal swiftcc void @"$sSo3FooCyxG33objc_generic_protocol_conformance1PA2dEP3fooyyFTW"(ptr noalias nocapture swiftself dereferenceable({{4|8}}) %0, ptr{{( %Self)?}}, ptr{{( %SelfWitnessTable)?}}) diff --git a/test/IRGen/objc_simd.sil b/test/IRGen/objc_simd.sil index b7803f97ba77c..cdbde09c874bf 100644 --- a/test/IRGen/objc_simd.sil +++ b/test/IRGen/objc_simd.sil @@ -57,15 +57,15 @@ entry(%x : $float3): } // x86_64-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { float, float, float, float } @simd_native_args(float %0, float %1, float %2, float %3) -// i386-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @simd_native_args(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias captures(none) dereferenceable({{.*}}) %1) +// i386-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @simd_native_args(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture dereferenceable({{.*}}) %1) // aarch64-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { float, float, float, float } @simd_native_args(float %0, float %1, float %2, float %3) // arm64-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { float, float, float, float } @simd_native_args(float %0, float %1, float %2, float %3) -// armv6-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @simd_native_args(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias captures(none) dereferenceable({{.*}}) %1) +// armv6-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @simd_native_args(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture dereferenceable({{.*}}) %1) // armv7-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { float, float, float, float } @simd_native_args(float %0, float %1, float %2, float %3) // armv7s-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { float, float, float, float } @simd_native_args(float %0, float %1, float %2, float %3) // armv7k-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { float, float, float, float } @simd_native_args(float %0, float %1, float %2, float %3) // arm64_32-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { float, float, float, float } @simd_native_args(float %0, float %1, float %2, float %3) -// powerpc64-LABEL: define{{( dllexport)?}}{{( protected)?}} void @simd_native_args(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias captures(none) dereferenceable({{.*}}) %1) +// powerpc64-LABEL: define{{( dllexport)?}}{{( protected)?}} void @simd_native_args(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture dereferenceable({{.*}}) %1) // powerpc64le-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { float, float, float, float } @simd_native_args(float %0, float %1, float %2, float %3) // s390x-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { float, float, float, float } @simd_native_args(float %0, float %1, float %2, float %3) // wasm32-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { float, float, float, float } @simd_native_args(float %0, float %1, float %2, float %3) diff --git a/test/IRGen/objc_structs.swift b/test/IRGen/objc_structs.swift index d09cd994e3bbc..ab047f8476bfe 100644 --- a/test/IRGen/objc_structs.swift +++ b/test/IRGen/objc_structs.swift @@ -16,7 +16,7 @@ import gizmo // CHECK: define hidden swiftcc { double, double, double, double } @"$s12objc_structs8getFrame{{[_0-9a-zA-Z]*}}F"(ptr %0) {{.*}} { func getFrame(_ g: Gizmo) -> NSRect { // CHECK: load ptr, ptr @"\01L_selector(frame)" - // CHECK: call void @objc_msgSend_stret(ptr noalias captures(none) sret({{.*}}) {{.*}}, ptr {{.*}}, ptr {{.*}}) + // CHECK: call void @objc_msgSend_stret(ptr noalias nocapture sret({{.*}}) {{.*}}, ptr {{.*}}, ptr {{.*}}) return g.frame() } // CHECK: } @@ -31,7 +31,7 @@ func setFrame(_ g: Gizmo, frame: NSRect) { // CHECK: define hidden swiftcc { double, double, double, double } @"$s12objc_structs8makeRect{{[_0-9a-zA-Z]*}}F"(double %0, double %1, double %2, double %3) func makeRect(_ a: Double, b: Double, c: Double, d: Double) -> NSRect { - // CHECK: call void @NSMakeRect(ptr noalias captures(none) sret({{.*}}) {{.*}}, double {{.*}}, double {{.*}}, double {{.*}}, double {{.*}}) + // CHECK: call void @NSMakeRect(ptr noalias nocapture sret({{.*}}) {{.*}}, double {{.*}}, double {{.*}}, double {{.*}}, double {{.*}}) return NSMakeRect(a,b,c,d) } // CHECK: } @@ -45,7 +45,7 @@ func stringFromRect(_ r: NSRect) -> String { // CHECK: define hidden swiftcc { double, double, double, double } @"$s12objc_structs9insetRect{{[_0-9a-zA-Z]*}}F"(double %0, double %1, double %2, double %3, double %4, double %5) func insetRect(_ r: NSRect, x: Double, y: Double) -> NSRect { - // CHECK: call void @NSInsetRect(ptr noalias captures(none) sret({{.*}}) {{.*}}, ptr byval({{.*}}) align 8 {{.*}}, double {{.*}}, double {{.*}}) + // CHECK: call void @NSInsetRect(ptr noalias nocapture sret({{.*}}) {{.*}}, ptr byval({{.*}}) align 8 {{.*}}, double {{.*}}, double {{.*}}) return NSInsetRect(r, x, y) } // CHECK: } @@ -53,13 +53,13 @@ func insetRect(_ r: NSRect, x: Double, y: Double) -> NSRect { // CHECK: define hidden swiftcc { double, double, double, double } @"$s12objc_structs19convertRectFromBase{{[_0-9a-zA-Z]*}}F"(ptr %0, double %1, double %2, double %3, double %4) func convertRectFromBase(_ v: NSView, r: NSRect) -> NSRect { // CHECK: load ptr, ptr @"\01L_selector(convertRectFromBase:)", align 8 - // CHECK: call void @objc_msgSend_stret(ptr noalias captures(none) sret({{.*}}) {{.*}}, ptr {{.*}}, ptr {{.*}}, ptr byval({{.*}}) align 8 {{.*}}) + // CHECK: call void @objc_msgSend_stret(ptr noalias nocapture sret({{.*}}) {{.*}}, ptr {{.*}}, ptr {{.*}}, ptr byval({{.*}}) align 8 {{.*}}) return v.convertRect(fromBase: r) } // CHECK: } // CHECK: define hidden swiftcc { ptr, ptr, ptr, ptr } @"$s12objc_structs20useStructOfNSStringsySo0deF0VADF"(ptr %0, ptr %1, ptr %2, ptr %3) -// CHECK: call void @useStructOfNSStringsInObjC(ptr noalias captures(none) sret({{.*}}) {{%.*}}, ptr byval({{.*}}) align 8 {{%.*}}) +// CHECK: call void @useStructOfNSStringsInObjC(ptr noalias nocapture sret({{.*}}) {{%.*}}, ptr byval({{.*}}) align 8 {{%.*}}) func useStructOfNSStrings(_ s: StructOfNSStrings) -> StructOfNSStrings { return useStructOfNSStringsInObjC(s) } diff --git a/test/IRGen/objc_super.swift b/test/IRGen/objc_super.swift index 2cdbda5da233c..b8a8a2cdea6e0 100644 --- a/test/IRGen/objc_super.swift +++ b/test/IRGen/objc_super.swift @@ -40,7 +40,7 @@ class Hoozit : Gizmo { // CHECK: [[T0:%.*]] = extractvalue %swift.metadata_response [[TMP]], 0 // CHECK: store ptr [[T0]], ptr {{.*}}, align 8 // CHECK: load ptr, ptr @"\01L_selector(frame)" - // CHECK: call void @objc_msgSendSuper2_stret(ptr noalias captures(none) sret({{.*}}) {{.*}}, ptr {{.*}}, ptr {{.*}}) + // CHECK: call void @objc_msgSendSuper2_stret(ptr noalias nocapture sret({{.*}}) {{.*}}, ptr {{.*}}, ptr {{.*}}) return NSInsetRect(super.frame(), 2.0, 2.0) } // CHECK: } diff --git a/test/IRGen/partial_apply.sil b/test/IRGen/partial_apply.sil index ef9826f9e008a..0c79bfae956a2 100644 --- a/test/IRGen/partial_apply.sil +++ b/test/IRGen/partial_apply.sil @@ -135,7 +135,7 @@ bb0(%x : $SwiftClass): sil public_external @indirect_guaranteed_captured_class_param : $@convention(thin) (Int, @in_guaranteed SwiftClass) -> Int -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { ptr, ptr } @partial_apply_indirect_guaranteed_class_param(ptr noalias captures(none) dereferenceable({{.*}}) %0) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { ptr, ptr } @partial_apply_indirect_guaranteed_class_param(ptr noalias nocapture dereferenceable({{.*}}) %0) // CHECK-NOT: {{retain|release}} // CHECK: [[X:%.*]] = load ptr, ptr %0 // CHECK-NOT: {{retain|release}} @@ -148,7 +148,7 @@ sil public_external @indirect_guaranteed_captured_class_param : $@convention(thi // CHECK-NOT: load // CHECK-NOT: retain // CHECK-NOT: release -// CHECK: [[RESULT:%.*]] = call swiftcc i64 @indirect_guaranteed_captured_class_param(i64 %0, ptr noalias captures(none) dereferenceable({{.*}}) [[X_TMP]] +// CHECK: [[RESULT:%.*]] = call swiftcc i64 @indirect_guaranteed_captured_class_param(i64 %0, ptr noalias nocapture dereferenceable({{.*}}) [[X_TMP]] // CHECK-NOT: retain // CHECK: call void @swift_release(ptr %1) // CHECK: ret i64 [[RESULT]] @@ -162,7 +162,7 @@ bb0(%x : $*SwiftClass): sil public_external @indirect_consumed_captured_class_param : $@convention(thin) (Int, @in SwiftClass) -> Int -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { ptr, ptr } @partial_apply_indirect_consumed_class_param(ptr noalias captures(none) dereferenceable({{.*}}) %0) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { ptr, ptr } @partial_apply_indirect_consumed_class_param(ptr noalias nocapture dereferenceable({{.*}}) %0) // CHECK-NOT: {{retain|release}} // CHECK: [[CONTEXT_OBJ:%.*]] = load ptr, ptr %0 // CHECK-NOT: {{retain|release}} @@ -175,7 +175,7 @@ sil public_external @indirect_consumed_captured_class_param : $@convention(thin) // CHECK-NOT: load // CHECK-NOT: retain // CHECK-NOT: release -// CHECK: [[RESULT:%.*]] = call swiftcc i64 @indirect_consumed_captured_class_param(i64 %0, ptr noalias captures(none) dereferenceable({{.*}}) [[X_TMP]]) +// CHECK: [[RESULT:%.*]] = call swiftcc i64 @indirect_consumed_captured_class_param(i64 %0, ptr noalias nocapture dereferenceable({{.*}}) [[X_TMP]]) // CHECK-NOT: retain // CHECK-NOT: release // CHECK: ret i64 [[RESULT]] @@ -227,7 +227,7 @@ bb0(%x : $SwiftClassPair): sil public_external @indirect_guaranteed_captured_class_pair_param : $@convention(thin) (Int, @in_guaranteed SwiftClassPair) -> Int -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { ptr, ptr } @partial_apply_indirect_guaranteed_class_pair_param(ptr noalias captures(none) dereferenceable({{.*}}) %0) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { ptr, ptr } @partial_apply_indirect_guaranteed_class_pair_param(ptr noalias nocapture dereferenceable({{.*}}) %0) // CHECK: [[CONTEXT_OBJ:%.*]] = call noalias ptr @swift_allocObject // CHECK-NOT: {{retain|release}} // CHECK: [[T0:%.*]] = insertvalue {{.*}} [[PARTIAL_APPLY_FORWARDER:@"\$s[A-Za-z0-9_]+TA"]], {{.*}} [[CONTEXT_OBJ]] @@ -237,7 +237,7 @@ sil public_external @indirect_guaranteed_captured_class_pair_param : $@conventio // CHECK: [[PAIR_ADDR:%.*]] = getelementptr // CHECK-NOT: load // CHECK-NOT: retain -// CHECK: [[RESULT:%.*]] = call swiftcc i64 @indirect_guaranteed_captured_class_pair_param(i64 %0, ptr noalias captures(none) dereferenceable({{.*}}) [[PAIR_ADDR]]) +// CHECK: [[RESULT:%.*]] = call swiftcc i64 @indirect_guaranteed_captured_class_pair_param(i64 %0, ptr noalias nocapture dereferenceable({{.*}}) [[PAIR_ADDR]]) // CHECK: release{{.*}}%1) // CHECK: ret i64 [[RESULT]] @@ -250,7 +250,7 @@ bb0(%x : $*SwiftClassPair): sil public_external @indirect_consumed_captured_class_pair_param : $@convention(thin) (Int, @in SwiftClassPair) -> Int -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { ptr, ptr } @partial_apply_indirect_consumed_class_pair_param(ptr noalias captures(none) dereferenceable({{.*}}) %0) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { ptr, ptr } @partial_apply_indirect_consumed_class_pair_param(ptr noalias nocapture dereferenceable({{.*}}) %0) // CHECK: [[CONTEXT_OBJ:%.*]] = call noalias ptr @swift_allocObject // CHECK-NOT: {{retain|release}} // CHECK: [[T0:%.*]] = insertvalue {{.*}} [[PARTIAL_APPLY_FORWARDER:@"\$s[A-Za-z0-9_]+TA"]], {{.*}} [[CONTEXT_OBJ]] @@ -260,7 +260,7 @@ sil public_external @indirect_consumed_captured_class_pair_param : $@convention( // CHECK: [[X_TMP:%.*]] = alloca // CHECK: call ptr @"$s13partial_apply14SwiftClassPairVWOc" // CHECK: release{{.*}}%1) -// CHECK: [[RESULT:%.*]] = call swiftcc i64 @indirect_consumed_captured_class_pair_param(i64 %0, ptr noalias captures(none) dereferenceable({{.*}}) [[X_TMP]]) +// CHECK: [[RESULT:%.*]] = call swiftcc i64 @indirect_consumed_captured_class_pair_param(i64 %0, ptr noalias nocapture dereferenceable({{.*}}) [[X_TMP]]) // CHECK: ret i64 [[RESULT]] sil @partial_apply_indirect_consumed_class_pair_param : $@convention(thin) (@in SwiftClassPair) -> @callee_owned (Int) -> Int { @@ -472,7 +472,7 @@ sil public_external @generic_indirect_return : $@convention(thin) (Int) -> @ // CHECK-LABEL: define{{.*}} @partial_apply_generic_indirect_return // CHECK: insertvalue {{.*}}$s23generic_indirect_returnTA -// CHECK-LABEL: define internal swiftcc void @"$s23generic_indirect_returnTA"(ptr noalias captures(none) sret({{.*}}) %0, ptr swiftself +// CHECK-LABEL: define internal swiftcc void @"$s23generic_indirect_returnTA"(ptr noalias nocapture sret({{.*}}) %0, ptr swiftself // CHECK: call swiftcc void @generic_indirect_return({{.*}} %0, // CHECK: ret void sil @partial_apply_generic_indirect_return : $@convention(thin) (Int) -> @callee_owned () -> @owned GenericEnum { @@ -500,7 +500,7 @@ sil public_external @generic_indirect_return2 : $@convention(thin) (Int) -> // CHECK: [[R2:%.*]] = insertvalue { ptr, ptr } [[R1]], ptr [[CTX2]], 1 // CHECK: ret { ptr, ptr } [[R2]] -// CHECK-LABEL: define internal swiftcc void @"$s24generic_indirect_return2TA"(ptr noalias captures(none) sret({{.*}}) %0, ptr swiftself %1) +// CHECK-LABEL: define internal swiftcc void @"$s24generic_indirect_return2TA"(ptr noalias nocapture sret({{.*}}) %0, ptr swiftself %1) // CHECK: call swiftcc void @generic_indirect_return2(ptr noalias sret({{.*}}) %0, // CHECK: ret void sil @partial_apply_generic_indirect_return2 : $@convention(thin) (Int) -> @callee_owned () -> @owned GenericEnum2 { diff --git a/test/IRGen/partial_apply_coro.sil b/test/IRGen/partial_apply_coro.sil index 2a54583da0b75..0d728dbb08645 100644 --- a/test/IRGen/partial_apply_coro.sil +++ b/test/IRGen/partial_apply_coro.sil @@ -1012,7 +1012,7 @@ bb0(%x : $SwiftClass): } // CHECK-LABEL: define {{.*}} { ptr, ptr } @indirect_guaranteed_captured_class_param -// CHECK-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE]]) %0, [[ARGTYPE:i32|i64]] %1, ptr noalias captures(none) dereferenceable([[ARGPTR_SIZE:4|8]]) %2) +// CHECK-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE]]) %0, [[ARGTYPE:i32|i64]] %1, ptr noalias nocapture dereferenceable([[ARGPTR_SIZE:4|8]]) %2) sil public @indirect_guaranteed_captured_class_param : $@yield_once @convention(thin) (Int, @in_guaranteed SwiftClass) -> (@yields SwiftClass) { entry(%i : $Int, %c : $*SwiftClass): %0 = builtin "int_trap"() : $Never @@ -1020,7 +1020,7 @@ entry(%i : $Int, %c : $*SwiftClass): } // CHECK-LABEL: define {{.*}} { ptr, ptr } @partial_apply_indirect_guaranteed_class_param -// CHECK-SAME: (ptr noalias captures(none) dereferenceable([[ARGPTR_SIZE]]) %[[ARGPTR:.*]]) +// CHECK-SAME: (ptr noalias nocapture dereferenceable([[ARGPTR_SIZE]]) %[[ARGPTR:.*]]) // CHECK: entry: // CHECK: %[[ARG:.*]] = load ptr, ptr %[[ARGPTR]] // CHECK: %[[RET:.*]] = insertvalue { ptr, ptr } { ptr @"$s40indirect_guaranteed_captured_class_paramTA{{.*}}", ptr undef }, ptr %[[ARG]], 1 @@ -1037,7 +1037,7 @@ entry(%i : $Int, %c : $*SwiftClass): // CHECK: store ptr %[[PA_CTX_BOX]], ptr %[[SELFPTR]] // CHECK: %[[FRAMEPTR:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[FRAME]], i32 0, i32 0 // CHECK: call void @llvm.lifetime.start.p0(i64 [[BUFFER_SIZE]], ptr %[[FRAMEPTR]]) -// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, ptr } @indirect_guaranteed_captured_class_param(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], [[ARG_TYPE]] %[[ARG0]], ptr noalias captures(none) dereferenceable([[ARGPTR_SIZE]]) %[[SELFPTR]]) +// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, ptr } @indirect_guaranteed_captured_class_param(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], [[ARG_TYPE]] %[[ARG0]], ptr noalias nocapture dereferenceable([[ARGPTR_SIZE]]) %[[SELFPTR]]) // CHECK: %[[RESUME:.*]] = extractvalue { ptr, ptr } %[[YIELD_PAIR]], 0 // CHECK: %[[SPILL2:.*]] = getelementptr inbounds %"$s40indirect_guaranteed_captured_class_paramTA.Frame", ptr %[[SPILL]], i32 0, i32 1 // CHECK: store ptr %[[RESUME]], ptr %[[SPILL2]] @@ -1079,7 +1079,7 @@ bb0(%x : $*SwiftClass): } // CHECK-LABEL: define {{.*}} { ptr, ptr } @indirect_consumed_captured_class_param -// CHECK-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE:(16|32)]]) %0, [[ARGTYPE:(i32|i64)]] %1, ptr noalias captures(none) dereferenceable([[ARGPTR_SIZE:(4|8)]]) %2) +// CHECK-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE:(16|32)]]) %0, [[ARGTYPE:(i32|i64)]] %1, ptr noalias nocapture dereferenceable([[ARGPTR_SIZE:(4|8)]]) %2) sil public @indirect_consumed_captured_class_param : $@yield_once @convention(thin) (Int, @in SwiftClass) -> (@yields SwiftClass) { entry(%i : $Int, %c : $*SwiftClass): %0 = builtin "int_trap"() : $Never @@ -1087,7 +1087,7 @@ entry(%i : $Int, %c : $*SwiftClass): } // CHECK-LABEL: define {{.*}} { ptr, ptr } @partial_apply_indirect_consumed_class_param -// CHECK-SAME: (ptr noalias captures(none) dereferenceable([[ARGPTR_SIZE]]) %[[ARGPTR:.*]]) +// CHECK-SAME: (ptr noalias nocapture dereferenceable([[ARGPTR_SIZE]]) %[[ARGPTR:.*]]) // CHECK: entry: // CHECK: %[[ARG:.*]] = load ptr, ptr %[[ARGPTR]] // CHECK: %[[RET:.*]] = insertvalue { ptr, ptr } { ptr @"$s38indirect_consumed_captured_class_paramTA{{.*}}", ptr undef }, ptr %[[ARG]], 1 @@ -1105,7 +1105,7 @@ entry(%i : $Int, %c : $*SwiftClass): // CHECK: store ptr %[[PA_CTX_BOX]], ptr %[[SELFPTR]] // CHECK: %[[FRAMEPTR:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[FRAME]], i32 0, i32 0 // CHECK: call void @llvm.lifetime.start.p0(i64 [[BUFFER_SIZE]], ptr %[[FRAMEPTR]]) -// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, ptr } @indirect_consumed_captured_class_param(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], [[ARG_TYPE]] %[[ARG0]], ptr noalias captures(none) dereferenceable([[ARGPTR_SIZE]]) %[[SELFPTR]]) +// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, ptr } @indirect_consumed_captured_class_param(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], [[ARG_TYPE]] %[[ARG0]], ptr noalias nocapture dereferenceable([[ARGPTR_SIZE]]) %[[SELFPTR]]) // CHECK: %[[RESUME:.*]] = extractvalue { ptr, ptr } %[[YIELD_PAIR]], 0 // CHECK: %[[SPILL2:.*]] = getelementptr inbounds %"$s38indirect_consumed_captured_class_paramTA.Frame", ptr %[[SPILL]], i32 0, i32 1 // CHECK: store ptr %[[RESUME]], ptr %[[SPILL2]] @@ -1231,7 +1231,7 @@ bb0(%x : $SwiftClassPair): // CHECK-64-LABEL: define {{.*}} { ptr, i64 } @indirect_guaranteed_captured_class_pair_param // CHECK-32-LABEL: define {{.*}} { ptr, i32 } @indirect_guaranteed_captured_class_pair_param -// CHECK-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE:(16|32)]]) %0, [[ARG_TYPE:(i32|i64)]] %1, ptr noalias captures(none) dereferenceable([[PAIR_SIZE:(8|16)]]) %2) +// CHECK-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE:(16|32)]]) %0, [[ARG_TYPE:(i32|i64)]] %1, ptr noalias nocapture dereferenceable([[PAIR_SIZE:(8|16)]]) %2) sil public @indirect_guaranteed_captured_class_pair_param : $@yield_once @convention(thin) (Int, @in_guaranteed SwiftClassPair) -> (@yields Int) { entry(%i : $Int, %c : $*SwiftClassPair): %0 = builtin "int_trap"() : $Never @@ -1239,7 +1239,7 @@ entry(%i : $Int, %c : $*SwiftClassPair): } // CHECK-LABEL: define {{.*}} { ptr, ptr } @partial_apply_indirect_guaranteed_class_pair_param -// CHECK-SAME: (ptr noalias captures(none) dereferenceable([[PAIR_SIZE]]) %[[ARG:.*]]) +// CHECK-SAME: (ptr noalias nocapture dereferenceable([[PAIR_SIZE]]) %[[ARG:.*]]) // CHECK: entry: // CHECK: %[[BOX:.*]] = call noalias ptr @swift_allocObject(ptr getelementptr inbounds (%swift.full_boxmetadata, ptr @metadata.{{.*}} // CHECK: %[[BOXPTR:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, %T18partial_apply_coro14SwiftClassPairV }>, ptr %[[BOX]], i32 0, i32 1 @@ -1258,7 +1258,7 @@ entry(%i : $Int, %c : $*SwiftClassPair): // CHECK: %[[PA_CTX:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, %T18partial_apply_coro14SwiftClassPairV }>, ptr %[[PA_CTX_BOX]], i32 0, i32 1 // CHECK: %[[FRAMEPTR:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[SPILL1]], i32 0, i32 0 // CHECK: call void @llvm.lifetime.start.p0(i64 [[BUFFER_SIZE]], ptr %[[FRAMEPTR]]) -// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, [[ARG_TYPE]] } @indirect_guaranteed_captured_class_pair_param(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], [[ARG_TYPE]] %1, ptr noalias captures(none) dereferenceable([[PAIR_SIZE]]) %[[PA_CTX]]) +// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, [[ARG_TYPE]] } @indirect_guaranteed_captured_class_pair_param(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], [[ARG_TYPE]] %1, ptr noalias nocapture dereferenceable([[PAIR_SIZE]]) %[[PA_CTX]]) // CHECK: %[[RESUME:.*]] = extractvalue { ptr, [[ARG_TYPE]] } %[[YIELD_PAIR]], 0 // CHECK: %[[SPILL2:.*]] = getelementptr inbounds %"$s45indirect_guaranteed_captured_class_pair_paramTA.Frame", ptr %[[SPILL]], i32 0, i32 1 // CHECK: store ptr %[[RESUME]], ptr %[[SPILL2]] @@ -1301,7 +1301,7 @@ bb0(%x : $*SwiftClassPair): // CHECK-32-LABEL: define {{.*}} { ptr, i32 } @indirect_consumed_captured_class_pair_param // CHECK-64-LABEL: define {{.*}} { ptr, i64 } @indirect_consumed_captured_class_pair_param -// CHECK-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE]]) %0, [[ARG_TYPE]] %1, ptr noalias captures(none) dereferenceable([[PAIR_SIZE]]) %2) +// CHECK-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE]]) %0, [[ARG_TYPE]] %1, ptr noalias nocapture dereferenceable([[PAIR_SIZE]]) %2) sil public @indirect_consumed_captured_class_pair_param : $@yield_once @convention(thin) (Int, @in SwiftClassPair) -> (@yields Int) { entry(%i : $Int, %c : $*SwiftClassPair): %0 = builtin "int_trap"() : $Never @@ -1309,7 +1309,7 @@ entry(%i : $Int, %c : $*SwiftClassPair): } // CHECK-LABEL: define {{.*}} { ptr, ptr } @partial_apply_indirect_consumed_class_pair_param -// CHECK-SAME: (ptr noalias captures(none) dereferenceable([[PAIR_SIZE]]) %[[ARG:.*]]) +// CHECK-SAME: (ptr noalias nocapture dereferenceable([[PAIR_SIZE]]) %[[ARG:.*]]) // CHECK: entry: // CHECK: %[[BOX:.*]] = call noalias ptr @swift_allocObject(ptr getelementptr inbounds (%swift.full_boxmetadata, ptr @metadata.{{.*}} // CHECK: %[[BOXPTR:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, %T18partial_apply_coro14SwiftClassPairV }>, ptr %[[BOX]], i32 0, i32 1 @@ -1331,7 +1331,7 @@ entry(%i : $Int, %c : $*SwiftClassPair): // CHECK: %{{.*}} = call ptr @"$s18partial_apply_coro14SwiftClassPairVWOc"(ptr %[[PA_CTX]], ptr %[[SPILL1]]) // CHECK: %[[FRAMEPTR:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[FRAME]], i32 0, i32 0 // CHECK: call void @llvm.lifetime.start.p0(i64 [[BUFFER_SIZE]], ptr %[[FRAMEPTR]]) -// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, [[ARG_TYPE]] } @indirect_consumed_captured_class_pair_param(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], [[ARG_TYPE]] %1, ptr noalias captures(none) dereferenceable([[PAIR_SIZE]]) %[[SPILL1]]) +// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, [[ARG_TYPE]] } @indirect_consumed_captured_class_pair_param(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], [[ARG_TYPE]] %1, ptr noalias nocapture dereferenceable([[PAIR_SIZE]]) %[[SPILL1]]) // CHECK: %[[RESUME:.*]] = extractvalue { ptr, [[ARG_TYPE]] } %[[YIELD_PAIR]], 0 // CHECK: %[[SPILL2:.*]] = getelementptr inbounds %"$s43indirect_consumed_captured_class_pair_paramTA.Frame", ptr %[[SPILL]], i32 0, i32 2 // CHECK: store ptr %[[RESUME]], ptr %[[SPILL2]] @@ -2059,7 +2059,7 @@ class A3 {} sil_vtable A3 {} // CHECK-LABEL: define {{.*}} { ptr, ptr, ptr } @amethod -// CHECK-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE:(16|32)]]) %0, ptr noalias captures(none) swiftself dereferenceable([[SELF_SIZE:(4|8)]]) %1, ptr noalias captures(none) swifterror dereferenceable([[ERROR_SIZE:(4|8)]]) %2) +// CHECK-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE:(16|32)]]) %0, ptr noalias nocapture swiftself dereferenceable([[SELF_SIZE:(4|8)]]) %1, ptr noalias nocapture swifterror dereferenceable([[ERROR_SIZE:(4|8)]]) %2) sil @amethod : $@yield_once @convention(method) (@in_guaranteed A2) -> (@yields A1, @error Error) { entry(%a : $*A2): %0 = builtin "int_trap"() : $Never @@ -2067,13 +2067,13 @@ entry(%a : $*A2): } // CHECK-LABEL: define {{.*}} { ptr, ptr } @repo -// CHECK-SAME: (ptr noalias captures(none) dereferenceable([[SELF_SIZE]]) %[[ARG:.*]]) +// CHECK-SAME: (ptr noalias nocapture dereferenceable([[SELF_SIZE]]) %[[ARG:.*]]) // CHECK: %[[RET:.*]] = insertvalue { ptr, ptr } { ptr @"$s7amethodTA{{.*}}", ptr undef }, ptr %{{.*}}, 1 // CHECK: ret { ptr, ptr } %[[RET]] // CHECK: } // // CHECK-LABEL: define {{.*}} { ptr, ptr, ptr } @"$s7amethodTA" -// CHECK-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[CTX:.*]], ptr swiftself %[[SELF:.*]], ptr noalias captures(none) swifterror dereferenceable([[ERROR_SIZE]]) %[[ERRORPTR:.*]]) +// CHECK-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[CTX:.*]], ptr swiftself %[[SELF:.*]], ptr noalias nocapture swifterror dereferenceable([[ERROR_SIZE]]) %[[ERRORPTR:.*]]) // CHECK: entry: // CHECK: %[[SELFPTR:.*]] = alloca ptr // CHECK: %[[SPILL:.*]] = call ptr @malloc @@ -2083,7 +2083,7 @@ entry(%a : $*A2): // CHECK: %[[FRAMEPTR:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[FRAME]], i32 0, i32 0 // CHECK: call void @llvm.lifetime.start.p0(i64 [[BUFFER_SIZE]], ptr %[[FRAMEPTR]]) // CHECK: store ptr null, ptr %[[ERRORPTR]] -// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, ptr, ptr } @amethod(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], ptr noalias captures(none) swiftself dereferenceable([[SELF_SIZE]]) %[[SELFPTR]], ptr noalias captures(none) swifterror dereferenceable([[ERROR_SIZE]]) %[[ERRORPTR]]) +// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, ptr, ptr } @amethod(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], ptr noalias nocapture swiftself dereferenceable([[SELF_SIZE]]) %[[SELFPTR]], ptr noalias nocapture swifterror dereferenceable([[ERROR_SIZE]]) %[[ERRORPTR]]) // CHECK: %[[ERRORVAL:.*]] = load ptr, ptr %[[ERRORPTR]] // CHECK: %[[RESUME0:.*]] = extractvalue { ptr, ptr, ptr } %[[YIELD_PAIR]], 0 // CHECK: %[[SPILL2:.*]] = getelementptr inbounds %"$s7amethodTA.Frame", ptr %[[SPILL]], i32 0, i32 1 @@ -2137,7 +2137,7 @@ bb0(%0 : $*A2): } // CHECK-LABEL: define {{.*}} { ptr, ptr } @partial_apply_callee_guaranteed_indirect_guaranteed_class_pair_param -// CHECK-SAME: (ptr noalias captures(none) dereferenceable([[ARG_SIZE:(8|16)]]) %[[ARG:.*]]) +// CHECK-SAME: (ptr noalias nocapture dereferenceable([[ARG_SIZE:(8|16)]]) %[[ARG:.*]]) // CHECK: entry: // CHECK: %[[BOX:.*]] = call noalias ptr @swift_allocObject(ptr getelementptr inbounds (%swift.full_boxmetadata, ptr @metadata // CHECK: %[[BOXPTR:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, %T18partial_apply_coro14SwiftClassPairV }>, ptr %[[BOX]], i32 0, i32 1 @@ -2156,7 +2156,7 @@ bb0(%0 : $*A2): // CHECK: %[[PA_CTX:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, %T18partial_apply_coro14SwiftClassPairV }>, ptr %[[PA_CTX_BOX]], i32 0, i32 1 // CHECK: %[[PA_ARG:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[FRAME]], i32 0, i32 0 // CHECK: call void @llvm.lifetime.start.p0(i64 [[BUFFER_SIZE]], ptr %[[PA_ARG]]) -// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, [[ARG_TYPE]] } @indirect_guaranteed_captured_class_pair_param(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[PA_ARG]], [[ARG_TYPE]] %[[ARG0]], ptr noalias captures(none) dereferenceable({{8|16}}) %[[PA_CTX]]) +// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, [[ARG_TYPE]] } @indirect_guaranteed_captured_class_pair_param(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[PA_ARG]], [[ARG_TYPE]] %[[ARG0]], ptr noalias nocapture dereferenceable({{8|16}}) %[[PA_CTX]]) // CHECK: %[[RESUME:.*]] = extractvalue { ptr, [[ARG_TYPE]] } %[[YIELD_PAIR]], 0 // CHECK: %[[SPILL2:.*]] = getelementptr inbounds %"$s45indirect_guaranteed_captured_class_pair_paramTA.{{[0-9]+}}.Frame", ptr %[[SPILL]], i32 0, i32 1 // CHECK: store ptr %[[RESUME]], ptr %[[SPILL2]], @@ -2201,7 +2201,7 @@ bb0(%x : $*SwiftClassPair): sil public_external @use_closure2 : $@yield_once @convention(thin) (@noescape @yield_once @callee_guaranteed (Int) -> (@yields Int)) -> (@yields Int) // CHECK-LABEL: define {{.*}} @partial_apply_stack_callee_guaranteed_indirect_guaranteed_class_pair_param -// CHECK-SAME: (ptr noalias captures(none) dereferenceable([[ARG_SIZE:(8|16)]]) %[[ARG:.*]]) +// CHECK-SAME: (ptr noalias nocapture dereferenceable([[ARG_SIZE:(8|16)]]) %[[ARG:.*]]) // CHECK: entry: // CHECK: %[[CTX:.*]] = alloca [[[BUFFER_SIZE]] x i8] // CHECK: %[[BOX:.*]] = alloca i8 @@ -2228,7 +2228,7 @@ sil public_external @use_closure2 : $@yield_once @convention(thin) (@noescape @y // CHECK: %[[PA_ARG:.*]] = load ptr, ptr %[[PA_CTX]] // CHECK: %[[FRAMEPTR:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[FRAME]], i32 0, i32 0 // CHECK: call void @llvm.lifetime.start.p0(i64 [[BUFFER_SIZE]], ptr %[[FRAMEPTR]]) -// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, [[ARG_TYPE]] } @indirect_guaranteed_captured_class_pair_param(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], [[ARG_TYPE]] %[[ARG0]], ptr noalias captures(none) dereferenceable({{8|16}}) %[[PA_ARG]]) +// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, [[ARG_TYPE]] } @indirect_guaranteed_captured_class_pair_param(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], [[ARG_TYPE]] %[[ARG0]], ptr noalias nocapture dereferenceable({{8|16}}) %[[PA_ARG]]) // CHECK: %[[RESUME:.*]] = extractvalue { ptr, [[ARG_TYPE]] } %[[YIELD_PAIR]], 0 // CHECK: %[[SPILL2:.*]] = getelementptr inbounds %"$s45indirect_guaranteed_captured_class_pair_paramTA.{{[0-9]+}}.Frame", ptr %[[SPILL]], i32 0, i32 1 // CHECK: store ptr %[[RESUME]], ptr %[[SPILL2]] @@ -2276,7 +2276,7 @@ bb0(%x : $*SwiftClassPair): // CHECK-32-LABEL: define {{.*}} { ptr, i32 } @indirect_in_captured_class_pair_param // CHECK-64-LABEL: define {{.*}} { ptr, i64 } @indirect_in_captured_class_pair_param -// CHECK-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE:(16|32)]]) %0, [[ARG_TYPE:(i32|i64)]] %{{.*}}, ptr noalias captures(none) dereferenceable([[PAIR_SIZE:(8|16)]]) %{{.*}}) +// CHECK-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE:(16|32)]]) %0, [[ARG_TYPE:(i32|i64)]] %{{.*}}, ptr noalias nocapture dereferenceable([[PAIR_SIZE:(8|16)]]) %{{.*}}) sil public @indirect_in_captured_class_pair_param : $@yield_once @convention(thin) (Int, @in_guaranteed SwiftClassPair) -> (@yields Int) { entry(%i : $Int, %p : $*SwiftClassPair): %0 = builtin "int_trap"() : $Never @@ -2284,7 +2284,7 @@ entry(%i : $Int, %p : $*SwiftClassPair): } // CHECK-LABEL: define {{.*}} void @partial_apply_stack_callee_guaranteed_indirect_in_class_pair_param -// CHECK-SAME: (ptr noalias captures(none) dereferenceable([[PAIR_SIZE]]) %[[ARG:.*]]) +// CHECK-SAME: (ptr noalias nocapture dereferenceable([[PAIR_SIZE]]) %[[ARG:.*]]) // CHECK: entry: // CHECK: %[[CTX:.*]] = alloca [[[BUFFER_SIZE]] x i8], // CHECK: %[[BOX:.*]] = alloca i8 @@ -2312,7 +2312,7 @@ entry(%i : $Int, %p : $*SwiftClassPair): // CHECK: %[[PA_ARG:.*]] = load ptr, ptr %[[PA_CTX]] // CHECK: %[[FRAMEPTR:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[FRAME]], i32 0, i32 0 // CHECK: call void @llvm.lifetime.start.p0(i64 [[BUFFER_SIZE]], ptr %[[FRAMEPTR]]) -// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, [[ARG_TYPE]] } @indirect_in_captured_class_pair_param(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], [[ARG_TYPE]] %[[ARG0]], ptr noalias captures(none) dereferenceable([[PAIR_SIZE]]) %[[PA_ARG]]) +// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, [[ARG_TYPE]] } @indirect_in_captured_class_pair_param(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], [[ARG_TYPE]] %[[ARG0]], ptr noalias nocapture dereferenceable([[PAIR_SIZE]]) %[[PA_ARG]]) // CHECK: %[[RESUME:.*]] = extractvalue { ptr, [[ARG_TYPE]] } %[[YIELD_PAIR]], 0 // CHECK: %[[SPILL2:.*]] = getelementptr inbounds %"$s37indirect_in_captured_class_pair_paramTA.Frame", ptr %[[SPILL]], i32 0, i32 1 // CHECK: store ptr %[[RESUME]], ptr %[[SPILL2]] @@ -2477,7 +2477,7 @@ entry: // CHECK-32: define {{.*}} { ptr, i32 } @indirect_in_constant_captured_class_pair_param // CHECK-64: define {{.*}} { ptr, i64 } @indirect_in_constant_captured_class_pair_param -// CHECK-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE:(16|32)]]) %0, [[ARG_TYPE:(i32|i64)]] %1, ptr noalias captures(none) dereferenceable([[PAIR_SIZE:(8|16)]]) %2) +// CHECK-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE:(16|32)]]) %0, [[ARG_TYPE:(i32|i64)]] %1, ptr noalias nocapture dereferenceable([[PAIR_SIZE:(8|16)]]) %2) sil public @indirect_in_constant_captured_class_pair_param : $@yield_once @convention(thin) (Int, @in_guaranteed SwiftClassPair) -> (@yields Int) { entry(%i : $Int, %ic : $*SwiftClassPair): %0 = builtin "int_trap"() : $Never @@ -2485,7 +2485,7 @@ entry(%i : $Int, %ic : $*SwiftClassPair): } // CHECK-LABEL: define {{.*}} void @partial_apply_stack_callee_guaranteed_indirect_in_constant_class_pair_param -// CHECK-SAME: (ptr noalias captures(none) dereferenceable([[PAIR_SIZE]]) %[[ARG:.*]]) +// CHECK-SAME: (ptr noalias nocapture dereferenceable([[PAIR_SIZE]]) %[[ARG:.*]]) // CHECK: entry: // CHECK: %[[CTX:.*]] = alloca [[[BUFFER_SIZE]] x i8] // CHECK: %[[BOX:.*]] = alloca i8 @@ -2513,7 +2513,7 @@ entry(%i : $Int, %ic : $*SwiftClassPair): // CHECK: %[[PA_ARG:.*]] = load ptr, ptr %[[PA_CTX]] // CHECK: %[[FRAMEPTR:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[FRAME]], i32 0, i32 0 // CHECK: call void @llvm.lifetime.start.p0(i64 [[BUFFER_SIZE]], ptr %[[FRAMEPTR]]) -// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, [[ARG_TYPE]] } @indirect_in_constant_captured_class_pair_param(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], [[ARG_TYPE]] %[[ARG0]], ptr noalias captures(none) dereferenceable([[PAIR_SIZE]]) %[[PA_ARG]]) +// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, [[ARG_TYPE]] } @indirect_in_constant_captured_class_pair_param(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], [[ARG_TYPE]] %[[ARG0]], ptr noalias nocapture dereferenceable([[PAIR_SIZE]]) %[[PA_ARG]]) // CHECK: %[[RESUME:.*]] = extractvalue { ptr, [[ARG_TYPE]] } %[[YIELD_PAIR]], 0 // CHECK: %[[SPILL2:.*]] = getelementptr inbounds %"$s46indirect_in_constant_captured_class_pair_paramTA.Frame", ptr %[[SPILL]], i32 0, i32 1 // CHECK: store ptr %[[RESUME]], ptr %[[SPILL2]] @@ -2579,7 +2579,7 @@ bb0(%thick : $@callee_guaranteed @yield_once @convention(thick) (Int64, Int32) - // CHECK: } // // CHECK-LABEL: define {{.*}} ptr @"$s16external_closureTA" -// CHECK-SAME: (ptr noalias {{.*}} %[[CTX:.*]], [[ARG_TYPE]] %[[ARG1:.*]], ptr swiftself %[[PA_CTX_BOX:.*]], ptr noalias captures(none) swifterror {{.*}} %[[ERROR:.*]]) +// CHECK-SAME: (ptr noalias {{.*}} %[[CTX:.*]], [[ARG_TYPE]] %[[ARG1:.*]], ptr swiftself %[[PA_CTX_BOX:.*]], ptr noalias nocapture swifterror {{.*}} %[[ERROR:.*]]) // CHECK: entry: // CHECK: %[[SPILL:.*]] = call ptr @malloc // CHECK: store ptr %[[SPILL]], ptr %[[CTX]] @@ -2590,7 +2590,7 @@ bb0(%thick : $@callee_guaranteed @yield_once @convention(thick) (Int64, Int32) - // CHECK: %[[FRAMEPTR:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[FRAME]], i32 0, i32 0 // CHECK: call void @llvm.lifetime.start.p0(i64 [[BUFFER_SIZE]], ptr %[[FRAMEPTR]]) // CHECK: store ptr null, ptr %[[ERROR]] -// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc ptr @external_closure(ptr noalias {{.*}} %[[FRAMEPTR]], [[ARG_TYPE]] %[[ARG1]], [[ARG_TYPE]] %[[ARG2]], ptr swiftself undef, ptr noalias captures(none) swifterror {{.*}} %[[ERROR]]) +// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc ptr @external_closure(ptr noalias {{.*}} %[[FRAMEPTR]], [[ARG_TYPE]] %[[ARG1]], [[ARG_TYPE]] %[[ARG2]], ptr swiftself undef, ptr noalias nocapture swifterror {{.*}} %[[ERROR]]) // CHECK: %[[SPILL1:.*]] = getelementptr inbounds %"$s16external_closureTA.Frame", ptr %[[SPILL]], i32 0, i32 1 // CHECK: store ptr %[[YIELD_PAIR]], ptr %[[SPILL1]] // CHECK: %[[ERRORVAL:.*]] = load ptr, ptr %[[ERROR]] diff --git a/test/IRGen/partial_apply_generic.swift b/test/IRGen/partial_apply_generic.swift index d8a13172eb81d..20796c87214f0 100644 --- a/test/IRGen/partial_apply_generic.swift +++ b/test/IRGen/partial_apply_generic.swift @@ -37,7 +37,7 @@ var x = seq ~> split // Indirect return // -// CHECK-LABEL: define internal swiftcc { ptr, ptr } @"$s21partial_apply_generic5split{{[_0-9a-zA-Z]*}}FTA"(ptr noalias captures(none) %0, ptr swiftself %1) +// CHECK-LABEL: define internal swiftcc { ptr, ptr } @"$s21partial_apply_generic5split{{[_0-9a-zA-Z]*}}FTA"(ptr noalias nocapture %0, ptr swiftself %1) // CHECK: tail call swiftcc { ptr, ptr } @"$s21partial_apply_generic5split{{[_0-9a-zA-Z]*}}F"(ptr noalias %0, struct HugeStruct { var a, b, c, d: Int } diff --git a/test/IRGen/pre_specialize.swift b/test/IRGen/pre_specialize.swift index a31b3049ab48c..f7456f36753bf 100644 --- a/test/IRGen/pre_specialize.swift +++ b/test/IRGen/pre_specialize.swift @@ -42,12 +42,11 @@ // specialized InternalThing.computedX.getter // CHECK-A-DAG: define{{( dllexport)?}}{{( protected)?}} swiftcc [[INT]] @"$s1A13InternalThingV9computedXxvgSi_Ts5"([[INT]]{{( returned)?}} %0) // specialized InternalThing.computedX.setter -// CHECK-A-DAG: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s1A13InternalThingV9computedXxvsSi_Ts5"([[INT]] %0, ptr captures(none) swiftself {{(writeonly )?}}dereferenceable({{(4|8)}}){{.*}} %1) - +// CHECK-A-DAG: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s1A13InternalThingV9computedXxvsSi_Ts5"([[INT]] %0, ptr nocapture swiftself {{(writeonly )?}}dereferenceable({{(4|8)}}){{.*}} %1) // specialized InternalThing.subscript.getter // CHECK-A-DAG: define{{( dllexport)?}}{{( protected)?}} swiftcc [[INT]] @"$s1A13InternalThingVyxSicigSi_Ts5"([[INT]] %0, [[INT]]{{( returned)?}} %1) // specialized InternalThing.subscript.setter -// CHECK-A-DAG: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s1A13InternalThingVyxSicisSi_Ts5"([[INT]] %0, [[INT]] %1, ptr captures(none) swiftself {{(writeonly )?}}dereferenceable({{(4|8)}}){{.*}} %2) +// CHECK-A-DAG: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s1A13InternalThingVyxSicisSi_Ts5"([[INT]] %0, [[INT]] %1, ptr nocapture swiftself {{(writeonly )?}}dereferenceable({{(4|8)}}){{.*}} %2) // specialized InternalRef.compute() // CHECK-A-FRAG-DAG: define{{( dllexport)?}}{{( protected)?}} swiftcc [[INT:(i64|i32)]] @"$s1A11InternalRefC7computexyFAA09ResilientA10BoxedThingVySiG_Ts5" @@ -76,13 +75,13 @@ // CHECK-B-DAG: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @"$s1A13InternalThingV9computedXxvg1B07AnotherB0C_Ts5"(ptr{{( returned)?}} %0) // specialized InternalThing.computedX.setter -// CHECK-B-DAG: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s1A13InternalThingV9computedXxvs1B07AnotherB0C_Ts5"(ptr %0, ptr captures(none) swiftself dereferenceable({{(4|8)}}) %1) +// CHECK-B-DAG: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s1A13InternalThingV9computedXxvs1B07AnotherB0C_Ts5"(ptr %0, ptr nocapture swiftself dereferenceable({{(4|8)}}) %1) // specialized InternalThing.subscript.getter // CHECK-B-DAG: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @"$s1A13InternalThingVyxSicig1B07AnotherB0C_Ts5"([[INT:(i64|i32)]] %0, ptr{{( returned)?}} %1) // specialized InternalThing.subscript.setter -// CHECK-B-DAG: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s1A13InternalThingVyxSicis1B07AnotherB0C_Ts5"(ptr %0, [[INT]] %1, ptr captures(none) swiftself dereferenceable({{(4|8)}}) %2) +// CHECK-B-DAG: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s1A13InternalThingVyxSicis1B07AnotherB0C_Ts5"(ptr %0, [[INT]] %1, ptr nocapture swiftself dereferenceable({{(4|8)}}) %2) // specialized InternalRef.compute() // CHECK-B-DAG: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @"$s1A11InternalRefC7computexyF1B12AnotherThingC_Ts5 diff --git a/test/IRGen/protocol_accessor_multifile.swift b/test/IRGen/protocol_accessor_multifile.swift index 65ccc1c7b0a48..ee4c41e3ecd32 100644 --- a/test/IRGen/protocol_accessor_multifile.swift +++ b/test/IRGen/protocol_accessor_multifile.swift @@ -8,7 +8,7 @@ // CHECK-LABEL: define{{.*}} void @"$s27protocol_accessor_multifile14useExistentialyyF"() func useExistential() { // CHECK: [[BOX:%.+]] = alloca %T27protocol_accessor_multifile5ProtoP, - // CHECK: call swiftcc void @"$s27protocol_accessor_multifile17globalExistentialAA5Proto_pvg"(ptr noalias captures(none) sret({{.*}}) [[BOX]]) + // CHECK: call swiftcc void @"$s27protocol_accessor_multifile17globalExistentialAA5Proto_pvg"(ptr noalias nocapture sret({{.*}}) [[BOX]]) // CHECK: call swiftcc void @"$s27protocol_accessor_multifile5ProtoPAAE6methodyyF" globalExistential.method() // CHECK: call void @__swift_destroy_boxed_opaque_existential_1(ptr [[BOX]]) diff --git a/test/IRGen/protocol_resilience.sil b/test/IRGen/protocol_resilience.sil index 7ce5cfc0a10f7..dcd3871e88bd9 100644 --- a/test/IRGen/protocol_resilience.sil +++ b/test/IRGen/protocol_resilience.sil @@ -262,7 +262,7 @@ struct ConformingStruct : ResilientProtocol { static func defaultF() } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @noDefaultA(ptr noalias captures(none) swiftself %0, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @noDefaultA(ptr noalias nocapture swiftself %0, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: sil @noDefaultA : $@convention(witness_method: ResilientProtocol) (@in_guaranteed ConformingStruct) -> () { @@ -281,7 +281,7 @@ bb0(%0 : $*ConformingStruct): } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @noDefaultB(ptr noalias captures(none) swiftself %0, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @noDefaultB(ptr noalias nocapture swiftself %0, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: sil @noDefaultB : $@convention(witness_method: ResilientProtocol) (@in_guaranteed ConformingStruct) -> () { @@ -324,7 +324,7 @@ bb0(%0 : $*T): return %result : $() } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @passConformingType(ptr noalias captures(none) %0) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @passConformingType(ptr noalias nocapture %0) sil @passConformingType : $@convention(thin) (@in ResilientConformingType) -> () { bb0(%0 : $*ResilientConformingType): @@ -381,7 +381,7 @@ bb0(%0 : $*T): return %result : $() } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @passConformingTypeRefined(ptr noalias captures(none) %0) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @passConformingTypeRefined(ptr noalias nocapture %0) sil @passConformingTypeRefined : $@convention(thin) (@in AnotherConformingStruct) -> () { bb0(%0 : $*AnotherConformingStruct): @@ -424,7 +424,7 @@ bb0(%0 : $*T): return %result : $() } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @passConformingTypeAssoc(ptr noalias captures(none) %0) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @passConformingTypeAssoc(ptr noalias nocapture %0) sil @passConformingTypeAssoc : $@convention(thin) (@in ConformsWithResilientAssoc) -> () { bb0(%0 : $*ConformsWithResilientAssoc): diff --git a/test/IRGen/protocol_resilience_thunks.swift b/test/IRGen/protocol_resilience_thunks.swift index 491fec9c2dffe..7317d671b3690 100644 --- a/test/IRGen/protocol_resilience_thunks.swift +++ b/test/IRGen/protocol_resilience_thunks.swift @@ -52,12 +52,12 @@ public protocol MyResilientProtocol { // CHECK-NEXT: [[RESULT:%.*]] = call swiftcc i1 [[WITNESS]](ptr noalias swiftself %0, ptr %1, ptr %2) // CHECK-NEXT: ret i1 [[RESULT]] -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s26protocol_resilience_thunks19MyResilientProtocolP10returnsAnyypyFTj"(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias swiftself %1, ptr %2, ptr %3) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s26protocol_resilience_thunks19MyResilientProtocolP10returnsAnyypyFTj"(ptr noalias nocapture sret({{.*}}) %0, ptr noalias swiftself %1, ptr %2, ptr %3) // CHECK: [[WITNESS_ADDR:%.*]] = getelementptr inbounds ptr, ptr %3, i32 3 // CHECK-NEXT: [[WITNESS:%.*]] = load ptr, ptr [[WITNESS_ADDR]] // CHECK-arm64e-NEXT: ptrtoint ptr [[WITNESS_ADDR]] to i64 // CHECK-arm64e-NEXT: call i64 @llvm.ptrauth.blend -// CHECK-NEXT: call swiftcc void [[WITNESS]](ptr noalias captures(none) sret({{.*}}) %0, ptr noalias swiftself %1, ptr %2, ptr %3) +// CHECK-NEXT: call swiftcc void [[WITNESS]](ptr noalias nocapture sret({{.*}}) %0, ptr noalias swiftself %1, ptr %2, ptr %3) // CHECK-NEXT: ret void // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s26protocol_resilience_thunks19MyResilientProtocolP12throwingFuncyyKFTj"(ptr noalias swiftself %0, ptr{{( noalias nocapture( swifterror)? dereferenceable\(.\))?}} %1, ptr %2, ptr %3) diff --git a/test/IRGen/same_type_constraints.swift b/test/IRGen/same_type_constraints.swift index 0adae5e99a89d..4287f34a4c96f 100644 --- a/test/IRGen/same_type_constraints.swift +++ b/test/IRGen/same_type_constraints.swift @@ -67,7 +67,7 @@ where Self : CodingType, print(Self.ValueType.self) } -// OSIZE: define internal swiftcc ptr @"$s21same_type_constraints12GenericKlazzCyxq_GAA1EAA4DataAaEP_AA0F4TypePWT"(ptr readnone %"GenericKlazz.Data", ptr captures(none) readonly %"GenericKlazz", ptr captures(none) readnone %"GenericKlazz.E") [[ATTRS:#[0-9]+]] { +// OSIZE: define internal swiftcc ptr @"$s21same_type_constraints12GenericKlazzCyxq_GAA1EAA4DataAaEP_AA0F4TypePWT"(ptr readnone %"GenericKlazz.Data", ptr nocapture readonly %"GenericKlazz", ptr nocapture readnone %"GenericKlazz.E") [[ATTRS:#[0-9]+]] { // OSIZE: [[ATTRS]] = {{{.*}}noinline // Check that same-typing two generic parameters together lowers correctly. diff --git a/test/IRGen/select_enum.sil b/test/IRGen/select_enum.sil index 2d9fdeff6bec0..326fc5d7bedaf 100644 --- a/test/IRGen/select_enum.sil +++ b/test/IRGen/select_enum.sil @@ -7,7 +7,7 @@ enum SinglePayloadSingleEmpty { case DataCase(Builtin.Word) } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @select_enum_SinglePayloadSingleEmpty(ptr noalias captures(none) dereferenceable({{.*}}) %0) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @select_enum_SinglePayloadSingleEmpty(ptr noalias nocapture dereferenceable({{.*}}) %0) sil @select_enum_SinglePayloadSingleEmpty : $@convention(thin) (@in SinglePayloadSingleEmpty) -> () { bb0(%0 : $*SinglePayloadSingleEmpty): %1 = load %0 : $*SinglePayloadSingleEmpty diff --git a/test/IRGen/sil_generic_witness_methods.swift b/test/IRGen/sil_generic_witness_methods.swift index ddecb7406b058..7a3fa619c093a 100644 --- a/test/IRGen/sil_generic_witness_methods.swift +++ b/test/IRGen/sil_generic_witness_methods.swift @@ -34,7 +34,7 @@ func call_methods(_ x: T, y: S, z: U) { x.generic_method(z) } -// CHECK-LABEL: define hidden swiftcc void @"$s27sil_generic_witness_methods017call_existential_D0{{[_0-9a-zA-Z]*}}F"(ptr noalias captures(none) dereferenceable({{.*}}) %0) +// CHECK-LABEL: define hidden swiftcc void @"$s27sil_generic_witness_methods017call_existential_D0{{[_0-9a-zA-Z]*}}F"(ptr noalias nocapture dereferenceable({{.*}}) %0) func call_existential_methods(_ x: P, y: S) { // CHECK: [[METADATA_ADDR:%.*]] = getelementptr inbounds{{.*}} %T27sil_generic_witness_methods1PP, ptr [[X:%0]], i32 0, i32 1 // CHECK: [[METADATA:%.*]] = load ptr, ptr [[METADATA_ADDR]], align 8 diff --git a/test/IRGen/sil_witness_methods.sil b/test/IRGen/sil_witness_methods.sil index 300d608a30679..e1a6e737bbd0b 100644 --- a/test/IRGen/sil_witness_methods.sil +++ b/test/IRGen/sil_witness_methods.sil @@ -28,14 +28,14 @@ struct X {} struct Y {} struct Z {} -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @concrete_type_concrete_method_witness(ptr noalias captures(none) swiftself %0, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @concrete_type_concrete_method_witness(ptr noalias nocapture swiftself %0, ptr %Self, ptr %SelfWitnessTable) sil @concrete_type_concrete_method_witness : $@convention(witness_method: P) (@in Foo) -> @thick Foo.Type { entry(%x : $*Foo): %m = metatype $@thick Foo.Type return %m : $@thick Foo.Type } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @generic_type_concrete_method_witness(ptr noalias captures(none) swiftself dereferenceable({{.*}}) %0, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @generic_type_concrete_method_witness(ptr noalias nocapture swiftself dereferenceable({{.*}}) %0, ptr %Self, ptr %SelfWitnessTable) // CHECK-objc: [[T1:%.*]] = getelementptr inbounds ptr, ptr %Self, i64 10 // CHECK-native: [[T1:%.*]] = getelementptr inbounds ptr, ptr %Self, i64 7 // CHECK: %T = load ptr, ptr [[T1]], align 8 @@ -87,14 +87,14 @@ entry(%x : $@thick Bar.Type): // TODO: %Self Type arg is redundant for class method witness -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @concrete_type_generic_method_witness(ptr noalias %0, ptr %Z, ptr noalias captures(none) swiftself %1, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @concrete_type_generic_method_witness(ptr noalias %0, ptr %Z, ptr noalias nocapture swiftself %1, ptr %Self, ptr %SelfWitnessTable) sil @concrete_type_generic_method_witness : $@convention(witness_method: P) (@in Z, @in Foo) -> @thick Foo.Type { entry(%z : $*Z, %x : $*Foo): %m = metatype $@thick Foo.Type return %m : $@thick Foo.Type } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @generic_type_generic_method_witness(ptr noalias %0, ptr %Z, ptr noalias captures(none) swiftself dereferenceable(8) %1, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @generic_type_generic_method_witness(ptr noalias %0, ptr %Z, ptr noalias nocapture swiftself dereferenceable(8) %1, ptr %Self, ptr %SelfWitnessTable) sil @generic_type_generic_method_witness : $@convention(witness_method: P) (@in Z, @in Bar) -> @thick Bar.Type { entry(%z : $*Z, %x : $*Bar): %t = metatype $@thick T.Type diff --git a/test/IRGen/sil_witness_tables.swift b/test/IRGen/sil_witness_tables.swift index f900a2826a42e..94b5d0bc4e4ea 100644 --- a/test/IRGen/sil_witness_tables.swift +++ b/test/IRGen/sil_witness_tables.swift @@ -57,14 +57,14 @@ struct Conformer2: Q { func qMethod() {} } -// CHECK-LABEL: define hidden swiftcc void @"$s18sil_witness_tables7erasure1cAA2QQ_pAA9ConformerV_tF"(ptr noalias captures(none) sret({{.*}}) %0) +// CHECK-LABEL: define hidden swiftcc void @"$s18sil_witness_tables7erasure1cAA2QQ_pAA9ConformerV_tF"(ptr noalias nocapture sret({{.*}}) %0) // CHECK: [[WITNESS_TABLE_ADDR:%.*]] = getelementptr inbounds{{.*}} %T18sil_witness_tables2QQP, ptr %0, i32 0, i32 2 // CHECK-NEXT: store ptr [[CONFORMER_QQ_WITNESS_TABLE:@"\$s.*WP"]], ptr [[WITNESS_TABLE_ADDR]], align 8 func erasure(c: Conformer) -> QQ { return c } -// CHECK-LABEL: define hidden swiftcc void @"$s18sil_witness_tables15externalErasure1c0a1_b1_c1_D12_conformance9ExternalP_pAD0G9ConformerV_tF"(ptr noalias captures(none) sret({{.*}}) %0) +// CHECK-LABEL: define hidden swiftcc void @"$s18sil_witness_tables15externalErasure1c0a1_b1_c1_D12_conformance9ExternalP_pAD0G9ConformerV_tF"(ptr noalias nocapture sret({{.*}}) %0) // CHECK: [[WITNESS_TABLE_ADDR:%.*]] = getelementptr inbounds{{.*}} %T39sil_witness_tables_external_conformance9ExternalPP, ptr %0, i32 0, i32 2 // CHECK-NEXT: store ptr [[EXTERNAL_CONFORMER_EXTERNAL_P_WITNESS_TABLE]], ptr %2, align 8 func externalErasure(c: ExternalConformer) -> ExternalP { diff --git a/test/IRGen/struct_resilience.swift b/test/IRGen/struct_resilience.swift index 81473ef91ca6c..5871ed78b1c6f 100644 --- a/test/IRGen/struct_resilience.swift +++ b/test/IRGen/struct_resilience.swift @@ -80,7 +80,7 @@ public struct MySize { public let h: Int } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s17struct_resilience32functionWithMyResilientTypesSize_1fAA0eH0VAEn_A2EnXEtF"(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias captures(none) dereferenceable({{8|(16)}}) %1, ptr %2, ptr %3) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s17struct_resilience32functionWithMyResilientTypesSize_1fAA0eH0VAEn_A2EnXEtF"(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture dereferenceable({{8|(16)}}) %1, ptr %2, ptr %3) public func functionWithMyResilientTypesSize(_ s: __owned MySize, f: (__owned MySize) -> MySize) -> MySize { // There's an alloca for debug info? @@ -108,7 +108,7 @@ public func functionWithMyResilientTypesSize(_ s: __owned MySize, f: (__owned My // CHECK: store [[INT]] [[H]], ptr [[H_PTR]] -// CHECK: call swiftcc void %2(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias captures(none) dereferenceable({{8|16}}) [[DST]], ptr swiftself %3) +// CHECK: call swiftcc void %2(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture dereferenceable({{8|16}}) [[DST]], ptr swiftself %3) // CHECK: call void @llvm.lifetime.end.p0({{i32|i64}} {{8|16}}, ptr [[DST]]) // CHECK: ret void @@ -164,7 +164,7 @@ public struct ResilientStructWithMethod { // Corner case -- type is address-only in SIL, but empty in IRGen -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s17struct_resilience29partialApplyOfResilientMethod1ryAA0f10StructWithG0V_tF"(ptr noalias captures(none) %0) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s17struct_resilience29partialApplyOfResilientMethod1ryAA0f10StructWithG0V_tF"(ptr noalias nocapture %0) public func partialApplyOfResilientMethod(r: ResilientStructWithMethod) { _ = r.method } @@ -190,7 +190,7 @@ public func resilientAny(s : ResilientWeakRef) { // CHECK: [[TYADDR:%.*]] = getelementptr inbounds{{.*}} %Any, ptr [[ANY]], i32 0, i32 1 // CHECK: store ptr [[META2]], ptr [[TYADDR]] // CHECK: call ptr @__swift_allocate_boxed_opaque_existential_0(ptr [[ANY]]) -// CHECK: call swiftcc void @"$s17struct_resilience8wantsAnyyyypF"(ptr noalias captures(none) dereferenceable({{(32|16)}}) [[ANY]]) +// CHECK: call swiftcc void @"$s17struct_resilience8wantsAnyyyypF"(ptr noalias nocapture dereferenceable({{(32|16)}}) [[ANY]]) // CHECK: call void @__swift_destroy_boxed_opaque_existential_0(ptr [[ANY]]) // CHECK: ret void diff --git a/test/IRGen/struct_with_resilient_type.swift b/test/IRGen/struct_with_resilient_type.swift index 47b49edf94261..00c03d270cb57 100644 --- a/test/IRGen/struct_with_resilient_type.swift +++ b/test/IRGen/struct_with_resilient_type.swift @@ -44,7 +44,7 @@ crashCaller() // Don't use the type layout based value witness based generation (i.e we load field offsets below). -// VWT-macosx: define {{.*}} ptr @"$s26struct_with_resilient_type9SomeValueVwta"(ptr noalias returned {{.*}}, ptr noalias {{.*}}, ptr captures(none) readonly [[MT:%.*]]) +// VWT-macosx: define {{.*}} ptr @"$s26struct_with_resilient_type9SomeValueVwta"(ptr noalias returned {{.*}}, ptr noalias {{.*}}, ptr nocapture readonly [[MT:%.*]]) // VWT-macosx: [[VAL1:%.*]] = load i64 // VWT-macosx: store i64 [[VAL1]] // VWT-macosx: [[T1:%.*]] = tail call swiftcc %swift.metadata_response @"$s16resilient_struct13ResilientBoolVMa"(i64 0) diff --git a/test/IRGen/typed_throws.sil b/test/IRGen/typed_throws.sil index e92f0c125dff8..c2f42b8f5c36d 100644 --- a/test/IRGen/typed_throws.sil +++ b/test/IRGen/typed_throws.sil @@ -18,7 +18,7 @@ sil_vtable A {} sil @create_error : $@convention(thin) () -> @owned A -// CHECK: define{{.*}} swiftcc { ptr, ptr } @throw_error(ptr swiftself %0, ptr noalias captures(none) swifterror dereferenceable({{.*}}) %1) +// CHECK: define{{.*}} swiftcc { ptr, ptr } @throw_error(ptr swiftself %0, ptr noalias nocapture swifterror dereferenceable({{.*}}) %1) // CHECK: [[ERR:%.*]] = call swiftcc ptr @create_error() // CHECK: call ptr @swift_retain(ptr returned [[ERR]]) // CHECK: store ptr inttoptr (i64 1 to ptr), ptr %1 @@ -47,7 +47,7 @@ sil @try_apply_helper : $@convention(thin) (@owned AnyObject) -> (@owned AnyObje // CHECK: entry: // CHECK: %swifterror = alloca swifterror ptr // CHECK: store ptr null, ptr %swifterror -// CHECK: [[RES:%.*]] = call swiftcc { ptr, ptr } @try_apply_helper(ptr %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable({{.*}}) %swifterror) +// CHECK: [[RES:%.*]] = call swiftcc { ptr, ptr } @try_apply_helper(ptr %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable({{.*}}) %swifterror) // CHECK: [[RES_0:%.*]] = extractvalue { ptr, ptr } [[RES]], 0 // CHECK: [[RES_1:%.*]] = extractvalue { ptr, ptr } [[RES]], 1 // CHECK: [[ERRFLAG:%.*]] = load ptr, ptr %swifterror @@ -209,8 +209,8 @@ bb6: return %7 : $() } -// CHECK: define{{.*}} internal swiftcc { ptr, ptr } @"$s16try_apply_helperTA"(ptr swiftself %0, ptr noalias captures(none) swifterror dereferenceable({{.*}}) %1) -// CHECK: tail call swiftcc { ptr, ptr } @try_apply_helper(ptr {{.*}}, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable({{.*}}) %1) +// CHECK: define{{.*}} internal swiftcc { ptr, ptr } @"$s16try_apply_helperTA"(ptr swiftself %0, ptr noalias nocapture swifterror dereferenceable({{.*}}) %1) +// CHECK: tail call swiftcc { ptr, ptr } @try_apply_helper(ptr {{.*}}, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable({{.*}}) %1) // CHECK: ret { ptr, ptr } sil @partial_apply_test : $@convention(thin) (@owned AnyObject) -> @owned @callee_guaranteed () ->(@owned AnyObject, @error S) { @@ -234,7 +234,7 @@ entry(%0: $AnyObject): // CHECK:entry: // CHECK: %swifterror = alloca swifterror ptr // CHECK: store ptr null, ptr %swifterror -// CHECK: call swiftcc { ptr, ptr } %0(ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable({{[0-9]+}}) %swifterror) +// CHECK: call swiftcc { ptr, ptr } %0(ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable({{[0-9]+}}) %swifterror) sil @apply_closure : $@convention(thin) (@guaranteed @callee_guaranteed () -> (@owned AnyObject, @error S)) -> () { entry(%0 : $@callee_guaranteed () ->(@owned AnyObject, @error S)): @@ -272,7 +272,7 @@ bb6: return %t : $() } -// CHECK: define{{.*}} swiftcc void @throwNoError(i64 %0, ptr noalias %1, ptr %"\CF\84_0_0", ptr swiftself %2, ptr noalias captures(none) swifterror dereferenceable({{.*}}) %3, ptr %4) +// CHECK: define{{.*}} swiftcc void @throwNoError(i64 %0, ptr noalias %1, ptr %"\CF\84_0_0", ptr swiftself %2, ptr noalias nocapture swifterror dereferenceable({{.*}}) %3, ptr %4) // CHECK: ret void sil @throwNoError : $@convention(thin) <τ_0_0> (Builtin.Int64, @in τ_0_0) -> @error_indirect τ_0_0 { @@ -281,14 +281,14 @@ bb0(%0: $*τ_0_0, %1 : $Builtin.Int64, %2 : $*τ_0_0): return %5 : $() } -// CHECK: define{{.*}} swiftcc void @throwNoErrorGenericOut(ptr noalias sret(%swift.opaque) %0, i64 %1, ptr noalias %2, ptr %"\CF\84_0_0", ptr %"\CF\84_0_1", ptr swiftself %3, ptr noalias captures(none) swifterror dereferenceable({{.*}}) %4, ptr %5) +// CHECK: define{{.*}} swiftcc void @throwNoErrorGenericOut(ptr noalias sret(%swift.opaque) %0, i64 %1, ptr noalias %2, ptr %"\CF\84_0_0", ptr %"\CF\84_0_1", ptr swiftself %3, ptr noalias nocapture swifterror dereferenceable({{.*}}) %4, ptr %5) sil @throwNoErrorGenericOut : $@convention(thin) <τ_0_0, τ_0_1> (Builtin.Int64, @in τ_0_0) -> (@error_indirect τ_0_0, @out τ_0_1) { bb0(%0: $*τ_0_1, %1: $*τ_0_0, %2 : $Builtin.Int64, %3 : $*τ_0_0): %5 = tuple () return %5 : $() } -// CHECK: define{{.*}} swiftcc void @throwError(i64 %0, ptr noalias %1, ptr %"\CF\84_0_0", ptr swiftself %2, ptr noalias captures(none) swifterror dereferenceable({{.*}}) %3, ptr %4) +// CHECK: define{{.*}} swiftcc void @throwError(i64 %0, ptr noalias %1, ptr %"\CF\84_0_0", ptr swiftself %2, ptr noalias nocapture swifterror dereferenceable({{.*}}) %3, ptr %4) // CHECK: entry: // CHECK: load ptr, ptr // CHECK: [[VW:%.*]] = load ptr, ptr @@ -309,7 +309,7 @@ sil @throwError2 : $@convention(thin) (Builtin.Int64, @in T) -> (@error_i // CHECK: store ptr null, ptr %swifterror // CHECK: [[SIZE:%.*]] = load i64 // CHECK: [[TYPEDERR:%.*]] = alloca i8, i64 [[SIZE]] -// CHECK: call swiftcc void @throwError2(ptr noalias sret(%swift.opaque) %0, i64 0, ptr noalias %1, ptr %T, ptr %V, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror, ptr [[TYPEDERR]]) +// CHECK: call swiftcc void @throwError2(ptr noalias sret(%swift.opaque) %0, i64 0, ptr noalias %1, ptr %T, ptr %V, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror, ptr [[TYPEDERR]]) // CHECK: [[ERR_FLAG:%.*]] = load ptr, ptr %swifterror // CHECK: [[ISERR:%.*]] = icmp ne ptr [[ERR_FLAG]], null // CHECK: br i1 [[ISERR]] @@ -379,8 +379,8 @@ bb3: sil @try_apply_helper_generic : $@convention(thin) (@in T) -> (@out T, @error_indirect T) -// CHECK: define{{.*}} internal swiftcc void @"$s24try_apply_helper_genericTA"(ptr noalias sret(%swift.opaque) %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3) -// CHECK: call swiftcc void @try_apply_helper_generic(ptr noalias sret(%swift.opaque) %0, ptr noalias {{%.*}}, ptr %T, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3) +// CHECK: define{{.*}} internal swiftcc void @"$s24try_apply_helper_genericTA"(ptr noalias sret(%swift.opaque) %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3) +// CHECK: call swiftcc void @try_apply_helper_generic(ptr noalias sret(%swift.opaque) %0, ptr noalias {{%.*}}, ptr %T, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3) sil @partial_apply_test_generic : $@convention(thin) (@in T) -> @owned @callee_guaranteed () ->(@out T, @error_indirect T) { entry(%0: $*T): @@ -411,7 +411,7 @@ entry(%0: $*T): // CHECK: [[V2:%.*]] = getelementptr inbounds{{.*}} %swift.vwtable{{.*}} // CHECK: [[V3:%.*]] = load i64, ptr [[V2]] // CHECK: [[V4:%.*]] = alloca i8, i64 [[V3]] -// CHECK: call swiftcc void %0(ptr noalias sret(%swift.opaque) [[T4]], ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror, ptr [[V4]]) +// CHECK: call swiftcc void %0(ptr noalias sret(%swift.opaque) [[T4]], ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %swifterror, ptr [[V4]]) sil @apply_closure_generic : $@convention(thin) (@guaranteed @callee_guaranteed () ->(@out T, @error_indirect V)) -> () { entry(%0 : $@callee_guaranteed () ->(@out T, @error_indirect V)): %err = alloc_stack $V diff --git a/test/IRGen/typed_throws.swift b/test/IRGen/typed_throws.swift index dfa5b9fd403bc..69b1c317a126c 100644 --- a/test/IRGen/typed_throws.swift +++ b/test/IRGen/typed_throws.swift @@ -75,7 +75,7 @@ func reabstractAsConcreteThrowing() throws -> Int { try passthroughCall(fiveOrTypedBust) } -// CHECK-LABEL: define {{.*}} swiftcc void @"$sSi12typed_throws10MyBigErrorOIgdzo_SiACIegrzr_TR"(ptr noalias captures(none) sret(%TSi) %0, ptr %1, ptr %2, ptr swiftself %3, ptr noalias captures(none) swifterror dereferenceable(8) %4, ptr %5) +// CHECK-LABEL: define {{.*}} swiftcc void @"$sSi12typed_throws10MyBigErrorOIgdzo_SiACIegrzr_TR"(ptr noalias nocapture sret(%TSi) %0, ptr %1, ptr %2, ptr swiftself %3, ptr noalias nocapture swifterror dereferenceable(8) %4, ptr %5) // CHECK: call swiftcc {{i32|i64}} %1 // CHECK: [[CMP:%.*]] = icmp ne ptr {{%.*}}, null // CHECK: br i1 [[CMP]], label %typed.error.load @@ -107,7 +107,7 @@ func throwsSmallError() throws(SmallError) -> (Float, Int) { } // CHECK: define hidden swiftcc i64 @"$s12typed_throws17catchesSmallErrorSiyF"() -// CHECK: [[RES:%.*]] = call swiftcc { float, i64 } @"$s12typed_throws0B10SmallErrorSf_SityAA0cD0VYKF"(ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) +// CHECK: [[RES:%.*]] = call swiftcc { float, i64 } @"$s12typed_throws0B10SmallErrorSf_SityAA0cD0VYKF"(ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) // CHECK: [[R0:%.*]] = extractvalue { float, i64 } [[RES]], 0 // CHECK: [[R1:%.*]] = extractvalue { float, i64 } [[RES]], 1 // CHECK: phi i64 [ [[R1]], %typed.error.load ] @@ -316,7 +316,7 @@ func smallResultLargerError() throws(SmallError) -> Int8? { } // CHECK: [[COERCED:%.*]] = alloca { i16 }, align 2 -// CHECK: [[RES:%.*]] = call swiftcc i64 @"$s12typed_throws22smallResultLargerErrors4Int8VSgyAA05SmallF0VYKF"(ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) +// CHECK: [[RES:%.*]] = call swiftcc i64 @"$s12typed_throws22smallResultLargerErrors4Int8VSgyAA05SmallF0VYKF"(ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) // CHECK: [[TRUNC:%.*]] = trunc i64 [[RES]] to i16 // CHECK: [[COERCED_PTR:%.*]] = getelementptr inbounds{{.*}} { i16 }, ptr [[COERCED]], i32 0, i32 0 // CHECK: store i16 [[TRUNC]], ptr [[COERCED_PTR]], align 2 @@ -335,7 +335,7 @@ func smallErrorLargerResult() throws(UInt8OptSingletonError) -> Int { } // CHECK: [[COERCED:%.*]] = alloca { i16 }, align 2 -// CHECK: [[RES:%.*]] = call swiftcc i64 @"$s12typed_throws22smallErrorLargerResultSiyAA017UInt8OptSingletonD0OYKF"(ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) +// CHECK: [[RES:%.*]] = call swiftcc i64 @"$s12typed_throws22smallErrorLargerResultSiyAA017UInt8OptSingletonD0OYKF"(ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) // CHECK: [[TRUNC:%.*]] = trunc i64 [[RES]] to i16 // CHECK: [[COERCED_PTR:%.*]] = getelementptr inbounds{{.*}} { i16 }, ptr [[COERCED]], i32 0, i32 0 // CHECK: store i16 [[TRUNC]], ptr [[COERCED_PTR]], align 2 diff --git a/test/IRGen/typed_throws_abi.swift b/test/IRGen/typed_throws_abi.swift index 22ca2ae6c9465..58d6240263382 100644 --- a/test/IRGen/typed_throws_abi.swift +++ b/test/IRGen/typed_throws_abi.swift @@ -21,7 +21,7 @@ struct ThreeWords: Error { } struct Impl: P { - // CHECK: define hidden swiftcc void @"$s16typed_throws_abi4ImplV2f0yySbAA5EmptyVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc void @"$s16typed_throws_abi4ImplV2f0yySbAA5EmptyVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: // CHECK: ret void @@ -38,7 +38,7 @@ struct Impl: P { } } - // CHECK: define hidden swiftcc i64 @"$s16typed_throws_abi4ImplV2f1ySiSbAA5EmptyVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc i64 @"$s16typed_throws_abi4ImplV2f1ySiSbAA5EmptyVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: // CHECK: ret i64 1 @@ -56,7 +56,7 @@ struct Impl: P { return 1 } - // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2f2ySi_SitSbAA5EmptyVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2f2ySi_SitSbAA5EmptyVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: // CHECK: ret { i64, i64 } { i64 1, i64 2 } @@ -74,7 +74,7 @@ struct Impl: P { return (1, 2) } - // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2f3ySi_S2itSbAA5EmptyVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2f3ySi_S2itSbAA5EmptyVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: // CHECK: ret { i64, i64, i64 } { i64 1, i64 2, i64 3 } @@ -92,7 +92,7 @@ struct Impl: P { return (1, 2, 3) } - // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi4ImplV2f4ySi_S3itSbAA5EmptyVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi4ImplV2f4ySi_S3itSbAA5EmptyVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: // CHECK: ret { i64, i64, i64, i64 } { i64 1, i64 2, i64 3, i64 4 } @@ -110,7 +110,7 @@ struct Impl: P { return (1, 2, 3, 4) } - // CHECK: define hidden swiftcc void @"$s16typed_throws_abi4ImplV2f5ySi_S4itSbAA5EmptyVYKF"(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr swiftself %2, ptr noalias captures(none) swifterror dereferenceable(8) %3, ptr %4) + // CHECK: define hidden swiftcc void @"$s16typed_throws_abi4ImplV2f5ySi_S4itSbAA5EmptyVYKF"(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr swiftself %2, ptr noalias nocapture swifterror dereferenceable(8) %3, ptr %4) // CHECK: br i1 %1, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: // CHECK: store i64 1, ptr %.elt._value, align 8 @@ -133,7 +133,7 @@ struct Impl: P { return (1, 2, 3, 4, 5) } - // CHECK: define hidden swiftcc i64 @"$s16typed_throws_abi4ImplV2g0yySbAA7OneWordVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc i64 @"$s16typed_throws_abi4ImplV2g0yySbAA7OneWordVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi7OneWordV // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: @@ -151,7 +151,7 @@ struct Impl: P { } } - // CHECK: define hidden swiftcc i64 @"$s16typed_throws_abi4ImplV2g1ySiSbAA7OneWordVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc i64 @"$s16typed_throws_abi4ImplV2g1ySiSbAA7OneWordVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi7OneWordV // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: @@ -170,7 +170,7 @@ struct Impl: P { return 1 } - // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2g2ySi_SitSbAA7OneWordVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2g2ySi_SitSbAA7OneWordVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi7OneWordV // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: @@ -189,7 +189,7 @@ struct Impl: P { return (1, 2) } - // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2g3ySi_S2itSbAA7OneWordVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2g3ySi_S2itSbAA7OneWordVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi7OneWordV // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: @@ -208,7 +208,7 @@ struct Impl: P { return (1, 2, 3) } - // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi4ImplV2g4ySi_S3itSbAA7OneWordVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi4ImplV2g4ySi_S3itSbAA7OneWordVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi7OneWordV // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: @@ -227,7 +227,7 @@ struct Impl: P { return (1, 2, 3, 4) } - // CHECK: define hidden swiftcc void @"$s16typed_throws_abi4ImplV2g5ySi_S4itSbAA7OneWordVYKF"(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr swiftself %2, ptr noalias captures(none) swifterror dereferenceable(8) %3, ptr %4) + // CHECK: define hidden swiftcc void @"$s16typed_throws_abi4ImplV2g5ySi_S4itSbAA7OneWordVYKF"(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr swiftself %2, ptr noalias nocapture swifterror dereferenceable(8) %3, ptr %4) // CHECK: entry: // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi7OneWordV, align 8 // CHECK: br i1 %1, label %[[SUCCESS:.*]], label %[[FAIL:.*]] @@ -252,7 +252,7 @@ struct Impl: P { return (1, 2, 3, 4, 5) } - // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2h0yySbAA8TwoWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2h0yySbAA8TwoWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi8TwoWordsV // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: @@ -270,7 +270,7 @@ struct Impl: P { } } - // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2h1ySiSbAA8TwoWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2h1ySiSbAA8TwoWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi8TwoWordsV // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: @@ -289,7 +289,7 @@ struct Impl: P { return 1 } - // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2h2ySi_SitSbAA8TwoWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2h2ySi_SitSbAA8TwoWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi8TwoWordsV // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: @@ -308,7 +308,7 @@ struct Impl: P { return (1, 2) } - // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2h3ySi_S2itSbAA8TwoWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2h3ySi_S2itSbAA8TwoWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi8TwoWordsV // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: @@ -327,7 +327,7 @@ struct Impl: P { return (1, 2, 3) } - // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi4ImplV2h4ySi_S3itSbAA8TwoWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi4ImplV2h4ySi_S3itSbAA8TwoWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi8TwoWordsV // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: @@ -346,7 +346,7 @@ struct Impl: P { return (1, 2, 3, 4) } - // CHECK: define hidden swiftcc void @"$s16typed_throws_abi4ImplV2h5ySi_S4itSbAA8TwoWordsVYKF"(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr swiftself %2, ptr noalias captures(none) swifterror dereferenceable(8) %3, ptr %4) + // CHECK: define hidden swiftcc void @"$s16typed_throws_abi4ImplV2h5ySi_S4itSbAA8TwoWordsVYKF"(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr swiftself %2, ptr noalias nocapture swifterror dereferenceable(8) %3, ptr %4) // CHECK: entry: // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi8TwoWordsV, align 8 // CHECK: br i1 %1, label %[[SUCCESS:.*]], label %[[FAIL:.*]] @@ -371,7 +371,7 @@ struct Impl: P { return (1, 2, 3, 4, 5) } - // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i0yySbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i0yySbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi10ThreeWordsV // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: @@ -389,7 +389,7 @@ struct Impl: P { } } - // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i1ySiSbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i1ySiSbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi10ThreeWordsV // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: @@ -408,7 +408,7 @@ struct Impl: P { return 1 } - // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i2ySi_SitSbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i2ySi_SitSbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi10ThreeWordsV // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: @@ -427,7 +427,7 @@ struct Impl: P { return (1, 2) } - // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i3ySi_S2itSbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i3ySi_S2itSbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi10ThreeWordsV // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: @@ -446,7 +446,7 @@ struct Impl: P { return (1, 2, 3) } - // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i4ySi_S3itSbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i4ySi_S3itSbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi10ThreeWordsV // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: @@ -465,7 +465,7 @@ struct Impl: P { return (1, 2, 3, 4) } - // CHECK: define hidden swiftcc void @"$s16typed_throws_abi4ImplV2i5ySi_S4itSbAA10ThreeWordsVYKF"(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr swiftself %2, ptr noalias captures(none) swifterror dereferenceable(8) %3, ptr %4) + // CHECK: define hidden swiftcc void @"$s16typed_throws_abi4ImplV2i5ySi_S4itSbAA10ThreeWordsVYKF"(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr swiftself %2, ptr noalias nocapture swifterror dereferenceable(8) %3, ptr %4) // CHECK: entry: // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi10ThreeWordsV, align 8 // CHECK: br i1 %1, label %[[SUCCESS:.*]], label %[[FAIL:.*]] @@ -494,7 +494,7 @@ struct Impl: P { // CHECK: define hidden swiftcc i1 @"$s16typed_throws_abi11callImpl_f0ySbAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: call swiftcc void @"$s16typed_throws_abi4ImplV2f0yySbAA5EmptyVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) +// CHECK: call swiftcc void @"$s16typed_throws_abi4ImplV2f0yySbAA5EmptyVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) // CHECK: [[ERROR:%.*]] = load ptr, ptr %swifterror, align 8 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %typed.error.load, label %[[SUCCESS:.*]] @@ -521,7 +521,7 @@ func callImpl_f0(_ impl: Impl, _ b: Bool) -> Bool { // CHECK: define hidden swiftcc i64 @"$s16typed_throws_abi11callImpl_f1ySiAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc i64 @"$s16typed_throws_abi4ImplV2f1ySiSbAA5EmptyVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc i64 @"$s16typed_throws_abi4ImplV2f1ySiSbAA5EmptyVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) // CHECK: [[ERROR:%.*]] = load ptr, ptr %swifterror, align 8 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %typed.error.load, label %[[SUCCESS:.*]] @@ -548,7 +548,7 @@ func callImpl_f1(_ impl: Impl, _ b: Bool) -> Int { // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi11callImpl_f2ySi_SitAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2f2ySi_SitSbAA5EmptyVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2f2ySi_SitSbAA5EmptyVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) // CHECK: [[CALL_RES0:%.*]] = extractvalue { i64, i64 } [[CALL_RES]], 0 // CHECK: [[CALL_RES1:%.*]] = extractvalue { i64, i64 } [[CALL_RES]], 1 // CHECK: [[ERROR:%.*]] = load ptr, ptr %swifterror, align 8 @@ -581,7 +581,7 @@ func callImpl_f2(_ impl: Impl, _ b: Bool) -> (Int, Int) { // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi11callImpl_f3ySi_S2itAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2f3ySi_S2itSbAA5EmptyVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2f3ySi_S2itSbAA5EmptyVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) // CHECK: [[CALL_RES0:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 0 // CHECK: [[CALL_RES1:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 1 // CHECK: [[CALL_RES2:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 2 @@ -618,7 +618,7 @@ func callImpl_f3(_ impl: Impl, _ b: Bool) -> (Int, Int, Int) { // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi11callImpl_f4ySi_S3itAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi4ImplV2f4ySi_S3itSbAA5EmptyVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi4ImplV2f4ySi_S3itSbAA5EmptyVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) // CHECK: [[CALL_RES0:%.*]] = extractvalue { i64, i64, i64, i64 } [[CALL_RES]], 0 // CHECK: [[CALL_RES1:%.*]] = extractvalue { i64, i64, i64, i64 } [[CALL_RES]], 1 // CHECK: [[CALL_RES2:%.*]] = extractvalue { i64, i64, i64, i64 } [[CALL_RES]], 2 @@ -656,12 +656,12 @@ func callImpl_f4(_ impl: Impl, _ b: Bool) -> (Int, Int, Int, Int) { } } -// CHECK: define hidden swiftcc void @"$s16typed_throws_abi11callImpl_f5ySi_S4itAA0E0V_SbtF"(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1) +// CHECK: define hidden swiftcc void @"$s16typed_throws_abi11callImpl_f5ySi_S4itAA0E0V_SbtF"(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 // CHECK: %swifterror1 = alloca ptr, align 8 // CHECK: %call.aggresult = alloca <{ %TSi, %TSi, %TSi, %TSi, %TSi }>, align 8 -// CHECK: call swiftcc void @"$s16typed_throws_abi4ImplV2f5ySi_S4itSbAA5EmptyVYKF"(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %call.aggresult, i1 %1, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror, ptr %swifterror1) +// CHECK: call swiftcc void @"$s16typed_throws_abi4ImplV2f5ySi_S4itSbAA5EmptyVYKF"(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %call.aggresult, i1 %1, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror, ptr %swifterror1) // CHECK: [[CALL_RES0:%.*]] = load i64, ptr {{%call.aggresult.*}}, align 8 // CHECK: [[CALL_RES1:%.*]] = load i64, ptr {{%call.aggresult.*}}, align 8 // CHECK: [[CALL_RES2:%.*]] = load i64, ptr {{%call.aggresult.*}}, align 8 @@ -706,7 +706,7 @@ func callImpl_f5(_ impl: Impl, _ b: Bool) -> (Int, Int, Int, Int, Int) { // CHECK: define hidden swiftcc i64 @"$s16typed_throws_abi11callImpl_g0ySiAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc i64 @"$s16typed_throws_abi4ImplV2g0yySbAA7OneWordVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc i64 @"$s16typed_throws_abi4ImplV2g0yySbAA7OneWordVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) // CHECK: [[ERROR:%.*]] = load ptr, ptr %swifterror, align 8 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %typed.error.load, label %[[SUCCESS:.*]] @@ -734,7 +734,7 @@ func callImpl_g0(_ impl: Impl, _ b: Bool) -> Int { // CHECK: define hidden swiftcc i64 @"$s16typed_throws_abi11callImpl_g1ySiAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc i64 @"$s16typed_throws_abi4ImplV2g1ySiSbAA7OneWordVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc i64 @"$s16typed_throws_abi4ImplV2g1ySiSbAA7OneWordVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) // CHECK: [[ERROR:%.*]] = load ptr, ptr %swifterror, align 8 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %typed.error.load, label %[[SUCCESS:.*]] @@ -762,7 +762,7 @@ func callImpl_g1(_ impl: Impl, _ b: Bool) -> Int { // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi11callImpl_g2ySi_SitAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2g2ySi_SitSbAA7OneWordVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2g2ySi_SitSbAA7OneWordVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) // CHECK: [[CALL_RES0:%.*]] = extractvalue { i64, i64 } [[CALL_RES]], 0 // CHECK: [[CALL_RES1:%.*]] = extractvalue { i64, i64 } [[CALL_RES]], 1 // CHECK: [[ERROR:%.*]] = load ptr, ptr %swifterror, align 8 @@ -796,7 +796,7 @@ func callImpl_g2(_ impl: Impl, _ b: Bool) -> (Int, Int) { // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi11callImpl_g3ySi_S2itAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2g3ySi_S2itSbAA7OneWordVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2g3ySi_S2itSbAA7OneWordVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) // CHECK: [[CALL_RES0:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 0 // CHECK: [[CALL_RES1:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 1 // CHECK: [[CALL_RES2:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 2 @@ -834,7 +834,7 @@ func callImpl_g3(_ impl: Impl, _ b: Bool) -> (Int, Int, Int) { // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi11callImpl_g4ySi_S3itAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi4ImplV2g4ySi_S3itSbAA7OneWordVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi4ImplV2g4ySi_S3itSbAA7OneWordVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) // CHECK: [[CALL_RES0:%.*]] = extractvalue { i64, i64, i64, i64 } [[CALL_RES]], 0 // CHECK: [[CALL_RES1:%.*]] = extractvalue { i64, i64, i64, i64 } [[CALL_RES]], 1 // CHECK: [[CALL_RES2:%.*]] = extractvalue { i64, i64, i64, i64 } [[CALL_RES]], 2 @@ -873,12 +873,12 @@ func callImpl_g4(_ impl: Impl, _ b: Bool) -> (Int, Int, Int, Int) { } } -// CHECK: define hidden swiftcc void @"$s16typed_throws_abi11callImpl_g5ySi_S4itAA0E0V_SbtF"(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1) +// CHECK: define hidden swiftcc void @"$s16typed_throws_abi11callImpl_g5ySi_S4itAA0E0V_SbtF"(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 // CHECK: %swifterror1 = alloca %T16typed_throws_abi7OneWordV, align 8 // CHECK: %call.aggresult = alloca <{ %TSi, %TSi, %TSi, %TSi, %TSi }>, align 8 -// CHECK: call swiftcc void @"$s16typed_throws_abi4ImplV2g5ySi_S4itSbAA7OneWordVYKF"(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %call.aggresult, i1 %1, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror, ptr %swifterror1) +// CHECK: call swiftcc void @"$s16typed_throws_abi4ImplV2g5ySi_S4itSbAA7OneWordVYKF"(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %call.aggresult, i1 %1, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror, ptr %swifterror1) // CHECK: [[CALL_RES0:%.*]] = load i64, ptr {{%call.aggresult.*}}, align 8 // CHECK: [[CALL_RES1:%.*]] = load i64, ptr {{%call.aggresult.*}}, align 8 // CHECK: [[CALL_RES2:%.*]] = load i64, ptr {{%call.aggresult.*}}, align 8 @@ -927,7 +927,7 @@ func callImpl_g5(_ impl: Impl, _ b: Bool) -> (Int, Int, Int, Int, Int) { // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi11callImpl_h0ySi_SitAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2h0yySbAA8TwoWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2h0yySbAA8TwoWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) // CHECK: [[CALL_RES0:%.*]] = extractvalue { i64, i64 } [[CALL_RES]], 0 // CHECK: [[CALL_RES1:%.*]] = extractvalue { i64, i64 } [[CALL_RES]], 1 // CHECK: [[ERROR:%.*]] = load ptr, ptr %swifterror, align 8 @@ -961,7 +961,7 @@ func callImpl_h0(_ impl: Impl, _ b: Bool) -> (Int, Int) { // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi11callImpl_h1ySi_SitAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2h1ySiSbAA8TwoWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2h1ySiSbAA8TwoWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) // CHECK: [[CALL_RES0:%.*]] = extractvalue { i64, i64 } [[CALL_RES]], 0 // CHECK: [[CALL_RES1:%.*]] = extractvalue { i64, i64 } [[CALL_RES]], 1 // CHECK: [[ERROR:%.*]] = load ptr, ptr %swifterror, align 8 @@ -995,7 +995,7 @@ func callImpl_h1(_ impl: Impl, _ b: Bool) -> (Int, Int) { // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi11callImpl_h2ySi_SitAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2h2ySi_SitSbAA8TwoWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2h2ySi_SitSbAA8TwoWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) // CHECK: [[CALL_RES0:%.*]] = extractvalue { i64, i64 } [[CALL_RES]], 0 // CHECK: [[CALL_RES1:%.*]] = extractvalue { i64, i64 } [[CALL_RES]], 1 // CHECK: [[ERROR:%.*]] = load ptr, ptr %swifterror, align 8 @@ -1030,7 +1030,7 @@ func callImpl_h2(_ impl: Impl, _ b: Bool) -> (Int, Int) { // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi11callImpl_h3ySi_S2itAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2h3ySi_S2itSbAA8TwoWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2h3ySi_S2itSbAA8TwoWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) // CHECK: [[CALL_RES0:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 0 // CHECK: [[CALL_RES1:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 1 // CHECK: [[CALL_RES2:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 2 @@ -1069,7 +1069,7 @@ func callImpl_h3(_ impl: Impl, _ b: Bool) -> (Int, Int, Int) { // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi11callImpl_h4ySi_S3itAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi4ImplV2h4ySi_S3itSbAA8TwoWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi4ImplV2h4ySi_S3itSbAA8TwoWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) // CHECK: [[CALL_RES0:%.*]] = extractvalue { i64, i64, i64, i64 } [[CALL_RES]], 0 // CHECK: [[CALL_RES1:%.*]] = extractvalue { i64, i64, i64, i64 } [[CALL_RES]], 1 // CHECK: [[CALL_RES2:%.*]] = extractvalue { i64, i64, i64, i64 } [[CALL_RES]], 2 @@ -1109,12 +1109,12 @@ func callImpl_h4(_ impl: Impl, _ b: Bool) -> (Int, Int, Int, Int) { } } -// CHECK: define hidden swiftcc void @"$s16typed_throws_abi11callImpl_h5ySi_S4itAA0E0V_SbtF"(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1) +// CHECK: define hidden swiftcc void @"$s16typed_throws_abi11callImpl_h5ySi_S4itAA0E0V_SbtF"(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 // CHECK: %swifterror1 = alloca %T16typed_throws_abi8TwoWordsV, align 8 // CHECK: %call.aggresult = alloca <{ %TSi, %TSi, %TSi, %TSi, %TSi }>, align 8 -// CHECK: call swiftcc void @"$s16typed_throws_abi4ImplV2h5ySi_S4itSbAA8TwoWordsVYKF"(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %call.aggresult, i1 %1, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror, ptr %swifterror1) +// CHECK: call swiftcc void @"$s16typed_throws_abi4ImplV2h5ySi_S4itSbAA8TwoWordsVYKF"(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %call.aggresult, i1 %1, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror, ptr %swifterror1) // CHECK: [[CALL_RES0:%.*]] = load i64, ptr {{%call.aggresult.*}}, align 8 // CHECK: [[CALL_RES1:%.*]] = load i64, ptr {{%call.aggresult.*}}, align 8 // CHECK: [[CALL_RES2:%.*]] = load i64, ptr {{%call.aggresult.*}}, align 8 @@ -1165,7 +1165,7 @@ func callImpl_h5(_ impl: Impl, _ b: Bool) -> (Int, Int, Int, Int, Int) { // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi11callImpl_i0ySi_S2itAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i0yySbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i0yySbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) // CHECK: [[CALL_RES0:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 0 // CHECK: [[CALL_RES1:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 1 // CHECK: [[CALL_RES2:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 2 @@ -1203,7 +1203,7 @@ func callImpl_i0(_ impl: Impl, _ b: Bool) -> (Int, Int, Int) { // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi11callImpl_i1ySi_S2itAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i1ySiSbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i1ySiSbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) // CHECK: [[CALL_RES0:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 0 // CHECK: [[CALL_RES1:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 1 // CHECK: [[CALL_RES2:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 2 @@ -1241,7 +1241,7 @@ func callImpl_i1(_ impl: Impl, _ b: Bool) -> (Int, Int, Int) { // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi11callImpl_i2ySi_S2itAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i2ySi_SitSbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i2ySi_SitSbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) // CHECK: [[CALL_RES0:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 0 // CHECK: [[CALL_RES1:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 1 // CHECK: [[CALL_RES2:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 2 @@ -1281,7 +1281,7 @@ func callImpl_i2(_ impl: Impl, _ b: Bool) -> (Int, Int, Int) { // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi11callImpl_i3ySi_S2itAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i3ySi_S2itSbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i3ySi_S2itSbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) // CHECK: [[CALL_RES0:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 0 // CHECK: [[CALL_RES1:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 1 // CHECK: [[CALL_RES2:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 2 @@ -1321,7 +1321,7 @@ func callImpl_i3(_ impl: Impl, _ b: Bool) -> (Int, Int, Int) { // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi11callImpl_i4ySi_S3itAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i4ySi_S3itSbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i4ySi_S3itSbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) // CHECK: [[CALL_RES0:%.*]] = extractvalue { i64, i64, i64, i64 } [[CALL_RES]], 0 // CHECK: [[CALL_RES1:%.*]] = extractvalue { i64, i64, i64, i64 } [[CALL_RES]], 1 // CHECK: [[CALL_RES2:%.*]] = extractvalue { i64, i64, i64, i64 } [[CALL_RES]], 2 @@ -1362,12 +1362,12 @@ func callImpl_i4(_ impl: Impl, _ b: Bool) -> (Int, Int, Int, Int) { } } -// CHECK: define hidden swiftcc void @"$s16typed_throws_abi11callImpl_i5ySi_S4itAA0E0V_SbtF"(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1) +// CHECK: define hidden swiftcc void @"$s16typed_throws_abi11callImpl_i5ySi_S4itAA0E0V_SbtF"(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 // CHECK: %swifterror1 = alloca %T16typed_throws_abi10ThreeWordsV, align 8 // CHECK: %call.aggresult = alloca <{ %TSi, %TSi, %TSi, %TSi, %TSi }>, align 8 -// CHECK: call swiftcc void @"$s16typed_throws_abi4ImplV2i5ySi_S4itSbAA10ThreeWordsVYKF"(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %call.aggresult, i1 %1, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror, ptr %swifterror1) +// CHECK: call swiftcc void @"$s16typed_throws_abi4ImplV2i5ySi_S4itSbAA10ThreeWordsVYKF"(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %call.aggresult, i1 %1, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror, ptr %swifterror1) // CHECK: [[CALL_RES0:%.*]] = load i64, ptr {{%call.aggresult.*}}, align 8 // CHECK: [[CALL_RES1:%.*]] = load i64, ptr {{%call.aggresult.*}}, align 8 // CHECK: [[CALL_RES2:%.*]] = load i64, ptr {{%call.aggresult.*}}, align 8 @@ -1519,7 +1519,7 @@ struct ImplAsync: PAsync { return (1, 2, 3, 4) } - // CHECK: define hidden swifttailcc void @"$s16typed_throws_abi9ImplAsyncV2f5ySi_S4itSbYaAA5EmptyVYKF"(ptr noalias captures(none) %0, ptr swiftasync %1, i1 %2, ptr %3) + // CHECK: define hidden swifttailcc void @"$s16typed_throws_abi9ImplAsyncV2f5ySi_S4itSbYaAA5EmptyVYKF"(ptr noalias nocapture %0, ptr swiftasync %1, i1 %2, ptr %3) // CHECK: [[CORO:%.*]] = call ptr @llvm.coro.begin(token {{%.*}}, ptr null) // CHECK: br i1 %2, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: @@ -1648,7 +1648,7 @@ struct ImplAsync: PAsync { return (1, 2, 3, 4) } - // CHECK: define hidden swifttailcc void @"$s16typed_throws_abi9ImplAsyncV2g5ySi_S4itSbYaAA7OneWordVYKF"(ptr noalias captures(none) %0, ptr swiftasync %1, i1 %2, ptr %3) + // CHECK: define hidden swifttailcc void @"$s16typed_throws_abi9ImplAsyncV2g5ySi_S4itSbYaAA7OneWordVYKF"(ptr noalias nocapture %0, ptr swiftasync %1, i1 %2, ptr %3) // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi7OneWordV, align 8 // CHECK: [[CORO:%.*]] = call ptr @llvm.coro.begin(token {{%.*}}, ptr null) // CHECK: br i1 %2, label %[[SUCCESS:.*]], label %[[FAIL:.*]] @@ -1778,7 +1778,7 @@ struct ImplAsync: PAsync { return (1, 2, 3, 4) } - // CHECK: define hidden swifttailcc void @"$s16typed_throws_abi9ImplAsyncV2h5ySi_S4itSbYaAA8TwoWordsVYKF"(ptr noalias captures(none) %0, ptr swiftasync %1, i1 %2, ptr %3) + // CHECK: define hidden swifttailcc void @"$s16typed_throws_abi9ImplAsyncV2h5ySi_S4itSbYaAA8TwoWordsVYKF"(ptr noalias nocapture %0, ptr swiftasync %1, i1 %2, ptr %3) // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi8TwoWordsV, align 8 // CHECK: [[CORO:%.*]] = call ptr @llvm.coro.begin(token {{%.*}}, ptr null) // CHECK: br i1 %2, label %[[SUCCESS:.*]], label %[[FAIL:.*]] @@ -1908,7 +1908,7 @@ struct ImplAsync: PAsync { return (1, 2, 3, 4) } - // CHECK: define hidden swifttailcc void @"$s16typed_throws_abi9ImplAsyncV2i5ySi_S4itSbYaAA10ThreeWordsVYKF"(ptr noalias captures(none) %0, ptr swiftasync %1, i1 %2, ptr %3) + // CHECK: define hidden swifttailcc void @"$s16typed_throws_abi9ImplAsyncV2i5ySi_S4itSbYaAA10ThreeWordsVYKF"(ptr noalias nocapture %0, ptr swiftasync %1, i1 %2, ptr %3) // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi10ThreeWordsV, align 8 // CHECK: [[CORO:%.*]] = call ptr @llvm.coro.begin(token {{%.*}}, ptr null) // CHECK: br i1 %2, label %[[SUCCESS:.*]], label %[[FAIL:.*]] @@ -2127,7 +2127,7 @@ func callImplAsync_f4(_ impl: ImplAsync, _ b: Bool) async -> (Int, Int, Int, Int } } -// CHECK: define hidden swifttailcc void @"$s16typed_throws_abi16callImplAsync_f5ySi_S4itAA0eF0V_SbtYaF"(ptr noalias captures(none) %0, ptr swiftasync %1, i1 %2) +// CHECK: define hidden swifttailcc void @"$s16typed_throws_abi16callImplAsync_f5ySi_S4itAA0eF0V_SbtYaF"(ptr noalias nocapture %0, ptr swiftasync %1, i1 %2) // CHECK: %swifterror = alloca ptr, align 8 // CHECK: %call.aggresult = alloca <{ %TSi, %TSi, %TSi, %TSi, %TSi }>, align 8 // CHECK: %swifterror1 = alloca swifterror ptr, align 8 @@ -2381,7 +2381,7 @@ func callImplAsync_g4(_ impl: ImplAsync, _ b: Bool) async -> (Int, Int, Int, Int } -// CHECK: define hidden swifttailcc void @"$s16typed_throws_abi16callImplAsync_g5ySi_S4itAA0eF0V_SbtYaF"(ptr noalias captures(none) %0, ptr swiftasync %1, i1 %2) +// CHECK: define hidden swifttailcc void @"$s16typed_throws_abi16callImplAsync_g5ySi_S4itAA0eF0V_SbtYaF"(ptr noalias nocapture %0, ptr swiftasync %1, i1 %2) // CHECK: %swifterror = alloca %T16typed_throws_abi7OneWordV, align 8 // CHECK: %call.aggresult = alloca <{ %TSi, %TSi, %TSi, %TSi, %TSi }>, align 8 // CHECK: %swifterror1 = alloca swifterror ptr, align 8 @@ -2647,7 +2647,7 @@ func callImplAsync_h4(_ impl: ImplAsync, _ b: Bool) async -> (Int, Int, Int, Int } -// CHECK: define hidden swifttailcc void @"$s16typed_throws_abi16callImplAsync_h5ySi_S4itAA0eF0V_SbtYaF"(ptr noalias captures(none) %0, ptr swiftasync %1, i1 %2) +// CHECK: define hidden swifttailcc void @"$s16typed_throws_abi16callImplAsync_h5ySi_S4itAA0eF0V_SbtYaF"(ptr noalias nocapture %0, ptr swiftasync %1, i1 %2) // CHECK: %swifterror = alloca %T16typed_throws_abi8TwoWordsV, align 8 // CHECK: %call.aggresult = alloca <{ %TSi, %TSi, %TSi, %TSi, %TSi }>, align 8 // CHECK: %swifterror1 = alloca swifterror ptr, align 8 @@ -2927,7 +2927,7 @@ func callImplAsync_i4(_ impl: ImplAsync, _ b: Bool) async -> (Int, Int, Int, Int } -// CHECK: define hidden swifttailcc void @"$s16typed_throws_abi16callImplAsync_i5ySi_S4itAA0eF0V_SbtYaF"(ptr noalias captures(none) %0, ptr swiftasync %1, i1 %2) +// CHECK: define hidden swifttailcc void @"$s16typed_throws_abi16callImplAsync_i5ySi_S4itAA0eF0V_SbtYaF"(ptr noalias nocapture %0, ptr swiftasync %1, i1 %2) // CHECK: %swifterror = alloca %T16typed_throws_abi10ThreeWordsV, align 8 // CHECK: %call.aggresult = alloca <{ %TSi, %TSi, %TSi, %TSi, %TSi }>, align 8 // CHECK: %swifterror1 = alloca swifterror ptr, align 8 @@ -2989,7 +2989,7 @@ func callImplAsync_i5(_ impl: ImplAsync, _ b: Bool) async -> (Int, Int, Int, Int } } -// CHECK: define hidden swiftcc { float, float, i64 } @"$s16typed_throws_abi14nonMatching_f0ySf_SftSbAA7OneWordVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) +// CHECK: define hidden swiftcc { float, float, i64 } @"$s16typed_throws_abi14nonMatching_f0ySf_SftSbAA7OneWordVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: // CHECK: ret { float, float, i64 } { float 1.000000e+00, float 2.000000e+00, i64 undef } @@ -3009,7 +3009,7 @@ func nonMatching_f0(_ b: Bool) throws(OneWord) -> (Float, Float) { // CHECK: define hidden swiftcc { i64, float, float } @"$s16typed_throws_abi18callNonMatching_f0ySi_S2ftSbF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc { float, float, i64 } @"$s16typed_throws_abi14nonMatching_f0ySf_SftSbAA7OneWordVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc { float, float, i64 } @"$s16typed_throws_abi14nonMatching_f0ySf_SftSbAA7OneWordVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) // CHECK: [[CALL_RES0:%.*]] = extractvalue { float, float, i64 } [[CALL_RES]], 0 // CHECK: [[CALL_RES1:%.*]] = extractvalue { float, float, i64 } [[CALL_RES]], 1 // CHECK: [[CALL_RES2:%.*]] = extractvalue { float, float, i64 } [[CALL_RES]], 2 @@ -3044,7 +3044,7 @@ func callNonMatching_f0(_ b: Bool) -> (Int, Float, Float) { } } -// define hidden swiftcc { float, i64, float } @"$s16typed_throws_abi14nonMatching_f1ySf_SbSftSbAA7OneWordVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) +// define hidden swiftcc { float, i64, float } @"$s16typed_throws_abi14nonMatching_f1ySf_SbSftSbAA7OneWordVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: // CHECK: ret { float, i64, float } { float 1.000000e+00, i64 1, float 2.000000e+00 } @@ -3063,7 +3063,7 @@ func nonMatching_f1(_ b: Bool) throws(OneWord) -> (Float, Bool, Float) { // CHECK: define hidden swiftcc { i64, float, i1, float } @"$s16typed_throws_abi18callNonMatching_f1ySi_SfSbSftSbF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc { float, i64, float } @"$s16typed_throws_abi14nonMatching_f1ySf_SbSftSbAA7OneWordVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc { float, i64, float } @"$s16typed_throws_abi14nonMatching_f1ySf_SbSftSbAA7OneWordVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) // CHECK: [[CALL_RES0:%.*]] = extractvalue { float, i64, float } [[CALL_RES]], 0 // CHECK: [[CALL_RES1:%.*]] = extractvalue { float, i64, float } [[CALL_RES]], 1 // CHECK: [[CALL_RES2:%.*]] = extractvalue { float, i64, float } [[CALL_RES]], 2 @@ -3225,7 +3225,7 @@ func callNonMatching_f1_async(_ b: Bool) async -> (Int, Float, Bool, Float) { } protocol P { - // CHECK: define hidden swiftcc void @"$s16typed_throws_abi1PP2f0yySbAA5EmptyVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc void @"$s16typed_throws_abi1PP2f0yySbAA5EmptyVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3236,7 +3236,7 @@ protocol P { // CHECK: } func f0(_ b: Bool) throws(Empty) - // CHECK: define hidden swiftcc i64 @"$s16typed_throws_abi1PP2f1ySiSbAA5EmptyVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc i64 @"$s16typed_throws_abi1PP2f1ySiSbAA5EmptyVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3247,7 +3247,7 @@ protocol P { // CHECK: } func f1(_ b: Bool) throws(Empty) -> Int - // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi1PP2f2ySi_SitSbAA5EmptyVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi1PP2f2ySi_SitSbAA5EmptyVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3258,7 +3258,7 @@ protocol P { // CHECK: } func f2(_ b: Bool) throws(Empty) -> (Int, Int) - // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi1PP2f3ySi_S2itSbAA5EmptyVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi1PP2f3ySi_S2itSbAA5EmptyVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3269,7 +3269,7 @@ protocol P { // CHECK: } func f3(_ b: Bool) throws(Empty) -> (Int, Int, Int) - // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi1PP2f4ySi_S3itSbAA5EmptyVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi1PP2f4ySi_S3itSbAA5EmptyVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3280,13 +3280,13 @@ protocol P { // CHECK: } func f4(_ b: Bool) throws(Empty) -> (Int, Int, Int, Int) - // CHECK: define hidden swiftcc void @"$s16typed_throws_abi1PP2f5ySi_S4itSbAA5EmptyVYKFTj"(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr noalias swiftself %2, ptr noalias captures(none) swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) - // CHECK: call swiftcc void {{%.*}}(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr noalias swiftself %2, ptr noalias captures(none) swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) + // CHECK: define hidden swiftcc void @"$s16typed_throws_abi1PP2f5ySi_S4itSbAA5EmptyVYKFTj"(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr noalias swiftself %2, ptr noalias nocapture swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) + // CHECK: call swiftcc void {{%.*}}(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr noalias swiftself %2, ptr noalias nocapture swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) // CHECK: ret void // CHECK: } func f5(_ b: Bool) throws(Empty) -> (Int, Int, Int, Int, Int) - // CHECK: define hidden swiftcc i64 @"$s16typed_throws_abi1PP2g0yySbAA7OneWordVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc i64 @"$s16typed_throws_abi1PP2g0yySbAA7OneWordVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3297,7 +3297,7 @@ protocol P { // CHECK: } func g0(_ b: Bool) throws(OneWord) - // CHECK: define hidden swiftcc i64 @"$s16typed_throws_abi1PP2g1ySiSbAA7OneWordVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc i64 @"$s16typed_throws_abi1PP2g1ySiSbAA7OneWordVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3308,7 +3308,7 @@ protocol P { // CHECK: } func g1(_ b: Bool) throws(OneWord) -> Int - // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi1PP2g2ySi_SitSbAA7OneWordVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi1PP2g2ySi_SitSbAA7OneWordVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3319,7 +3319,7 @@ protocol P { // CHECK: } func g2(_ b: Bool) throws(OneWord) -> (Int, Int) - // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi1PP2g3ySi_S2itSbAA7OneWordVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi1PP2g3ySi_S2itSbAA7OneWordVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3330,7 +3330,7 @@ protocol P { // CHECK: } func g3(_ b: Bool) throws(OneWord) -> (Int, Int, Int) - // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi1PP2g4ySi_S3itSbAA7OneWordVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi1PP2g4ySi_S3itSbAA7OneWordVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3341,13 +3341,13 @@ protocol P { // CHECK: } func g4(_ b: Bool) throws(OneWord) -> (Int, Int, Int, Int) - // CHECK: define hidden swiftcc void @"$s16typed_throws_abi1PP2g5ySi_S4itSbAA7OneWordVYKFTj"(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr noalias swiftself %2, ptr noalias captures(none) swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) - // CHECK: call swiftcc void {{%.*}}(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr noalias swiftself %2, ptr noalias captures(none) swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) + // CHECK: define hidden swiftcc void @"$s16typed_throws_abi1PP2g5ySi_S4itSbAA7OneWordVYKFTj"(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr noalias swiftself %2, ptr noalias nocapture swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) + // CHECK: call swiftcc void {{%.*}}(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr noalias swiftself %2, ptr noalias nocapture swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) // CHECK: ret void // CHECK: } func g5(_ b: Bool) throws(OneWord) -> (Int, Int, Int, Int, Int) - // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi1PP2h0yySbAA8TwoWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi1PP2h0yySbAA8TwoWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3358,7 +3358,7 @@ protocol P { // CHECK: } func h0(_ b: Bool) throws(TwoWords) - // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi1PP2h1ySiSbAA8TwoWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi1PP2h1ySiSbAA8TwoWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3369,7 +3369,7 @@ protocol P { // CHECK: } func h1(_ b: Bool) throws(TwoWords) -> Int - // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi1PP2h2ySi_SitSbAA8TwoWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi1PP2h2ySi_SitSbAA8TwoWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3380,7 +3380,7 @@ protocol P { // CHECK: } func h2(_ b: Bool) throws(TwoWords) -> (Int, Int) - // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi1PP2h3ySi_S2itSbAA8TwoWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi1PP2h3ySi_S2itSbAA8TwoWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3391,7 +3391,7 @@ protocol P { // CHECK: } func h3(_ b: Bool) throws(TwoWords) -> (Int, Int, Int) - // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi1PP2h4ySi_S3itSbAA8TwoWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi1PP2h4ySi_S3itSbAA8TwoWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3402,13 +3402,13 @@ protocol P { // CHECK: } func h4(_ b: Bool) throws(TwoWords) -> (Int, Int, Int, Int) - // CHECK: define hidden swiftcc void @"$s16typed_throws_abi1PP2h5ySi_S4itSbAA8TwoWordsVYKFTj"(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr noalias swiftself %2, ptr noalias captures(none) swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) - // CHECK: call swiftcc void {{%.*}}(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr noalias swiftself %2, ptr noalias captures(none) swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) + // CHECK: define hidden swiftcc void @"$s16typed_throws_abi1PP2h5ySi_S4itSbAA8TwoWordsVYKFTj"(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr noalias swiftself %2, ptr noalias nocapture swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) + // CHECK: call swiftcc void {{%.*}}(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr noalias swiftself %2, ptr noalias nocapture swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) // CHECK: ret void // CHECK: } func h5(_ b: Bool) throws(TwoWords) -> (Int, Int, Int, Int, Int) - // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi1PP2i0yySbAA10ThreeWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi1PP2i0yySbAA10ThreeWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3419,7 +3419,7 @@ protocol P { // CHECK: } func i0(_ b: Bool) throws(ThreeWords) - // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi1PP2i1ySiSbAA10ThreeWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi1PP2i1ySiSbAA10ThreeWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3430,7 +3430,7 @@ protocol P { // CHECK: } func i1(_ b: Bool) throws(ThreeWords) -> Int - // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi1PP2i2ySi_SitSbAA10ThreeWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi1PP2i2ySi_SitSbAA10ThreeWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3441,7 +3441,7 @@ protocol P { // CHECK: } func i2(_ b: Bool) throws(ThreeWords) -> (Int, Int) - // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi1PP2i3ySi_S2itSbAA10ThreeWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi1PP2i3ySi_S2itSbAA10ThreeWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3452,7 +3452,7 @@ protocol P { // CHECK: } func i3(_ b: Bool) throws(ThreeWords) -> (Int, Int, Int) - // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi1PP2i4ySi_S3itSbAA10ThreeWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi1PP2i4ySi_S3itSbAA10ThreeWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3463,8 +3463,8 @@ protocol P { // CHECK: } func i4(_ b: Bool) throws(ThreeWords) -> (Int, Int, Int, Int) - // CHECK: define hidden swiftcc void @"$s16typed_throws_abi1PP2i5ySi_S4itSbAA10ThreeWordsVYKFTj"(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr noalias swiftself %2, ptr noalias captures(none) swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) - // CHECK: call swiftcc void {{%.*}}(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr noalias swiftself %2, ptr noalias captures(none) swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) + // CHECK: define hidden swiftcc void @"$s16typed_throws_abi1PP2i5ySi_S4itSbAA10ThreeWordsVYKFTj"(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr noalias swiftself %2, ptr noalias nocapture swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) + // CHECK: call swiftcc void {{%.*}}(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr noalias swiftself %2, ptr noalias nocapture swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) // CHECK: ret void // CHECK: } func i5(_ b: Bool) throws(ThreeWords) -> (Int, Int, Int, Int, Int) @@ -3542,7 +3542,7 @@ protocol PAsync { // CHECK: } func f4(_ b: Bool) async throws(Empty) -> (Int, Int, Int, Int) - // CHECK: define hidden swifttailcc void @"$s16typed_throws_abi6PAsyncP2f5ySi_S4itSbYaAA5EmptyVYKFTj"(ptr noalias captures(none) %0, ptr swiftasync %1, i1 %2, ptr noalias swiftself %3, ptr %4, ptr %5, ptr %6) + // CHECK: define hidden swifttailcc void @"$s16typed_throws_abi6PAsyncP2f5ySi_S4itSbYaAA5EmptyVYKFTj"(ptr noalias nocapture %0, ptr swiftasync %1, i1 %2, ptr noalias swiftself %3, ptr %4, ptr %5, ptr %6) // CHECK: %swifterror = alloca swifterror ptr // CHECK: [[CORO:%.*]] = call ptr @llvm.coro.begin(token {{%.*}}, ptr null) // CHECK: store ptr null, ptr %swifterror @@ -3621,7 +3621,7 @@ protocol PAsync { // CHECK: } func g4(_ b: Bool) async throws(OneWord) -> (Int, Int, Int, Int) - // CHECK: define hidden swifttailcc void @"$s16typed_throws_abi6PAsyncP2g5ySi_S4itSbYaAA7OneWordVYKFTj"(ptr noalias captures(none) %0, ptr swiftasync %1, i1 %2, ptr noalias swiftself %3, ptr %4, ptr %5, ptr %6) + // CHECK: define hidden swifttailcc void @"$s16typed_throws_abi6PAsyncP2g5ySi_S4itSbYaAA7OneWordVYKFTj"(ptr noalias nocapture %0, ptr swiftasync %1, i1 %2, ptr noalias swiftself %3, ptr %4, ptr %5, ptr %6) // CHECK: %swifterror = alloca swifterror ptr // CHECK: [[CORO:%.*]] = call ptr @llvm.coro.begin(token {{%.*}}, ptr null) // CHECK: store ptr null, ptr %swifterror @@ -3700,7 +3700,7 @@ protocol PAsync { // CHECK: } func h4(_ b: Bool) async throws(TwoWords) -> (Int, Int, Int, Int) - // CHECK: define hidden swifttailcc void @"$s16typed_throws_abi6PAsyncP2h5ySi_S4itSbYaAA8TwoWordsVYKFTj"(ptr noalias captures(none) %0, ptr swiftasync %1, i1 %2, ptr noalias swiftself %3, ptr %4, ptr %5, ptr %6) + // CHECK: define hidden swifttailcc void @"$s16typed_throws_abi6PAsyncP2h5ySi_S4itSbYaAA8TwoWordsVYKFTj"(ptr noalias nocapture %0, ptr swiftasync %1, i1 %2, ptr noalias swiftself %3, ptr %4, ptr %5, ptr %6) // CHECK: %swifterror = alloca swifterror ptr // CHECK: [[CORO:%.*]] = call ptr @llvm.coro.begin(token {{%.*}}, ptr null) // CHECK: store ptr null, ptr %swifterror @@ -3779,7 +3779,7 @@ protocol PAsync { // CHECK: } func i4(_ b: Bool) async throws(ThreeWords) -> (Int, Int, Int, Int) - // CHECK: define hidden swifttailcc void @"$s16typed_throws_abi6PAsyncP2i5ySi_S4itSbYaAA10ThreeWordsVYKFTj"(ptr noalias captures(none) %0, ptr swiftasync %1, i1 %2, ptr noalias swiftself %3, ptr %4, ptr %5, ptr %6) + // CHECK: define hidden swifttailcc void @"$s16typed_throws_abi6PAsyncP2i5ySi_S4itSbYaAA10ThreeWordsVYKFTj"(ptr noalias nocapture %0, ptr swiftasync %1, i1 %2, ptr noalias swiftself %3, ptr %4, ptr %5, ptr %6) // CHECK: %swifterror = alloca swifterror ptr // CHECK: [[CORO:%.*]] = call ptr @llvm.coro.begin(token {{%.*}}, ptr null) // CHECK: store ptr null, ptr %swifterror diff --git a/test/IRGen/typed_throws_thunks.swift b/test/IRGen/typed_throws_thunks.swift index d72b00f349b79..4535cb4681f80 100644 --- a/test/IRGen/typed_throws_thunks.swift +++ b/test/IRGen/typed_throws_thunks.swift @@ -45,9 +45,9 @@ extension P { } } - // CHECK-LABEL: define{{.*}} swiftcc void @"$s19typed_throws_thunks1PP2g24bodyyyy7FailureQzYKXE_tAGYKFTj"(ptr %0, ptr %1, ptr noalias swiftself %2, ptr noalias captures(none) swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) + // CHECK-LABEL: define{{.*}} swiftcc void @"$s19typed_throws_thunks1PP2g24bodyyyy7FailureQzYKXE_tAGYKFTj"(ptr %0, ptr %1, ptr noalias swiftself %2, ptr noalias nocapture swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) // CHECK-NOT: ret - // CHECK: call swiftcc void {{.*}}(ptr %0, ptr %1, ptr noalias swiftself %2, ptr noalias captures(none) swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) + // CHECK: call swiftcc void {{.*}}(ptr %0, ptr %1, ptr noalias swiftself %2, ptr noalias nocapture swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) public func g2(body: () throws(Failure) -> Void) throws(Failure) { do { @@ -57,9 +57,9 @@ extension P { } } - // CHECK-LABEL: define{{.*}} swiftcc { i64, i64 } @"$s19typed_throws_thunks1PP2g34bodyyyyAA9FixedSizeVYKXE_tAGYKFTj"(ptr %0, ptr %1, ptr noalias swiftself %2, ptr noalias captures(none) swifterror dereferenceable(8) %3, ptr %4, ptr %5) + // CHECK-LABEL: define{{.*}} swiftcc { i64, i64 } @"$s19typed_throws_thunks1PP2g34bodyyyyAA9FixedSizeVYKXE_tAGYKFTj"(ptr %0, ptr %1, ptr noalias swiftself %2, ptr noalias nocapture swifterror dereferenceable(8) %3, ptr %4, ptr %5) // CHECK-NOT: ret - // CHECK: call swiftcc { i64, i64 } {{.*}}(ptr %0, ptr %1, ptr noalias swiftself %2, ptr noalias captures(none) swifterror dereferenceable(8) %3, ptr %4, ptr %5) + // CHECK: call swiftcc { i64, i64 } {{.*}}(ptr %0, ptr %1, ptr noalias swiftself %2, ptr noalias nocapture swifterror dereferenceable(8) %3, ptr %4, ptr %5) public func g3(body: () throws(FixedSize) -> Void) throws(FixedSize) { @@ -69,7 +69,7 @@ extension P { protocol P2 { // CHECK-LABEL: define{{.*}} swiftcc void @"$s19typed_throws_thunks2P2P1fyyAA1EOYKFTj"( // CHECK-SAME: ptr noalias swiftself %0, -// CHECK-SAME: ptr noalias captures(none) swifterror dereferenceable(8) %1, +// CHECK-SAME: ptr noalias nocapture swifterror dereferenceable(8) %1, // CHECK-SAME: ptr %2, ptr %3 // CHECK-SAME: ) // CHECK-SAME: { @@ -81,7 +81,7 @@ protocol P2 { func f() throws(E) // CHECK-LABEL: define{{.*}} swiftcc i8 @"$s19typed_throws_thunks2P2P1gyys4Int8VYKFTj"( // CHECk-SAME: ptr noalias swiftself %0 -// CHECK-SAME: ptr noalias captures(none) swifterror dereferenceable(8) %1 +// CHECK-SAME: ptr noalias nocapture swifterror dereferenceable(8) %1 // CHECK-SAME: ptr %2 // CHECK-SAME: ptr %3 // CHECK-SAME: ) @@ -93,7 +93,7 @@ protocol P2 { func g() throws(Int8) // CHECK-LABEL: define{{.*}} swiftcc i8 @"$s19typed_throws_thunks2P2P1hs4Int8VyAA1EOYKFTj"( // CHECK-SAME: ptr noalias swiftself %0 -// CHECK-SAME: ptr noalias captures(none) swifterror dereferenceable(8) %1 +// CHECK-SAME: ptr noalias nocapture swifterror dereferenceable(8) %1 // CHECK-SAME: ptr %2 // CHECK-SAME: ptr %3 // CHECK-SAME: ) @@ -105,7 +105,7 @@ protocol P2 { func h() throws(E) -> Int8 // CHECK-LABEL: define{{.*}} swiftcc i8 @"$s19typed_throws_thunks2P2P1is4Int8VyAFYKFTj"( // CHECK-SAME: ptr noalias swiftself %0 -// CHECK-SAME: ptr noalias captures(none) swifterror dereferenceable(8) %1 +// CHECK-SAME: ptr noalias nocapture swifterror dereferenceable(8) %1 // CHECK-SAME: ptr %2 // CHECK-SAME: ptr %3 // CHECK-SAME: ) diff --git a/test/IRGen/typelayout_based_value_witness.swift b/test/IRGen/typelayout_based_value_witness.swift index 02dec241e411b..b0f8c1b207736 100644 --- a/test/IRGen/typelayout_based_value_witness.swift +++ b/test/IRGen/typelayout_based_value_witness.swift @@ -81,7 +81,7 @@ public enum ForwardEnum { // CHECK: } -// OPT: define{{.*}} void @"$s30typelayout_based_value_witness1AVwxx"(ptr noalias %object, ptr captures(none) readonly %"A") +// OPT: define{{.*}} void @"$s30typelayout_based_value_witness1AVwxx"(ptr noalias %object, ptr nocapture readonly %"A") // OPT: [[T_PARAM:%.*]] = getelementptr inbounds{{.*}} i8, ptr %"A", i64 16 // OPT: [[T:%.*]] = load ptr, ptr [[T_PARAM]] // OPT: [[VWT_ADDR:%.*]] = getelementptr inbounds i8, ptr [[T]], {{(i64|i32)}} -8 @@ -127,7 +127,7 @@ public enum ForwardEnum { // OPT: ret void // CHECK: } -// OPT: define internal void @"$s30typelayout_based_value_witness2E3Owui"(ptr noalias captures(none) writeonly %value, i32 %tag, ptr captures(none) readonly %"E3") +// OPT: define internal void @"$s30typelayout_based_value_witness2E3Owui"(ptr noalias nocapture writeonly %value, i32 %tag, ptr nocapture readonly %"E3") // OPT: [[IS_EMPTY:%.*]] = icmp eq i32 {{%.*}}, 0 // OPT: br i1 [[IS_EMPTY]], label %empty-payload, label %non-empty-payload // OPT: } diff --git a/test/IRGen/unconditional_checked_cast.sil b/test/IRGen/unconditional_checked_cast.sil index b4f9198282b61..adb01d83790f0 100644 --- a/test/IRGen/unconditional_checked_cast.sil +++ b/test/IRGen/unconditional_checked_cast.sil @@ -10,7 +10,7 @@ sil_vtable C {} class D : C {} sil_vtable D {} -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @downcast_test(ptr noalias captures(none) sret({{.*}}) %0, ptr captures(none) dereferenceable({{.*}}) %1) {{.*}} { +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @downcast_test(ptr noalias nocapture sret({{.*}}) %0, ptr nocapture dereferenceable({{.*}}) %1) {{.*}} { // CHECK: entry: // CHECK-NEXT: [[INPUTPTR:%[0-9]+]] = load ptr, ptr [[INPUTPTRPTR:%[0-9]+]], align 8 // CHECK-NEXT: [[TMP:%.*]] = call swiftcc %swift.metadata_response @"$s26unconditional_checked_cast1DCMa"(i64 0) diff --git a/test/IRGen/witness_method.sil b/test/IRGen/witness_method.sil index c59e41bde9b0d..83158ff57addc 100644 --- a/test/IRGen/witness_method.sil +++ b/test/IRGen/witness_method.sil @@ -110,7 +110,7 @@ class TPSReport : Strategy { func disrupt() -> GrowthHack } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @classArchetypeWitnessMethod(ptr noalias captures(none) swiftself dereferenceable({{4|8}}) %0, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @classArchetypeWitnessMethod(ptr noalias nocapture swiftself dereferenceable({{4|8}}) %0, ptr %Self, ptr %SelfWitnessTable) sil @classArchetypeWitnessMethod : $@convention(witness_method: Strategy) > (@in_guaranteed T) -> () { entry(%self : $*T): @@ -118,7 +118,7 @@ entry(%self : $*T): return %z : $() } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @testClassArchetypeWitnessMethod(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias captures(none) dereferenceable({{4|8}}) %1, ptr %T, ptr %CoverSheet) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @testClassArchetypeWitnessMethod(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture dereferenceable({{4|8}}) %1, ptr %T, ptr %CoverSheet) // CHECK: entry: // CHECK: [[WITNESS_FN:%.*]] = load ptr, ptr getelementptr inbounds (ptr, ptr @"$s14witness_method9TPSReportCyxGAA8StrategyAAWP", i32 3) // CHECK: call swiftcc void [[WITNESS_FN]](ptr noalias sret({{.*}}) %0, ptr noalias swiftself %1, ptr %T, ptr @"$s14witness_method9TPSReportCyxGAA8StrategyAAWP") diff --git a/test/IRGen/yield_once_big.sil b/test/IRGen/yield_once_big.sil index ca39dbeb85392..efafc5bffbea7 100644 --- a/test/IRGen/yield_once_big.sil +++ b/test/IRGen/yield_once_big.sil @@ -57,7 +57,7 @@ entry: %1000 = integer_literal $Builtin.Int32, 1000 apply %marker(%1000) : $@convention(thin) (Builtin.Int32) -> () - // CHECK-NEXT: call swiftcc void @make_big(ptr noalias captures(none) sret({{.*}}) [[TEMP]], ptr %C) + // CHECK-NEXT: call swiftcc void @make_big(ptr noalias nocapture sret({{.*}}) [[TEMP]], ptr %C) %make = function_ref @make_big : $@convention(thin) () -> (@owned Big) %value = apply %make() : $@convention(thin) () -> (@owned Big) @@ -171,8 +171,8 @@ cont: } // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { ptr, ptr } @test_simple_guaranteed -// CHECK-32-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE:16]]) %0, ptr noalias captures(none) dereferenceable(32) %1, ptr %C) -// CHECK-64-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE:32]]) %0, ptr noalias captures(none) dereferenceable(64) %1, ptr %C) +// CHECK-32-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE:16]]) %0, ptr noalias nocapture dereferenceable(32) %1, ptr %C) +// CHECK-64-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE:32]]) %0, ptr noalias nocapture dereferenceable(64) %1, ptr %C) sil [ossa] @test_simple_guaranteed : $@yield_once (@in_guaranteed BigWrapper) -> (@yields @guaranteed Big) { entry(%arg : $*BigWrapper): // Allocate space for the return value of make_big. diff --git a/test/IRGen/yield_once_indirect.sil b/test/IRGen/yield_once_indirect.sil index 84daf565e4296..f4d48b3db74c6 100644 --- a/test/IRGen/yield_once_indirect.sil +++ b/test/IRGen/yield_once_indirect.sil @@ -42,7 +42,7 @@ entry: // CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 {{.*}}, ptr [[TEMP]]) %temp = alloc_stack $Indirect - // CHECK-NEXT: call swiftcc void @make_indirect(ptr noalias captures(none) sret({{.*}}) [[TEMP]], ptr %C) + // CHECK-NEXT: call swiftcc void @make_indirect(ptr noalias nocapture sret({{.*}}) [[TEMP]], ptr %C) %make = function_ref @make_indirect : $@convention(thin) () -> (@out Indirect) apply %make(%temp) : $@convention(thin) () -> (@out Indirect) diff --git a/test/Inputs/conditional_conformance_basic_conformances.swift b/test/Inputs/conditional_conformance_basic_conformances.swift index 94d17cef537e9..9b8bf6bc52667 100644 --- a/test/Inputs/conditional_conformance_basic_conformances.swift +++ b/test/Inputs/conditional_conformance_basic_conformances.swift @@ -18,7 +18,7 @@ extension Single: P1 where A: P2 { // witness method for Single.normal -// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s42conditional_conformance_basic_conformances6SingleVyxGAA2P1A2A2P2RzlAaEP6normalyyFTW"(ptr noalias captures(none) swiftself %0, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s42conditional_conformance_basic_conformances6SingleVyxGAA2P1A2A2P2RzlAaEP6normalyyFTW"(ptr noalias nocapture swiftself %0, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: // CHECK-NEXT: [[A_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 -1 // CHECK-NEXT: [[A_P2_i8star:%.*]] = load ptr, ptr [[A_P2_PTR]], align 8 @@ -30,7 +30,7 @@ extension Single: P1 where A: P2 { // witness method for Single.generic -// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s42conditional_conformance_basic_conformances6SingleVyxGAA2P1A2A2P2RzlAaEP7genericyyqd__AA2P3Rd__lFTW"(ptr noalias %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias captures(none) swiftself %1, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s42conditional_conformance_basic_conformances6SingleVyxGAA2P1A2A2P2RzlAaEP7genericyyqd__AA2P3Rd__lFTW"(ptr noalias %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias nocapture swiftself %1, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: // CHECK-NEXT: [[A_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 -1 // CHECK-NEXT: [[A_P2_i8star:%.*]] = load ptr, ptr [[A_P2_PTR]], align 8 @@ -188,7 +188,7 @@ extension Double: P1 where B: P2, C: P3 { // witness method for Double.normal -// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s42conditional_conformance_basic_conformances6DoubleVyxq_GAA2P1A2A2P2RzAA2P3R_rlAaEP6normalyyFTW"(ptr noalias captures(none) swiftself %0, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s42conditional_conformance_basic_conformances6DoubleVyxq_GAA2P1A2A2P2RzAA2P3R_rlAaEP6normalyyFTW"(ptr noalias nocapture swiftself %0, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: // CHECK-NEXT: [[B_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 -1 // CHECK-NEXT: [[B_P2_i8star:%.*]] = load ptr, ptr [[B_P2_PTR]], align 8 @@ -208,7 +208,7 @@ extension Double: P1 where B: P2, C: P3 { // witness method for Double.generic -// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s42conditional_conformance_basic_conformances6DoubleVyxq_GAA2P1A2A2P2RzAA2P3R_rlAaEP7genericyyqd__AaGRd__lFTW"(ptr noalias %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias captures(none) swiftself %1, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s42conditional_conformance_basic_conformances6DoubleVyxq_GAA2P1A2A2P2RzAA2P3R_rlAaEP7genericyyqd__AaGRd__lFTW"(ptr noalias %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias nocapture swiftself %1, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: // CHECK-NEXT: [[B_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 -1 diff --git a/test/Inputs/conditional_conformance_basic_conformances_future.swift b/test/Inputs/conditional_conformance_basic_conformances_future.swift index b6a4578a4f6d9..a5e4289658656 100644 --- a/test/Inputs/conditional_conformance_basic_conformances_future.swift +++ b/test/Inputs/conditional_conformance_basic_conformances_future.swift @@ -18,7 +18,7 @@ extension Single: P1 where A: P2 { // witness method for Single.normal -// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s42conditional_conformance_basic_conformances6SingleVyxGAA2P1A2A2P2RzlAaEP6normalyyFTW"(ptr noalias captures(none) swiftself %0, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s42conditional_conformance_basic_conformances6SingleVyxGAA2P1A2A2P2RzlAaEP6normalyyFTW"(ptr noalias nocapture swiftself %0, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: // CHECK-NEXT: [[A_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 -1 // CHECK-NEXT: [[A_P2_i8star:%.*]] = load ptr, ptr [[A_P2_PTR]], align 8 @@ -30,7 +30,7 @@ extension Single: P1 where A: P2 { // witness method for Single.generic -// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s42conditional_conformance_basic_conformances6SingleVyxGAA2P1A2A2P2RzlAaEP7genericyyqd__AA2P3Rd__lFTW"(ptr noalias %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias captures(none) swiftself %1, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s42conditional_conformance_basic_conformances6SingleVyxGAA2P1A2A2P2RzlAaEP7genericyyqd__AA2P3Rd__lFTW"(ptr noalias %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias nocapture swiftself %1, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: // CHECK-NEXT: [[A_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 -1 // CHECK-NEXT: [[A_P2_i8star:%.*]] = load ptr, ptr [[A_P2_PTR]], align 8 @@ -167,7 +167,7 @@ extension Double: P1 where B: P2, C: P3 { // witness method for Double.normal -// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s42conditional_conformance_basic_conformances6DoubleVyxq_GAA2P1A2A2P2RzAA2P3R_rlAaEP6normalyyFTW"(ptr noalias captures(none) swiftself %0, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s42conditional_conformance_basic_conformances6DoubleVyxq_GAA2P1A2A2P2RzAA2P3R_rlAaEP6normalyyFTW"(ptr noalias nocapture swiftself %0, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: // CHECK-NEXT: [[B_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 -1 // CHECK-NEXT: [[B_P2_i8star:%.*]] = load ptr, ptr [[B_P2_PTR]], align 8 @@ -187,7 +187,7 @@ extension Double: P1 where B: P2, C: P3 { // witness method for Double.generic -// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s42conditional_conformance_basic_conformances6DoubleVyxq_GAA2P1A2A2P2RzAA2P3R_rlAaEP7genericyyqd__AaGRd__lFTW"(ptr noalias %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias captures(none) swiftself %1, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s42conditional_conformance_basic_conformances6DoubleVyxq_GAA2P1A2A2P2RzAA2P3R_rlAaEP7genericyyqd__AaGRd__lFTW"(ptr noalias %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias nocapture swiftself %1, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: // CHECK-NEXT: [[B_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 -1 diff --git a/test/Inputs/conditional_conformance_subclass.swift b/test/Inputs/conditional_conformance_subclass.swift index 9901f262e219b..a91dcb3dfb281 100644 --- a/test/Inputs/conditional_conformance_subclass.swift +++ b/test/Inputs/conditional_conformance_subclass.swift @@ -16,7 +16,7 @@ extension Base: P1 where A: P2 { // witness method for Base.normal -// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s32conditional_conformance_subclass4BaseCyxGAA2P1A2A2P2RzlAaEP6normalyyFTW"(ptr noalias captures(none) swiftself dereferenceable(8) %0, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s32conditional_conformance_subclass4BaseCyxGAA2P1A2A2P2RzlAaEP6normalyyFTW"(ptr noalias nocapture swiftself dereferenceable(8) %0, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: // CHECK-NEXT: [[A_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 -1 // CHECK-NEXT: [[A_P2:%.*]] = load ptr, ptr [[A_P2_PTR]], align 8 @@ -27,7 +27,7 @@ extension Base: P1 where A: P2 { // witness method for Base.generic -// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s32conditional_conformance_subclass4BaseCyxGAA2P1A2A2P2RzlAaEP7genericyyqd__AA2P3Rd__lFTW"(ptr noalias %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias captures(none) swiftself dereferenceable(8) %1, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s32conditional_conformance_subclass4BaseCyxGAA2P1A2A2P2RzlAaEP7genericyyqd__AA2P3Rd__lFTW"(ptr noalias %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias nocapture swiftself dereferenceable(8) %1, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: // CHECK-NEXT: [[A_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 -1 // CHECK-NEXT: [[A_P2:%.*]] = load ptr, ptr [[A_P2_PTR]], align 8 diff --git a/test/Inputs/conditional_conformance_subclass_future.swift b/test/Inputs/conditional_conformance_subclass_future.swift index d444136959fad..efe653ebc65b8 100644 --- a/test/Inputs/conditional_conformance_subclass_future.swift +++ b/test/Inputs/conditional_conformance_subclass_future.swift @@ -16,7 +16,7 @@ extension Base: P1 where A: P2 { // witness method for Base.normal -// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s32conditional_conformance_subclass4BaseCyxGAA2P1A2A2P2RzlAaEP6normalyyFTW"(ptr noalias captures(none) swiftself dereferenceable(8) %0, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s32conditional_conformance_subclass4BaseCyxGAA2P1A2A2P2RzlAaEP6normalyyFTW"(ptr noalias nocapture swiftself dereferenceable(8) %0, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: // CHECK-NEXT: [[A_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 -1 // CHECK-NEXT: [[A_P2:%.*]] = load ptr, ptr [[A_P2_PTR]], align 8 @@ -27,7 +27,7 @@ extension Base: P1 where A: P2 { // witness method for Base.generic -// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s32conditional_conformance_subclass4BaseCyxGAA2P1A2A2P2RzlAaEP7genericyyqd__AA2P3Rd__lFTW"(ptr noalias %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias captures(none) swiftself dereferenceable(8) %1, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s32conditional_conformance_subclass4BaseCyxGAA2P1A2A2P2RzlAaEP7genericyyqd__AA2P3Rd__lFTW"(ptr noalias %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias nocapture swiftself dereferenceable(8) %1, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: // CHECK-NEXT: [[A_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 -1 // CHECK-NEXT: [[A_P2:%.*]] = load ptr, ptr [[A_P2_PTR]], align 8 diff --git a/test/Inputs/conditional_conformance_with_assoc.swift b/test/Inputs/conditional_conformance_with_assoc.swift index a1f5618538196..adc6aa0de2c97 100644 --- a/test/Inputs/conditional_conformance_with_assoc.swift +++ b/test/Inputs/conditional_conformance_with_assoc.swift @@ -41,7 +41,7 @@ extension Double: P1 where B.AT2: P2, C: P3, B.AT2.AT2.AT3: P3 { // witness method for Double.normal -// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s34conditional_conformance_with_assoc6DoubleVyxq_GAA2P1A2A2P3R_AA2P23AT2RpzAafH_AhaGP3AT3RPzrlAaEP6normalyyFTW"(ptr noalias captures(none) swiftself %0, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s34conditional_conformance_with_assoc6DoubleVyxq_GAA2P1A2A2P3R_AA2P23AT2RpzAafH_AhaGP3AT3RPzrlAaEP6normalyyFTW"(ptr noalias nocapture swiftself %0, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: // CHECK-NEXT: [[C_P3_PTR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 -1 // CHECK-NEXT: [[C_P3:%.*]] = load ptr, ptr [[C_P3_PTR]], align 8 @@ -67,7 +67,7 @@ extension Double: P1 where B.AT2: P2, C: P3, B.AT2.AT2.AT3: P3 { // witness method for Double.generic -// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s34conditional_conformance_with_assoc6DoubleVyxq_GAA2P1A2A2P3R_AA2P23AT2RpzAafH_AhaGP3AT3RPzrlAaEP7genericyyqd__AaFRd__lFTW"(ptr noalias %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias captures(none) swiftself %1, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s34conditional_conformance_with_assoc6DoubleVyxq_GAA2P1A2A2P3R_AA2P23AT2RpzAafH_AhaGP3AT3RPzrlAaEP7genericyyqd__AaFRd__lFTW"(ptr noalias %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias nocapture swiftself %1, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: // CHECK-NEXT: [[C_P3_PTR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 -1 // CHECK-NEXT: [[C_P3:%.*]] = load ptr, ptr [[C_P3_PTR]], align 8 diff --git a/test/Inputs/conditional_conformance_with_assoc_future.swift b/test/Inputs/conditional_conformance_with_assoc_future.swift index 1845b3e6b3404..f264b742db309 100644 --- a/test/Inputs/conditional_conformance_with_assoc_future.swift +++ b/test/Inputs/conditional_conformance_with_assoc_future.swift @@ -41,7 +41,7 @@ extension Double: P1 where B.AT2: P2, C: P3, B.AT2.AT2.AT3: P3 { // witness method for Double.normal -// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s34conditional_conformance_with_assoc6DoubleVyxq_GAA2P1A2A2P3R_AA2P23AT2RpzAafH_AhaGP3AT3RPzrlAaEP6normalyyFTW"(ptr noalias captures(none) swiftself %0, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s34conditional_conformance_with_assoc6DoubleVyxq_GAA2P1A2A2P3R_AA2P23AT2RpzAafH_AhaGP3AT3RPzrlAaEP6normalyyFTW"(ptr noalias nocapture swiftself %0, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: // CHECK-NEXT: [[C_P3_PTR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 -1 // CHECK-NEXT: [[C_P3:%.*]] = load ptr, ptr [[C_P3_PTR]], align 8 @@ -67,7 +67,7 @@ extension Double: P1 where B.AT2: P2, C: P3, B.AT2.AT2.AT3: P3 { // witness method for Double.generic -// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s34conditional_conformance_with_assoc6DoubleVyxq_GAA2P1A2A2P3R_AA2P23AT2RpzAafH_AhaGP3AT3RPzrlAaEP7genericyyqd__AaFRd__lFTW"(ptr noalias %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias captures(none) swiftself %1, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s34conditional_conformance_with_assoc6DoubleVyxq_GAA2P1A2A2P3R_AA2P23AT2RpzAafH_AhaGP3AT3RPzrlAaEP7genericyyqd__AaFRd__lFTW"(ptr noalias %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias nocapture swiftself %1, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: // CHECK-NEXT: [[C_P3_PTR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 -1 // CHECK-NEXT: [[C_P3:%.*]] = load ptr, ptr [[C_P3_PTR]], align 8 diff --git a/test/Interop/Cxx/class/method/inreg-sret.swift b/test/Interop/Cxx/class/method/inreg-sret.swift index c5258b6a1c863..b11bc95fe3c68 100644 --- a/test/Interop/Cxx/class/method/inreg-sret.swift +++ b/test/Interop/Cxx/class/method/inreg-sret.swift @@ -21,8 +21,8 @@ final public class Function { // Check that inreg on the sret isn't missing -// CHECK-x86_64: call void @"?getFirstBlock@BridgedFunction@@QEBA?AUOptionalBridgedBasicBlock@@XZ"(ptr {{.*}}, ptr noalias captures(none) sret(%TSo25OptionalBridgedBasicBlockV) {{.*}}) -// CHECK-aarch64: call void @"?getFirstBlock@BridgedFunction@@QEBA?AUOptionalBridgedBasicBlock@@XZ"(ptr {{.*}}, ptr inreg noalias captures(none) sret(%TSo25OptionalBridgedBasicBlockV) {{.*}}) +// CHECK-x86_64: call void @"?getFirstBlock@BridgedFunction@@QEBA?AUOptionalBridgedBasicBlock@@XZ"(ptr {{.*}}, ptr noalias nocapture sret(%TSo25OptionalBridgedBasicBlockV) {{.*}}) +// CHECK-aarch64: call void @"?getFirstBlock@BridgedFunction@@QEBA?AUOptionalBridgedBasicBlock@@XZ"(ptr {{.*}}, ptr inreg noalias nocapture sret(%TSo25OptionalBridgedBasicBlockV) {{.*}}) // CHECK-x86_64: define {{.*}} void @"?getFirstBlock@BridgedFunction@@QEBA?AUOptionalBridgedBasicBlock@@XZ"(ptr {{.*}} %{{.*}}, ptr {{.*}} sret(%struct.OptionalBridgedBasicBlock) {{.*}} %{{.*}}) // CHECK-aarch64: define {{.*}} void @"?getFirstBlock@BridgedFunction@@QEBA?AUOptionalBridgedBasicBlock@@XZ"(ptr {{.*}} %{{.*}}, ptr inreg {{.*}} sret(%struct.OptionalBridgedBasicBlock) {{.*}} %{{.*}}) diff --git a/test/Interop/Cxx/class/protocol-conformance-irgen.swift b/test/Interop/Cxx/class/protocol-conformance-irgen.swift index db017b4910b1c..d5dbbe435add5 100644 --- a/test/Interop/Cxx/class/protocol-conformance-irgen.swift +++ b/test/Interop/Cxx/class/protocol-conformance-irgen.swift @@ -7,7 +7,7 @@ protocol HasReturn42 { } -// CHECK: define {{.*}}i32 @"$sSo18ConformsToProtocolV4main11HasReturn42A2cDP8return42s5Int32VyFTW"(ptr captures(none) swiftself dereferenceable(1) %{{.*}}, ptr %{{.*}}, ptr %{{.*}}) +// CHECK: define {{.*}}i32 @"$sSo18ConformsToProtocolV4main11HasReturn42A2cDP8return42s5Int32VyFTW"(ptr nocapture swiftself dereferenceable(1) %{{.*}}, ptr %{{.*}}, ptr %{{.*}}) // CHECK: [[OUT:%.*]] = call i32 @{{_ZN18ConformsToProtocol8return42Ev|"\?return42@ConformsToProtocol@@QEAAHXZ"}}(ptr // CHECK: ret i32 [[OUT]] diff --git a/test/Interop/Cxx/class/returns-large-class-irgen.swift b/test/Interop/Cxx/class/returns-large-class-irgen.swift index f45dde04337da..d9e6f3af56c7a 100644 --- a/test/Interop/Cxx/class/returns-large-class-irgen.swift +++ b/test/Interop/Cxx/class/returns-large-class-irgen.swift @@ -14,7 +14,7 @@ func foo() -> LargeClass { foo() -// CHECK: call swiftcc void @"$s4main3fooSo10LargeClassVyF"(ptr noalias captures(none) sret(%TSo10LargeClassV) %{{.*}}) +// CHECK: call swiftcc void @"$s4main3fooSo10LargeClassVyF"(ptr noalias nocapture sret(%TSo10LargeClassV) %{{.*}}) // The C++ function: // CHECK: define{{( dso_local)?}} void @{{_Z21funcReturnsLargeClassv|"\?funcReturnsLargeClass@@YA\?AULargeClass@@XZ"}}({{%struct.LargeClass\*|ptr}}{{.*}} sret(%struct.LargeClass){{( align .*)?}} %{{.*}}) diff --git a/test/Interop/Cxx/extern-var/extern-var-irgen.swift b/test/Interop/Cxx/extern-var/extern-var-irgen.swift index 57a3d0a416542..cbec5e8e26828 100644 --- a/test/Interop/Cxx/extern-var/extern-var-irgen.swift +++ b/test/Interop/Cxx/extern-var/extern-var-irgen.swift @@ -44,4 +44,4 @@ public func passingVarAsInout() { } // CHECK: define {{(protected |dllexport )?}}swiftcc void @"$s4main17passingVarAsInoutyyF"() #0 -// CHECK: call swiftcc void @"$s4main11modifyInoutyys5Int32VzF"(ptr captures(none) dereferenceable(4) @{{counter|"\?counter@@3HA"}}) +// CHECK: call swiftcc void @"$s4main11modifyInoutyys5Int32VzF"(ptr nocapture dereferenceable(4) @{{counter|"\?counter@@3HA"}}) diff --git a/test/Interop/Cxx/static/inline-static-member-var-irgen.swift b/test/Interop/Cxx/static/inline-static-member-var-irgen.swift index edde6d6c0617b..f5409c05e9864 100644 --- a/test/Interop/Cxx/static/inline-static-member-var-irgen.swift +++ b/test/Interop/Cxx/static/inline-static-member-var-irgen.swift @@ -28,4 +28,4 @@ public func passingVarAsInout() { } // CHECK: define {{(protected |dllexport )?}}swiftcc void @"$s4main17passingVarAsInoutyyF"() -// CHECK: call swiftcc void @"$s4main11modifyInoutyys5Int32VzF"(ptr captures(none) dereferenceable(4) @{{_ZN22WithInlineStaticMember12staticMemberE|"\?staticMember@WithInlineStaticMember@@2HA"}}) +// CHECK: call swiftcc void @"$s4main11modifyInoutyys5Int32VzF"(ptr nocapture dereferenceable(4) @{{_ZN22WithInlineStaticMember12staticMemberE|"\?staticMember@WithInlineStaticMember@@2HA"}}) diff --git a/test/Interop/Cxx/static/static-var-irgen.swift b/test/Interop/Cxx/static/static-var-irgen.swift index f7b44647fb031..f8d920ebd8cef 100644 --- a/test/Interop/Cxx/static/static-var-irgen.swift +++ b/test/Interop/Cxx/static/static-var-irgen.swift @@ -85,7 +85,7 @@ public func passingVarAsInout() { modifyInout(&staticVar) } // CHECK: define {{.*}}void @"$s4main17passingVarAsInoutyyF"() -// CHECK: call swiftcc void @"$s4main11modifyInoutyys5Int32VzF"(ptr captures(none) dereferenceable(4) @{{_ZL9staticVar|staticVar}}) +// CHECK: call swiftcc void @"$s4main11modifyInoutyys5Int32VzF"(ptr nocapture dereferenceable(4) @{{_ZL9staticVar|staticVar}}) // CHECK: define internal void @_GLOBAL__sub_I__swift_imported_modules_() // CHECK: call void @{{__cxx_global_var_init|"\?\?__EstaticVarInit@@YAXXZ"}}() diff --git a/test/Interop/Cxx/stdlib/msvc-abi-use-vector-iterator.swift b/test/Interop/Cxx/stdlib/msvc-abi-use-vector-iterator.swift index d3a26f5b65b9a..daa43eeb78a59 100644 --- a/test/Interop/Cxx/stdlib/msvc-abi-use-vector-iterator.swift +++ b/test/Interop/Cxx/stdlib/msvc-abi-use-vector-iterator.swift @@ -5,7 +5,7 @@ import MsvcUseVecIt -// CHECK: call void @"?begin@?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QEBA?AV?$_Vector_const_iterator@V?$_Vector_val@U?$_Simple_types@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@std@@@std@@@2@XZ"(ptr {{.*}}, ptr noalias captures(none) sret +// CHECK: call void @"?begin@?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QEBA?AV?$_Vector_const_iterator@V?$_Vector_val@U?$_Simple_types@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@std@@@std@@@2@XZ"(ptr {{.*}}, ptr noalias nocapture sret func test() -> Bool { let result = f() diff --git a/test/Interop/Cxx/templates/mangling-irgen.swift b/test/Interop/Cxx/templates/mangling-irgen.swift index d5d714652159d..3a5f1e8f349ef 100644 --- a/test/Interop/Cxx/templates/mangling-irgen.swift +++ b/test/Interop/Cxx/templates/mangling-irgen.swift @@ -4,12 +4,12 @@ import Mangling public func receiveInstantiation(_ i: inout WrappedMagicBool) {} -// CHECK: define {{(protected |dllexport )?}}swiftcc void @"$s4main20receiveInstantiationyySo0025MagicWrapperCBool_lsFCfibVzF"(ptr captures(none) dereferenceable(1) %0) +// CHECK: define {{(protected |dllexport )?}}swiftcc void @"$s4main20receiveInstantiationyySo0025MagicWrapperCBool_lsFCfibVzF"(ptr nocapture dereferenceable(1) %0) public func receiveInstantiation(_ i: inout WrappedMagicInt) {} // Don't forget to update manglings.txt when changing s4main20receiveInstantiationyySo34__CxxTemplateInst12MagicWrapperIiEVzF -// CHECK: define {{(protected |dllexport )?}}swiftcc void @"$s4main20receiveInstantiationyySo0024MagicWrapperCInt_npAIefbVzF"(ptr captures(none) dereferenceable(1) %0) +// CHECK: define {{(protected |dllexport )?}}swiftcc void @"$s4main20receiveInstantiationyySo0024MagicWrapperCInt_npAIefbVzF"(ptr nocapture dereferenceable(1) %0) public func returnInstantiation() -> WrappedMagicInt { return WrappedMagicInt() diff --git a/test/SILOptimizer/devirt_witness_method_empty_conformance.swift b/test/SILOptimizer/devirt_witness_method_empty_conformance.swift index 047493fcebc18..e8ea8e7959487 100644 --- a/test/SILOptimizer/devirt_witness_method_empty_conformance.swift +++ b/test/SILOptimizer/devirt_witness_method_empty_conformance.swift @@ -76,7 +76,7 @@ extension ApplyRegStruct { from space: PublicEnum, transform: RegStruct ) { transform.funcInStructAndProtAndExt(.case2, space: space) { -// CHECK-LABEL: define hidden swiftcc void @"$sSa39devirt_witness_method_empty_conformanceAA12PublicStructVRszlE14applyTransformyyF"(ptr captures(none) {{.*}}swiftself dereferenceable +// CHECK-LABEL: define hidden swiftcc void @"$sSa39devirt_witness_method_empty_conformanceAA12PublicStructVRszlE14applyTransformyyF"(ptr nocapture {{.*}}swiftself dereferenceable // CHECK-NEXT: entry // CHECK-NEXT: ret void applyTransform() diff --git a/test/SILOptimizer/eager_specialize.sil b/test/SILOptimizer/eager_specialize.sil index 71cd25f905b11..3f4a290d927f6 100644 --- a/test/SILOptimizer/eager_specialize.sil +++ b/test/SILOptimizer/eager_specialize.sil @@ -698,7 +698,7 @@ bb0(%0 : $*Self, %1 : $*Self, %2 : $@thick Self.Type): // Check that a specialization for _Trivial(32) uses direct loads and stores // instead of value witness functions to load and store the value of a generic type. -// CHECK-IRGEN-LABEL: define linkonce_odr hidden swiftcc void @"$s16eager_specialize18copyValueAndReturn_1sxx_xztlFxxxRlze31_lIetilr_Tp5"(ptr noalias captures(none) sret(i32) %0, ptr noalias captures(none) dereferenceable(4) %1, ptr captures(none) dereferenceable(4) %2, ptr %S +// CHECK-IRGEN-LABEL: define linkonce_odr hidden swiftcc void @"$s16eager_specialize18copyValueAndReturn_1sxx_xztlFxxxRlze31_lIetilr_Tp5"(ptr noalias nocapture sret(i32) %0, ptr noalias nocapture dereferenceable(4) %1, ptr nocapture dereferenceable(4) %2, ptr %S // CHECK-IRGEN: entry: // CHECK-IRGEN: %3 = load i32, ptr %2 // CHECK-IRGEN-NEXT: store i32 %3, ptr %0 @@ -707,7 +707,7 @@ bb0(%0 : $*Self, %1 : $*Self, %2 : $@thick Self.Type): // Check that a specialization for _Trivial(64) uses direct loads and stores // instead of value witness functions to load and store the value of a generic type. -// CHECK-IRGEN-LABEL: define linkonce_odr hidden swiftcc void @"$s16eager_specialize18copyValueAndReturn_1sxx_xztlFxxxRlze63_lIetilr_Tp5"(ptr noalias captures(none) sret(i64) %0, ptr noalias captures(none) dereferenceable(8) %1, ptr captures(none) dereferenceable(8) %2, ptr %S +// CHECK-IRGEN-LABEL: define linkonce_odr hidden swiftcc void @"$s16eager_specialize18copyValueAndReturn_1sxx_xztlFxxxRlze63_lIetilr_Tp5"(ptr noalias nocapture sret(i64) %0, ptr noalias nocapture dereferenceable(8) %1, ptr nocapture dereferenceable(8) %2, ptr %S // CHECK-IRGEN: entry: // CHECK-IRGEN: %3 = load i64, ptr %2 // CHECK-IRGEN-NEXT: store i64 %3, ptr %0 diff --git a/test/SILOptimizer/eager_specialize_ossa.sil b/test/SILOptimizer/eager_specialize_ossa.sil index 03aa594364e83..2ac721d8a6d96 100644 --- a/test/SILOptimizer/eager_specialize_ossa.sil +++ b/test/SILOptimizer/eager_specialize_ossa.sil @@ -886,7 +886,7 @@ bb0(%0 : $*Self, %1 : $*Self, %2 : $@thick Self.Type): // Check that a specialization for _Trivial(32) uses direct loads and stores // instead of value witness functions to load and store the value of a generic type. -// CHECK-IRGEN-LABEL: define linkonce_odr hidden swiftcc void @"$s16eager_specialize18copyValueAndReturn_1sxx_xztlFxxxRlze31_lIetilr_Tp5"(ptr noalias captures(none) sret(i32) %0, ptr noalias captures(none) dereferenceable(4) %1, ptr captures(none) dereferenceable(4) %2, ptr %S +// CHECK-IRGEN-LABEL: define linkonce_odr hidden swiftcc void @"$s16eager_specialize18copyValueAndReturn_1sxx_xztlFxxxRlze31_lIetilr_Tp5"(ptr noalias nocapture sret(i32) %0, ptr noalias nocapture dereferenceable(4) %1, ptr nocapture dereferenceable(4) %2, ptr %S // CHECK-IRGEN: entry: // CHECK-IRGEN: %3 = load i32, ptr %2 // CHECK-IRGEN-NEXT: store i32 %3, ptr %0 @@ -895,7 +895,7 @@ bb0(%0 : $*Self, %1 : $*Self, %2 : $@thick Self.Type): // Check that a specialization for _Trivial(64) uses direct loads and stores // instead of value witness functions to load and store the value of a generic type. -// CHECK-IRGEN-LABEL: define linkonce_odr hidden swiftcc void @"$s16eager_specialize18copyValueAndReturn_1sxx_xztlFxxxRlze63_lIetilr_Tp5"(ptr noalias captures(none) sret(i64) %0, ptr noalias captures(none) dereferenceable(8) %1, ptr captures(none) dereferenceable(8) %2, ptr %S +// CHECK-IRGEN-LABEL: define linkonce_odr hidden swiftcc void @"$s16eager_specialize18copyValueAndReturn_1sxx_xztlFxxxRlze63_lIetilr_Tp5"(ptr noalias nocapture sret(i64) %0, ptr noalias nocapture dereferenceable(8) %1, ptr nocapture dereferenceable(8) %2, ptr %S // CHECK-IRGEN: entry: // CHECK-IRGEN: %3 = load i64, ptr %2 // CHECK-IRGEN-NEXT: store i64 %3, ptr %0 From ff8fbf1b4b970108a7a79200c2212dc0fde30ab3 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Tue, 13 May 2025 01:05:21 +0100 Subject: [PATCH 36/40] Revert "SILGen, SILOptimizer: Fix assertion failures in `llvm::APInt` ctor" The approach taken in the reverted commit is causing tests to fail, and I am not positive that all instances of the -1 to 1 switch are correct. A subsequent commit will restore the old behavior by tweaking the ctor call instead. This reverts commit 657f5028fb45991569d6f58770e3edb0196ec500. --- lib/SILGen/SILGenDecl.cpp | 9 +++++---- lib/SILOptimizer/LoopTransforms/BoundsCheckOpts.cpp | 6 +++--- lib/SILOptimizer/Mandatory/DefiniteInitialization.cpp | 2 +- lib/SILOptimizer/Transforms/SimplifyCFG.cpp | 4 ++-- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/lib/SILGen/SILGenDecl.cpp b/lib/SILGen/SILGenDecl.cpp index ad708d95c2491..cde0970462de2 100644 --- a/lib/SILGen/SILGenDecl.cpp +++ b/lib/SILGen/SILGenDecl.cpp @@ -1995,11 +1995,12 @@ void SILGenFunction::emitStmtCondition(StmtCondition Cond, JumpDest FalseDest, emitOSVersionRangeCheck(loc, versionRange.value(), isMacCatalyst); if (availability->isUnavailability()) { // If this is an unavailability check, invert the result - // by emitting a call to Builtin.xor_Int1(lhs, 1). + // by emitting a call to Builtin.xor_Int1(lhs, -1). SILType i1 = SILType::getBuiltinIntegerType(1, getASTContext()); - SILValue one = B.createIntegerLiteral(loc, i1, 1); - booleanTestValue = B.createBuiltinBinaryFunction( - loc, "xor", i1, i1, {booleanTestValue, one}); + SILValue minusOne = B.createIntegerLiteral(loc, i1, -1); + booleanTestValue = + B.createBuiltinBinaryFunction(loc, "xor", i1, i1, + {booleanTestValue, minusOne}); } } break; diff --git a/lib/SILOptimizer/LoopTransforms/BoundsCheckOpts.cpp b/lib/SILOptimizer/LoopTransforms/BoundsCheckOpts.cpp index 46e8c289f18b0..0e6802be83382 100644 --- a/lib/SILOptimizer/LoopTransforms/BoundsCheckOpts.cpp +++ b/lib/SILOptimizer/LoopTransforms/BoundsCheckOpts.cpp @@ -558,7 +558,7 @@ static SILValue getSub(SILLocation Loc, SILValue Val, unsigned SubVal, SmallVector Args(1, Val); Args.push_back(B.createIntegerLiteral(Loc, Val->getType(), SubVal)); Args.push_back(B.createIntegerLiteral( - Loc, SILType::getBuiltinIntegerType(1, B.getASTContext()), 1)); + Loc, SILType::getBuiltinIntegerType(1, B.getASTContext()), -1)); auto *AI = B.createBuiltinBinaryFunctionWithOverflow( Loc, "ssub_with_overflow", Args); @@ -570,7 +570,7 @@ static SILValue getAdd(SILLocation Loc, SILValue Val, unsigned AddVal, SmallVector Args(1, Val); Args.push_back(B.createIntegerLiteral(Loc, Val->getType(), AddVal)); Args.push_back(B.createIntegerLiteral( - Loc, SILType::getBuiltinIntegerType(1, B.getASTContext()), 1)); + Loc, SILType::getBuiltinIntegerType(1, B.getASTContext()), -1)); auto *AI = B.createBuiltinBinaryFunctionWithOverflow( Loc, "sadd_with_overflow", Args); @@ -1342,7 +1342,7 @@ BoundsCheckOpts::findAndOptimizeInductionVariables(SILLoop *loop) { if (isComparisonKnownTrue(builtin, *ivar)) { if (!trueVal) trueVal = builder.createIntegerLiteral(builtin->getLoc(), - builtin->getType(), 1); + builtin->getType(), -1); builtin->replaceAllUsesWith(trueVal); changed = true; continue; diff --git a/lib/SILOptimizer/Mandatory/DefiniteInitialization.cpp b/lib/SILOptimizer/Mandatory/DefiniteInitialization.cpp index 65cfe2b47537d..a385a2475d442 100644 --- a/lib/SILOptimizer/Mandatory/DefiniteInitialization.cpp +++ b/lib/SILOptimizer/Mandatory/DefiniteInitialization.cpp @@ -2976,7 +2976,7 @@ static SILValue testAllControlVariableBits(SILLocation Loc, if (IVType->getFixedWidth() == 1) return CondVal; - SILValue AllBitsSet = B.createIntegerLiteral(Loc, CondVal->getType(), 1); + SILValue AllBitsSet = B.createIntegerLiteral(Loc, CondVal->getType(), -1); if (!CmpEqFn.get()) CmpEqFn = getBinaryFunction("cmp_eq", CondVal->getType(), B.getASTContext()); diff --git a/lib/SILOptimizer/Transforms/SimplifyCFG.cpp b/lib/SILOptimizer/Transforms/SimplifyCFG.cpp index 0ce619a37ef84..95a835cb07a14 100644 --- a/lib/SILOptimizer/Transforms/SimplifyCFG.cpp +++ b/lib/SILOptimizer/Transforms/SimplifyCFG.cpp @@ -304,7 +304,7 @@ static SILValue createValueForEdge(SILInstruction *UserInst, if (auto *CBI = dyn_cast(DominatingTerminator)) return Builder.createIntegerLiteral( - CBI->getLoc(), CBI->getCondition()->getType(), EdgeIdx == 0 ? 1 : 0); + CBI->getLoc(), CBI->getCondition()->getType(), EdgeIdx == 0 ? -1 : 0); auto *SEI = cast(DominatingTerminator); auto *DstBlock = SEI->getSuccessors()[EdgeIdx].getBB(); @@ -1480,7 +1480,7 @@ static SILValue invertExpectAndApplyTo(SILBuilder &Builder, if (!IL) return V; SILValue NegatedExpectedValue = Builder.createIntegerLiteral( - IL->getLoc(), Args[1]->getType(), IL->getValue() == 0 ? 1 : 0); + IL->getLoc(), Args[1]->getType(), IL->getValue() == 0 ? -1 : 0); return Builder.createBuiltin(BI->getLoc(), BI->getName(), BI->getType(), {}, {V, NegatedExpectedValue}); } From 73c70ee338c515fba37baf3faff93c6389558a5c Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Tue, 13 May 2025 01:19:48 +0100 Subject: [PATCH 37/40] [rebranch] SIL: Restore old behavior in `llvm::APInt` ctor call See https://github.com/llvm/llvm-project/pull/114539. --- lib/SIL/IR/SILInstructions.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/SIL/IR/SILInstructions.cpp b/lib/SIL/IR/SILInstructions.cpp index 5d4fdee039af2..812397d0f20bb 100644 --- a/lib/SIL/IR/SILInstructions.cpp +++ b/lib/SIL/IR/SILInstructions.cpp @@ -1145,7 +1145,9 @@ IntegerLiteralInst *IntegerLiteralInst::create(SILDebugLocation Loc, static APInt getAPInt(AnyBuiltinIntegerType *anyIntTy, intmax_t value) { // If we're forming a fixed-width type, build using the greatest width. if (auto intTy = dyn_cast(anyIntTy)) - return APInt(intTy->getGreatestWidth(), value); + // TODO: Avoid implicit trunc? + return APInt(intTy->getGreatestWidth(), value, /*isSigned=*/false, + /*implicitTrunc=*/true); // Otherwise, build using the size of the type and then truncate to the // minimum width necessary. From 48650ccba4dbee5d9a00535e21913fcfe6352236 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Tue, 20 May 2025 11:39:43 +0100 Subject: [PATCH 38/40] [test] IRGen: Adjust FileCheck patterns for new attribute order The relative order of the LLVM `nocapture` parameter attribute changed upstream in https://github.com/llvm/llvm-project/pull/123181. --- test/IRGen/argument_attrs.sil | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/test/IRGen/argument_attrs.sil b/test/IRGen/argument_attrs.sil index bba5ed69b1869..4e2a98d6b732f 100644 --- a/test/IRGen/argument_attrs.sil +++ b/test/IRGen/argument_attrs.sil @@ -19,34 +19,34 @@ entry(%1 : $*Builtin.Int32, %2 : $*Builtin.Int32, %3 : $*Builtin.Int32, %4 : $Hu // CHECK-LABEL: declare{{( dllimport)?}} swiftcc void @arguments_in_decl(ptr captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(40), ptr noalias, ptr noalias captures(none), ptr) sil @arguments_in_decl : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> () -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @arguments_in_def_out(ptr noalias captures(none) sret({{.*}}) %0, ptr captures(none) dereferenceable(4) %1, ptr noalias captures(none) dereferenceable(4) %2, ptr noalias captures(none) dereferenceable(4) %3, ptr noalias captures(none) dereferenceable(40) %4, ptr noalias %5, ptr noalias captures(none) %6, ptr %T) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @arguments_in_def_out(ptr noalias sret({{.*}}) captures(none) %0, ptr captures(none) dereferenceable(4) %1, ptr noalias captures(none) dereferenceable(4) %2, ptr noalias captures(none) dereferenceable(4) %3, ptr noalias captures(none) dereferenceable(40) %4, ptr noalias %5, ptr noalias captures(none) %6, ptr %T) sil @arguments_in_def_out : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> @out Builtin.Int32 { entry(%0 : $*Builtin.Int32, %1 : $*Builtin.Int32, %2 : $*Builtin.Int32, %3 : $*Builtin.Int32, %4 : $Huge, %5 : $*T, %6 : $*()): - // CHECK: call swiftcc void @arguments_in_decl_out(ptr noalias captures(none) sret({{.*}}) {{%.*}}, ptr captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(40) {{%.*}}, ptr noalias {{%.*}}, ptr noalias captures(none) {{%.*}}, ptr {{%.*}}) + // CHECK: call swiftcc void @arguments_in_decl_out(ptr noalias sret({{.*}}) captures(none) {{%.*}}, ptr captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(40) {{%.*}}, ptr noalias {{%.*}}, ptr noalias captures(none) {{%.*}}, ptr {{%.*}}) %f = function_ref @arguments_in_decl_out : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> @out Builtin.Int32 %x = apply %f(%0, %1, %2, %3, %4, %5, %6) : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> @out Builtin.Int32 - // CHECK: call swiftcc void @arguments_in_def_out(ptr noalias captures(none) sret({{.*}}) {{%.*}}, ptr captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(40) {{%.*}}, ptr noalias {{%.*}}, ptr noalias captures(none) {{%.*}}, ptr {{%.*}}) + // CHECK: call swiftcc void @arguments_in_def_out(ptr noalias sret({{.*}}) captures(none) {{%.*}}, ptr captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(40) {{%.*}}, ptr noalias {{%.*}}, ptr noalias captures(none) {{%.*}}, ptr {{%.*}}) %g = function_ref @arguments_in_def_out : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> @out Builtin.Int32 %y = apply %g(%0, %1, %2, %3, %4, %5, %6) : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> @out Builtin.Int32 return undef : $() } -// CHECK-LABEL: declare{{( dllimport)?}} swiftcc void @arguments_in_decl_out(ptr noalias captures(none) sret({{.*}}), ptr captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(40), ptr noalias, ptr noalias captures(none), ptr) +// CHECK-LABEL: declare{{( dllimport)?}} swiftcc void @arguments_in_decl_out(ptr noalias sret({{.*}}) captures(none), ptr captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(40), ptr noalias, ptr noalias captures(none), ptr) sil @arguments_in_decl_out : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> @out Builtin.Int32 -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @arguments_in_def_huge_ret(ptr noalias captures(none) sret({{.*}}V) %0, ptr captures(none) dereferenceable(4) %1, ptr noalias captures(none) dereferenceable(4) %2, ptr noalias captures(none) dereferenceable(4) %3, ptr noalias captures(none) dereferenceable(40) %4, ptr noalias %5, ptr noalias captures(none) %6, ptr %T) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @arguments_in_def_huge_ret(ptr noalias sret({{.*}}V) captures(none) %0, ptr captures(none) dereferenceable(4) %1, ptr noalias captures(none) dereferenceable(4) %2, ptr noalias captures(none) dereferenceable(4) %3, ptr noalias captures(none) dereferenceable(40) %4, ptr noalias %5, ptr noalias captures(none) %6, ptr %T) sil @arguments_in_def_huge_ret : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> Huge { entry(%1 : $*Builtin.Int32, %2 : $*Builtin.Int32, %3 : $*Builtin.Int32, %4 : $Huge, %5 : $*T, %6 : $*()): %f = function_ref @arguments_in_decl_huge_ret : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> Huge - // CHECK: call swiftcc void @arguments_in_decl_huge_ret(ptr noalias captures(none) sret({{.*}}) {{%.*}}, ptr captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(40) {{%.*}}, ptr noalias {{%.*}}, ptr noalias captures(none) {{%.*}}, ptr {{%.*}}) + // CHECK: call swiftcc void @arguments_in_decl_huge_ret(ptr noalias sret({{.*}}) captures(none) {{%.*}}, ptr captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(40) {{%.*}}, ptr noalias {{%.*}}, ptr noalias captures(none) {{%.*}}, ptr {{%.*}}) %x = apply %f(%1, %2, %3, %4, %5, %6) : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> Huge - // CHECK: call swiftcc void @arguments_in_def_huge_ret(ptr noalias captures(none) sret({{.*}}) {{%.*}}, ptr captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(40) {{%.*}}, ptr noalias {{%.*}}, ptr noalias captures(none) {{%.*}}, ptr {{%.*}}) + // CHECK: call swiftcc void @arguments_in_def_huge_ret(ptr noalias sret({{.*}}) captures(none) {{%.*}}, ptr captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(40) {{%.*}}, ptr noalias {{%.*}}, ptr noalias captures(none) {{%.*}}, ptr {{%.*}}) %g = function_ref @arguments_in_def_huge_ret : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> Huge %y = apply %g(%1, %2, %3, %4, %5, %6) : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> Huge return %y : $Huge } -// CHECK-LABEL: declare{{( dllimport)?}} swiftcc void @arguments_in_decl_huge_ret(ptr noalias captures(none) sret({{.*}}), ptr captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(40), ptr noalias, ptr noalias captures(none), ptr) +// CHECK-LABEL: declare{{( dllimport)?}} swiftcc void @arguments_in_decl_huge_ret(ptr noalias sret({{.*}}) captures(none), ptr captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(40), ptr noalias, ptr noalias captures(none), ptr) sil @arguments_in_decl_huge_ret : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> Huge From ff64fc79afc724c72ae5c7a2314d6c9f84b73b4a Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Wed, 21 May 2025 05:44:04 +0100 Subject: [PATCH 39/40] DebugInfo: Restore old behavior in call to `llvm::DIBuilder::createObjectPointerType` Fix my mistake in 66a6df9a4445434bf54faf6d2c845bbc6d82e270. `false` is the wrong value for the new `Implicit` parameter because it causes the `FlagArtificial` flag to not be set as before that change. The flag itself looks appropriate because the entry is constructed for a built-in type. --- lib/IRGen/IRGenDebugInfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/IRGen/IRGenDebugInfo.cpp b/lib/IRGen/IRGenDebugInfo.cpp index 811b6ba5cec70..56b190dc89f50 100644 --- a/lib/IRGen/IRGenDebugInfo.cpp +++ b/lib/IRGen/IRGenDebugInfo.cpp @@ -1942,7 +1942,7 @@ class IRGenDebugInfoImpl : public IRGenDebugInfo { nullptr, PtrSize, 0, /* DWARFAddressSpace */ std::nullopt, MangledName); - return DBuilder.createObjectPointerType(PTy, /*Implicit=*/false); + return DBuilder.createObjectPointerType(PTy, /*Implicit=*/true); } case TypeKind::BuiltinExecutor: { return createDoublePointerSizedStruct( From 086688c21390b0b4428b9731da91cd86cfa0a796 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Fri, 6 Jun 2025 14:14:21 +0100 Subject: [PATCH 40/40] IRGen: Disable indirect symbol replacement with GOTPCREL for AArch64/ELF The linkers in our Linux environments do not support this option and fail to link the standard library. See: - https://github.com/swiftlang/llvm-project/pull/9339 - https://github.com/llvm/llvm-project/pull/78003 --- lib/IRGen/IRGen.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/IRGen/IRGen.cpp b/lib/IRGen/IRGen.cpp index b9580fba1f112..bdb1c456260cb 100644 --- a/lib/IRGen/IRGen.cpp +++ b/lib/IRGen/IRGen.cpp @@ -132,6 +132,9 @@ swift::getIRTargetOptions(const IRGenOptions &Opts, ASTContext &Ctx) { // FIXME: We should do this entirely through Clang, for consistency. TargetOptions TargetOpts; + // Linker support for this is not widespread enough. + TargetOpts.SupportIndirectSymViaGOTPCRel_AArch64_ELF = false; + // Explicitly request debugger tuning for LLDB which is the default // on Darwin platforms but not on others. TargetOpts.DebuggerTuning = llvm::DebuggerKind::LLDB;