Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ struct SILMoveOnlyWrappedTypeEliminatorVisitor
NO_UPDATE_NEEDED(FixLifetime)
NO_UPDATE_NEEDED(AddressToPointer)
NO_UPDATE_NEEDED(ExistentialMetatype)
NO_UPDATE_NEEDED(Builtin)
#undef NO_UPDATE_NEEDED

bool eliminateIdentityCast(SingleValueInstruction *svi) {
Expand Down
14 changes: 14 additions & 0 deletions test/SILOptimizer/moveonly_type_eliminator.sil
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ class Klass {
func foo()
}

class C {}

struct KlassPair {
var lhs: Klass
var rhs: Klass
Expand Down Expand Up @@ -613,3 +615,15 @@ bb0(%x : @guaranteed $any Error):
debug_value %em : $@thick any Error.Type, var, name "s", argno 1, expr op_deref
return %em : $@thick any Error.Type
}

// CHECK-LABEL: sil [ossa] @builtin_tsanInoutAccess : {{.*}} {
// CHECK: builtin "tsanInoutAccess"
// CHECK-LABEL: } // end sil function 'builtin_tsanInoutAccess'
sil [ossa] @builtin_tsanInoutAccess : $@convention(thin) () -> () {
bb0:
%1 = alloc_stack $@moveOnly C, var, name "b", type $@moveOnly C
%6 = builtin "tsanInoutAccess"(%1 : $*@moveOnly C) : $()
dealloc_stack %1 : $*@moveOnly C
%13 = tuple ()
return %13 : $()
}
9 changes: 9 additions & 0 deletions validation-test/SILOptimizer/rdar133779160.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// RUN: %target-build-swift %s -sanitize=thread

// REQUIRES: tsan_runtime

class C {}
func passC(_ b: consuming C) {
mutateC(&b)
}
func mutateC(_ b: inout C) {}