aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Analysis
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2013-02-13 05:59:45 +0000
committerKostya Serebryany <kcc@google.com>2013-02-13 05:59:45 +0000
commit7bce462c15356229e13d78d14560feaac30a0f5f (patch)
tree4426fc08f412f83fd764e736500b7c694ca9b969 /lib/Analysis
parent39f02940ba085af79011f7e9095bf9902cd0fa6f (diff)
downloadexternal_llvm-7bce462c15356229e13d78d14560feaac30a0f5f.zip
external_llvm-7bce462c15356229e13d78d14560feaac30a0f5f.tar.gz
external_llvm-7bce462c15356229e13d78d14560feaac30a0f5f.tar.bz2
[tsan] disable load widening in ThreadSanitizer mode
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175034 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis')
-rw-r--r--lib/Analysis/MemoryDependenceAnalysis.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Analysis/MemoryDependenceAnalysis.cpp b/lib/Analysis/MemoryDependenceAnalysis.cpp
index 5cb0016..9a1edc7 100644
--- a/lib/Analysis/MemoryDependenceAnalysis.cpp
+++ b/lib/Analysis/MemoryDependenceAnalysis.cpp
@@ -283,6 +283,12 @@ getLoadLoadClobberFullWidthSize(const Value *MemLocBase, int64_t MemLocOffs,
const DataLayout &TD) {
// We can only extend simple integer loads.
if (!isa<IntegerType>(LI->getType()) || !LI->isSimple()) return 0;
+
+ // Load widening is hostile to ThreadSanitizer: it may cause false positives
+ // or make the reports more cryptic (access sizes are wrong).
+ if (LI->getParent()->getParent()->getAttributes().
+ hasAttribute(AttributeSet::FunctionIndex, Attribute::ThreadSafety))
+ return 0;
// Get the base of this load.
int64_t LIOffs = 0;