diff options
author | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2013-01-25 15:35:29 +0000 |
---|---|---|
committer | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2013-01-25 15:35:29 +0000 |
commit | 94d1f5b10cbc65d12fc8eb46fd36a2f407cf4a35 (patch) | |
tree | 578d11dd096602b196047d3bbb250b230cff9c3a /lib/Transforms | |
parent | 351f65d9723c075af86466c07a0a3dc28be272cd (diff) |
[msan] A comment on ICmp handling logic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173453 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r-- | lib/Transforms/Instrumentation/MemorySanitizer.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Transforms/Instrumentation/MemorySanitizer.cpp b/lib/Transforms/Instrumentation/MemorySanitizer.cpp index 64882c284b..a329dcc6be 100644 --- a/lib/Transforms/Instrumentation/MemorySanitizer.cpp +++ b/lib/Transforms/Instrumentation/MemorySanitizer.cpp @@ -1211,6 +1211,9 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> { A = IRB.CreatePointerCast(A, Sa->getType()); B = IRB.CreatePointerCast(B, Sb->getType()); + // Let [a0, a1] be the interval of possible values of A, taking into account + // its undefined bits. Let [b0, b1] be the interval of possible values of B. + // Then (A cmp B) is defined iff (a0 cmp b1) == (a1 cmp b0). bool IsSigned = I.isSigned(); Value *S1 = IRB.CreateICmp(I.getPredicate(), getLowestPossibleValue(IRB, A, Sa, IsSigned), |