Skip to content

Commit f93aba0

Browse files
committed
IRGen, LLVMPasses: Switch from obsoleted nocapture to captures(none)
Per 29441e4f5fa5f5c7709f7cf180815ba97f611297 (llvm-project).
1 parent 0d2d6cb commit f93aba0

File tree

96 files changed

+473
-459
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+473
-459
lines changed

lib/IRGen/CallEmission.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,12 @@ class CallEmission {
152152
WitnessMetadata *witnessMetadata);
153153
virtual Address getCalleeErrorSlot(SILType errorType, bool isCalleeAsync) = 0;
154154

155-
void addFnAttribute(llvm::Attribute::AttrKind Attr);
155+
void addFnAttribute(llvm::Attribute::AttrKind kind);
156156

157157
void setIndirectReturnAddress(Address addr) { indirectReturnAddress = addr; }
158158

159-
void addParamAttribute(unsigned ParamIndex, llvm::Attribute::AttrKind Attr);
159+
void addParamAttribute(unsigned paramIndex, llvm::Attribute::AttrKind kind);
160+
void addParamAttribute(unsigned paramIndex, llvm::Attribute attr);
160161

161162
void emitToMemory(Address addr, const LoadableTypeInfo &substResultTI,
162163
bool isOutlined);

lib/IRGen/GenCall.cpp

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ static void addIndirectValueParameterAttributes(IRGenModule &IGM,
317317
// Bitwise takable value types are guaranteed not to capture
318318
// a pointer into itself.
319319
if (!addressable && ti.isBitwiseTakable(ResilienceExpansion::Maximal))
320-
b.addAttribute(llvm::Attribute::NoCapture);
320+
b.addCapturesAttr(llvm::CaptureInfo::none());
321321
// The parameter must reference dereferenceable memory of the type.
322322
addDereferenceableAttributeToBuilder(IGM, b, ti);
323323

@@ -330,7 +330,7 @@ static void addPackParameterAttributes(IRGenModule &IGM,
330330
unsigned argIndex) {
331331
llvm::AttrBuilder b(IGM.getLLVMContext());
332332
// Pack parameter pointers can't alias.
333-
// Note: they are not marked `nocapture` as one
333+
// Note: they are not marked `captures(none)` as one
334334
// pack parameter could be a value type (e.g. a C++ type)
335335
// that captures its own pointer in itself.
336336
b.addAttribute(llvm::Attribute::NoAlias);
@@ -357,7 +357,7 @@ static void addInoutParameterAttributes(IRGenModule &IGM, SILType paramSILType,
357357
// Bitwise takable value types are guaranteed not to capture
358358
// a pointer into itself.
359359
if (!addressable && ti.isBitwiseTakable(ResilienceExpansion::Maximal))
360-
b.addAttribute(llvm::Attribute::NoCapture);
360+
b.addCapturesAttr(llvm::CaptureInfo::none());
361361
// The inout must reference dereferenceable memory of the type.
362362
addDereferenceableAttributeToBuilder(IGM, b, ti);
363363

@@ -411,7 +411,7 @@ static void addIndirectResultAttributes(IRGenModule &IGM,
411411
// Bitwise takable value types are guaranteed not to capture
412412
// a pointer into itself.
413413
if (typeInfo.isBitwiseTakable(ResilienceExpansion::Maximal))
414-
b.addAttribute(llvm::Attribute::NoCapture);
414+
b.addCapturesAttr(llvm::CaptureInfo::none());
415415
if (allowSRet) {
416416
assert(storageType);
417417
b.addStructRetAttr(storageType);
@@ -530,7 +530,7 @@ void IRGenModule::addSwiftErrorAttributes(llvm::AttributeList &attrs,
530530
// The error result should not be aliased, captured, or pointed at invalid
531531
// addresses regardless.
532532
b.addAttribute(llvm::Attribute::NoAlias);
533-
b.addAttribute(llvm::Attribute::NoCapture);
533+
b.addCapturesAttr(llvm::CaptureInfo::none());
534534
b.addDereferenceableAttr(getPointerSize().getValue());
535535

536536
attrs = attrs.addParamAttributes(this->getLLVMContext(), argIndex, b);
@@ -2854,7 +2854,9 @@ class SyncCallEmission final : public CallEmission {
28542854
}
28552855
}
28562856
Args[--LastArgWritten] = errorResultSlot.getAddress();
2857-
addParamAttribute(LastArgWritten, llvm::Attribute::NoCapture);
2857+
addParamAttribute(LastArgWritten, llvm::Attribute::getWithCaptureInfo(
2858+
IGF.IGM.getLLVMContext(),
2859+
llvm::CaptureInfo::none()));
28582860
IGF.IGM.addSwiftErrorAttributes(CurCallee.getMutableAttributes(),
28592861
LastArgWritten);
28602862

@@ -5577,14 +5579,20 @@ void CallEmission::setArgs(Explosion &adjusted, bool isOutlined,
55775579
}
55785580
}
55795581

5580-
void CallEmission::addFnAttribute(llvm::Attribute::AttrKind attr) {
5582+
void CallEmission::addFnAttribute(llvm::Attribute::AttrKind kind) {
55815583
assert(state == State::Emitting);
55825584
auto &attrs = CurCallee.getMutableAttributes();
5583-
attrs = attrs.addFnAttribute(IGF.IGM.getLLVMContext(), attr);
5585+
attrs = attrs.addFnAttribute(IGF.IGM.getLLVMContext(), kind);
55845586
}
55855587

55865588
void CallEmission::addParamAttribute(unsigned paramIndex,
5587-
llvm::Attribute::AttrKind attr) {
5589+
llvm::Attribute::AttrKind kind) {
5590+
addParamAttribute(paramIndex,
5591+
llvm::Attribute::get(IGF.IGM.getLLVMContext(), kind));
5592+
}
5593+
5594+
void CallEmission::addParamAttribute(unsigned paramIndex,
5595+
llvm::Attribute attr) {
55885596
assert(state == State::Emitting);
55895597
auto &attrs = CurCallee.getMutableAttributes();
55905598
attrs = attrs.addParamAttribute(IGF.IGM.getLLVMContext(), paramIndex, attr);

lib/LLVMPasses/ARCEntryPointBuilder.h

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,11 +252,16 @@ class ARCEntryPointBuilder {
252252

253253
auto *ObjectPtrTy = getObjectPtrTy();
254254
auto &M = getModule();
255-
auto AttrList = AttributeList::get(M.getContext(), 1, Attribute::NoCapture);
256-
AttrList = AttrList.addFnAttribute(M.getContext(), Attribute::NoUnwind);
255+
auto &C = M.getContext();
256+
257+
AttributeList AttrList;
258+
AttrList = AttrList.addFnAttribute(C, Attribute::NoUnwind);
259+
AttrList = AttrList.addParamAttribute(
260+
C, 0, Attribute::getWithCaptureInfo(C, llvm::CaptureInfo::none()));
261+
257262
CheckUnowned = cast<llvm::Function>(
258263
M.getOrInsertFunction("swift_checkUnowned", AttrList,
259-
Type::getVoidTy(M.getContext()), ObjectPtrTy)
264+
Type::getVoidTy(C), ObjectPtrTy)
260265
.getCallee());
261266
if (llvm::Triple(M.getTargetTriple()).isOSBinFormatCOFF() &&
262267
!llvm::Triple(M.getTargetTriple()).isOSCygMing())

test/AutoDiff/IRGen/differentiable_function.sil

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ bb0:
3333
return %result : $@differentiable(reverse) @callee_guaranteed (Float) -> Float
3434
}
3535

36-
// CHECK-LABEL: define{{.*}}test_form_diff_func(ptr noalias nocapture sret(<{ %swift.function, %swift.function, %swift.function }>)
36+
// CHECK-LABEL: define{{.*}}test_form_diff_func(ptr noalias captures(none) sret(<{ %swift.function, %swift.function, %swift.function }>)
3737
// CHECK-SAME: [[OUT:%.*]])
3838
// CHECK: [[OUT_ORIG:%.*]] = getelementptr{{.*}}[[OUT]], i32 0, i32 0
3939
// CHECK: [[OUT_ORIG_FN:%.*]] = getelementptr{{.*}}[[OUT_ORIG]], i32 0, i32 0
@@ -60,7 +60,7 @@ bb0(%0 : $@differentiable(reverse) @callee_guaranteed (Float) -> Float):
6060
return %result : $(@callee_guaranteed (Float) -> Float, @callee_guaranteed (Float) -> (Float, @owned @callee_guaranteed (Float) -> Float), @callee_guaranteed (Float) -> (Float, @owned @callee_guaranteed (Float) -> Float))
6161
}
6262

63-
// CHECK-LABEL: define{{.*}}@test_extract_components(ptr noalias nocapture sret(<{ %swift.function, %swift.function, %swift.function }>)
63+
// CHECK-LABEL: define{{.*}}@test_extract_components(ptr noalias captures(none) sret(<{ %swift.function, %swift.function, %swift.function }>)
6464
// CHECK-SAME: [[OUT:%.*]], ptr{{.*}}[[IN:%.*]])
6565
// CHECK: [[ORIG:%.*]] = getelementptr{{.*}}[[IN]], i32 0, i32 0
6666
// CHECK: [[ORIG_FN_ADDR:%.*]] = getelementptr{{.*}}[[ORIG]], i32 0, i32 0

test/DebugInfo/ErrorVar.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ func simple(_ placeholder: Int64) throws -> () {
1414
// CHECK: define {{.*}}void @"$s8ErrorVar6simpleyys5Int64VKF"(
1515
// CHECK-SAME: i64
1616
// CHECK-SAME: %swift.refcounted* {{.*}}swiftself
17-
// CHECK-SAME: %swift.error** noalias nocapture dereferenceable(4)
17+
// CHECK-SAME: %swift.error** noalias captures(none) dereferenceable(4)
1818
// CHECK: #dbg_declare
1919
// CHECK: #dbg_declare({{.*}}, ![[ERROR:[0-9]+]], !DIExpression(DW_OP_deref)
2020
// CHECK-DAG: ![[ERRTY:.*]] = !DICompositeType({{.*}}identifier: "$ss5Error_pD"

test/Distributed/distributed_actor_accessor_thunks_32bit.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public distributed actor MyOtherActor {
9494

9595
// CHECK: define hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC7simple1yySiYaKFTE"
9696

97-
// 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:%.*]])
97+
// 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:%.*]])
9898

9999
/// Read the current offset and cast an element to `Int`
100100

@@ -119,7 +119,7 @@ public distributed actor MyOtherActor {
119119
// CHECK: missing-witness1:
120120
// CHECK-NEXT: call void @llvm.trap()
121121
// CHECK-NEXT: unreachable
122-
// 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)
122+
// 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)
123123

124124
// CHECK: store %swift.error* null, %swift.error** %swifterror
125125
// CHECK-NEXT: [[ARG_0_VAL_ADDR:%.*]] = bitcast i8* [[ARG_0_VALUE_BUF]] to %TSi*
@@ -196,7 +196,7 @@ public distributed actor MyOtherActor {
196196
// CHECK: define hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC7simple3ySiSSYaKFTE"
197197

198198
/// !!! in `simple3` interesting bits are: argument value extraction (because string is exploded into N arguments) and call to distributed thunk
199-
// 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:%.*]])
199+
// 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:%.*]])
200200

201201

202202
// CHECK: [[TYPED_RESULT_BUFF:%.*]] = bitcast i8* [[RESULT_BUFF]] to %TSi*
@@ -260,7 +260,7 @@ public distributed actor MyOtherActor {
260260

261261
// CHECK: define hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC16single_case_enumyAA7SimpleEOAFYaKFTE"
262262

263-
// 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:%.*]])
263+
// 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:%.*]])
264264

265265
/// Let's check that the call doesn't have any arguments and returns nothing.
266266

@@ -307,7 +307,7 @@ public distributed actor MyOtherActor {
307307

308308
// CHECK: define hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC7complexyAA11LargeStructVSaySiG_AA3ObjCSSSgAFtYaKFTE"
309309

310-
// 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:%.*]])
310+
// 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:%.*]])
311311

312312
/// First, let's check that all of the different argument types here are loaded correctly.
313313

@@ -366,7 +366,7 @@ public distributed actor MyOtherActor {
366366

367367
/// ---> Accessor for `genericArgs`
368368

369-
// 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:%.*]])
369+
// 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:%.*]])
370370

371371
/// ---> Load `T`
372372

@@ -422,7 +422,7 @@ public distributed actor MyOtherActor {
422422

423423
/// Let's check that there is argument decoding since parameter list is empty
424424

425-
// 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:%.*]])
425+
// 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:%.*]])
426426
// CHECK-NEXT: entry:
427427
// CHECK-NEXT: {{.*}} = alloca %swift.context*
428428
// CHECK-NEXT: %swifterror = alloca %swift.error*

test/Distributed/distributed_actor_accessor_thunks_64bit.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public distributed actor MyOtherActor {
116116
// CHECK: missing-witness1:
117117
// CHECK-NEXT: call void @llvm.trap()
118118
// CHECK-NEXT: unreachable
119-
// 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)
119+
// 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)
120120

121121
// CHECK: store ptr null, ptr %swifterror
122122
// CHECK-NEXT: %._value = getelementptr inbounds %TSi, ptr [[ARG_0_VALUE_BUF]], i32 0, i32 0

test/IRGen/abi_v7k.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ func testRet3() -> MyRect2 {
296296
}
297297

298298
// Returning tuple?: (Int x 6)?
299-
// CHECK-LABEL: define hidden swiftcc void @"$s8test_v7k7minMax2{{.*}}"(ptr noalias nocapture sret({{.*}}) %0, i32 %1, i32 %2)
299+
// CHECK-LABEL: define hidden swiftcc void @"$s8test_v7k7minMax2{{.*}}"(ptr noalias captures(none) sret({{.*}}) %0, i32 %1, i32 %2)
300300
// V7K-LABEL: _$s8test_v7k7minMax2
301301
// We will indirectly return an optional with the address in r0, input parameters will be in r1 and r2
302302
// 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
324324
}
325325

326326
// Returning struct?: {Int x 6}?
327-
// CHECK-LABEL: define hidden swiftcc void @"$s8test_v7k7minMax3{{.*}}"(ptr noalias nocapture sret({{.*}}) %0, i32 %1, i32 %2)
327+
// CHECK-LABEL: define hidden swiftcc void @"$s8test_v7k7minMax3{{.*}}"(ptr noalias captures(none) sret({{.*}}) %0, i32 %1, i32 %2)
328328
// V7K-LABEL: _$s8test_v7k7minMax3
329329
struct Ret {
330330
var min:Int

0 commit comments

Comments
 (0)