Skip to content

Commit 8c9d545

Browse files
authored
Merge pull request #73611 from eeckstein/fix-store-runtime-effects
SIL: fix runtime effects of initializing store
2 parents c20331b + fcc03b7 commit 8c9d545

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
@@ -781,9 +781,8 @@ RuntimeEffect swift::getRuntimeEffect(SILInstruction *inst, SILType &impactType)
781781
switch (cast<StoreInst>(inst)->getOwnershipQualifier()) {
782782
case StoreOwnershipQualifier::Unqualified:
783783
case StoreOwnershipQualifier::Trivial:
784-
return RuntimeEffect::NoEffect;
785784
case StoreOwnershipQualifier::Init:
786-
return RuntimeEffect::RefCounting;
785+
return RuntimeEffect::NoEffect;
787786
case StoreOwnershipQualifier::Assign:
788787
return RuntimeEffect::Releasing;
789788
}

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)