Skip to content

Commit 6171c55

Browse files
authored
Merge pull request #73637 from eeckstein/fix-store-runtime-effects-6.0
[6.0] SIL: fix runtime effects of initializing store
2 parents bd41510 + aa76a68 commit 6171c55

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

lib/SIL/Utils/InstructionUtils.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -780,9 +780,8 @@ RuntimeEffect swift::getRuntimeEffect(SILInstruction *inst, SILType &impactType)
780780
switch (cast<StoreInst>(inst)->getOwnershipQualifier()) {
781781
case StoreOwnershipQualifier::Unqualified:
782782
case StoreOwnershipQualifier::Trivial:
783-
return RuntimeEffect::NoEffect;
784783
case StoreOwnershipQualifier::Init:
785-
return RuntimeEffect::RefCounting;
784+
return RuntimeEffect::NoEffect;
786785
case StoreOwnershipQualifier::Assign:
787786
return RuntimeEffect::Releasing;
788787
}

test/SILOptimizer/performance-annotations.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,3 +505,12 @@ func testLargeTuple() {
505505
_ = GenericStruct<SixInt8s>()
506506
}
507507

508+
struct NonCopyableStruct: ~Copyable {
509+
func foo() {}
510+
}
511+
512+
@_noLocks
513+
func testNonCopyable() {
514+
let t = NonCopyableStruct()
515+
t.foo()
516+
}

0 commit comments

Comments
 (0)