diff options
author | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2013-01-28 11:42:28 +0000 |
---|---|---|
committer | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2013-01-28 11:42:28 +0000 |
commit | 647c66e24dc913db8e3e038d2fe6351bd98941a2 (patch) | |
tree | 18a9857e74d0c3b61edecccf3a2bc16add0773ed /lib/Transforms/Instrumentation | |
parent | ccfc295b9d8f895432910a140d20446b5bafc4c4 (diff) | |
download | external_llvm-647c66e24dc913db8e3e038d2fe6351bd98941a2.zip external_llvm-647c66e24dc913db8e3e038d2fe6351bd98941a2.tar.gz external_llvm-647c66e24dc913db8e3e038d2fe6351bd98941a2.tar.bz2 |
[msan] Mostly disable msan-handle-icmp-exact.
It is way too slow. Change the default option value to 0.
Always do exact shadow propagation for unsigned ICmp with constants, it is
cheap (under 1% cpu time) and required for correctness.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173682 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Instrumentation')
-rw-r--r-- | lib/Transforms/Instrumentation/MemorySanitizer.cpp | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/lib/Transforms/Instrumentation/MemorySanitizer.cpp b/lib/Transforms/Instrumentation/MemorySanitizer.cpp index a329dcc..714972e 100644 --- a/lib/Transforms/Instrumentation/MemorySanitizer.cpp +++ b/lib/Transforms/Instrumentation/MemorySanitizer.cpp @@ -129,7 +129,7 @@ static cl::opt<bool> ClHandleICmp("msan-handle-icmp", static cl::opt<bool> ClHandleICmpExact("msan-handle-icmp-exact", cl::desc("exact handling of relational integer ICmp"), - cl::Hidden, cl::init(true)); + cl::Hidden, cl::init(false)); static cl::opt<bool> ClStoreCleanOrigin("msan-store-clean-origin", cl::desc("store origin for clean (fully initialized) values"), @@ -1255,14 +1255,32 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> { } void visitICmpInst(ICmpInst &I) { - if (ClHandleICmp && I.isEquality()) + if (!ClHandleICmp) { + handleShadowOr(I); + return; + } + if (I.isEquality()) { handleEqualityComparison(I); - else if (ClHandleICmp && ClHandleICmpExact && I.isRelational()) + return; + } + + assert(I.isRelational()); + if (ClHandleICmpExact) { handleRelationalComparisonExact(I); - else if (ClHandleICmp && I.isSigned() && I.isRelational()) + return; + } + if (I.isSigned()) { handleSignedRelationalComparison(I); - else - handleShadowOr(I); + return; + } + + assert(I.isUnsigned()); + if ((isa<Constant>(I.getOperand(0)) || isa<Constant>(I.getOperand(1)))) { + handleRelationalComparisonExact(I); + return; + } + + handleShadowOr(I); } void visitFCmpInst(FCmpInst &I) { |