summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>2013-01-25 15:35:29 +0000
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>2013-01-25 15:35:29 +0000
commit2cb0fa10c2cbf617d680c6852417d5b9622c7606 (patch)
treef6bccf296451b9bf3034157bccefdc81a16d0f45 /llvm/lib/Transforms
parentfac8403249ff180c2d2566b5b6476d1e9d588a8b (diff)
downloadbcm5719-llvm-2cb0fa10c2cbf617d680c6852417d5b9622c7606.tar.gz
bcm5719-llvm-2cb0fa10c2cbf617d680c6852417d5b9622c7606.zip
[msan] A comment on ICmp handling logic.
llvm-svn: 173453
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp b/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
index 64882c284b3..a329dcc6bee 100644
--- a/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
+++ b/llvm/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),
OpenPOWER on IntegriCloud