Skip to content

Commit 847e959

Browse files
authored
Merge pull request #74064 from jckarter/ignore-tsan-markers-during-move-checking
MoveOnlyAddressChecker: Ignore tsan markers.
2 parents 025c976 + 291c60c commit 847e959

File tree

4 files changed

+11
-0
lines changed

4 files changed

+11
-0
lines changed

lib/SILOptimizer/Mandatory/MoveOnlyAddressCheckerUtils.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2144,6 +2144,13 @@ bool GatherUsesVisitor::visitUse(Operand *op) {
21442144
// Ignore end_access.
21452145
if (isa<EndAccessInst>(user))
21462146
return true;
2147+
2148+
// Ignore sanitizer markers.
2149+
if (auto bu = dyn_cast<BuiltinInst>(user)) {
2150+
if (bu->getBuiltinKind() == BuiltinValueKind::TSanInoutAccess) {
2151+
return true;
2152+
}
2153+
}
21472154

21482155
// This visitor looks through store_borrow instructions but does visit the
21492156
// end_borrow of the store_borrow. If we see such an end_borrow, register the

test/SILOptimizer/moveonly_addresschecker.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// RUN: %target-swift-emit-sil -sil-verify-all -verify -enable-experimental-feature NoImplicitCopy -enable-experimental-feature MoveOnlyClasses %s -Xllvm -sil-print-final-ossa-module | %FileCheck %s
22
// RUN: %target-swift-emit-sil -O -sil-verify-all -verify -enable-experimental-feature NoImplicitCopy -enable-experimental-feature MoveOnlyClasses %s
3+
// RUN: %target-swift-emit-sil -sanitize=thread -sil-verify-all -verify -enable-experimental-feature NoImplicitCopy -enable-experimental-feature MoveOnlyClasses %s -Xllvm -sil-print-final-ossa-module | %FileCheck %s
4+
// RUN: %target-swift-emit-sil -sanitize=thread -O -sil-verify-all -verify -enable-experimental-feature NoImplicitCopy -enable-experimental-feature MoveOnlyClasses %s
35

46
// This file contains tests that used to crash due to verifier errors. It must
57
// be separate from moveonly_addresschecker_diagnostics since when we fail on

test/SILOptimizer/moveonly_addresschecker_destructure_through_deinit_diagnostics.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// RUN: %target-swift-emit-sil -sil-verify-all -verify -enable-experimental-feature MoveOnlyClasses -enable-experimental-feature MoveOnlyTuples %s
2+
// RUN: %target-swift-emit-sil -sanitize=thread -sil-verify-all -verify -enable-experimental-feature MoveOnlyClasses -enable-experimental-feature MoveOnlyTuples %s
23

34
// This test validates that we properly emit errors if we partially invalidate
45
// through a type with a deinit.

test/SILOptimizer/moveonly_addresschecker_diagnostics.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// RUN: %target-swift-emit-sil %s -O -sil-verify-all -verify -enable-experimental-feature MoveOnlyPartialReinitialization -enable-experimental-feature NoImplicitCopy -enable-experimental-feature MoveOnlyClasses
2+
// RUN: %target-swift-emit-sil -sanitize=thread %s -O -sil-verify-all -verify -enable-experimental-feature MoveOnlyPartialReinitialization -enable-experimental-feature NoImplicitCopy -enable-experimental-feature MoveOnlyClasses
23

34
//////////////////
45
// Declarations //

0 commit comments

Comments
 (0)