File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change 21
21
#include " swift/SIL/ApplySite.h"
22
22
#include " swift/SIL/DynamicCasts.h"
23
23
#include " swift/SIL/FormalLinkage.h"
24
+ #include " swift/SIL/InstructionUtils.h"
24
25
#include " swift/SIL/SILBuilder.h"
25
26
#include " swift/SIL/SILConstants.h"
26
27
#include " swift/SILOptimizer/Utils/Devirtualize.h"
@@ -1718,7 +1719,9 @@ ConstExprFunctionState::evaluateFlowSensitive(SILInstruction *inst) {
1718
1719
isa<DestroyAddrInst>(inst) || isa<RetainValueInst>(inst) ||
1719
1720
isa<ReleaseValueInst>(inst) || isa<StrongRetainInst>(inst) ||
1720
1721
isa<StrongReleaseInst>(inst) || isa<DestroyValueInst>(inst) ||
1721
- isa<EndBorrowInst>(inst))
1722
+ isa<EndBorrowInst>(inst) ||
1723
+ // Skip sanitizer instrumentation
1724
+ isSanitizerInstrumentation (inst))
1722
1725
return None;
1723
1726
1724
1727
// If this is a special flow-sensitive instruction like a stack allocation,
Original file line number Diff line number Diff line change @@ -1531,3 +1531,16 @@ bb0:
1531
1531
dealloc_stack %2 : $*UInt64
1532
1532
return %5 : $String
1533
1533
} // CHECK: Returns string: "18446744073709551615"
1534
+
1535
+ // CHECK-LABEL: @interpretTsanInstrumentationSkip
1536
+ sil [ossa] @interpretTsanInstrumentationSkip : $@convention(thin) () -> Builtin.Int32 {
1537
+ bb0:
1538
+ %0 = integer_literal $Builtin.Int32, 23
1539
+ %1 = alloc_stack $Builtin.Int32
1540
+ store %0 to [trivial] %1 : $*Builtin.Int32
1541
+ // This builtin should be skipped and should not affect the value of the argument
1542
+ %2 = builtin "tsanInoutAccess"(%1 : $*Builtin.Int32) : $()
1543
+ %3 = load [trivial] %1 : $*Builtin.Int32
1544
+ dealloc_stack %1 : $*Builtin.Int32
1545
+ return %3 : $Builtin.Int32
1546
+ } // CHECK: Returns int: 23
You can’t perform that action at this time.
0 commit comments