summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
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
commit3838f279053d7351f7a5ee64eb94bcf2f2805de0 (patch)
treea695f3a6df50dc86c05bc92aa217bbedd02c128e /llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
parentcaf11af9d33e343156dda110f6b9397c2deb502c (diff)
downloadbcm5719-llvm-3838f279053d7351f7a5ee64eb94bcf2f2805de0.tar.gz
bcm5719-llvm-3838f279053d7351f7a5ee64eb94bcf2f2805de0.zip
[tsan] disable load widening in ThreadSanitizer mode
llvm-svn: 175034
Diffstat (limited to 'llvm/lib/Analysis/MemoryDependenceAnalysis.cpp')
-rw-r--r--llvm/lib/Analysis/MemoryDependenceAnalysis.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp b/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
index 5cb00168855..9a1edc763f1 100644
--- a/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
+++ b/llvm/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;
OpenPOWER on IntegriCloud