summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
diff options
context:
space:
mode:
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>2013-10-14 09:52:09 +0000
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>2013-10-14 09:52:09 +0000
commit9b5517b127d990c1d00b7bf9f5ed41698dee9600 (patch)
treeb7b19819745a855c969f30ac2897ae0e651045e4 /llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
parentc7ae7529e7373cfc7db03fb9e330cc89c29bda47 (diff)
downloadbcm5719-llvm-9b5517b127d990c1d00b7bf9f5ed41698dee9600.tar.gz
bcm5719-llvm-9b5517b127d990c1d00b7bf9f5ed41698dee9600.zip
[msan] Fix handling of scalar select of vectors.
llvm-svn: 192575
Diffstat (limited to 'llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp')
-rw-r--r--llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp b/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
index 65db206e570..f158ceee1e8 100644
--- a/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
+++ b/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
@@ -1233,15 +1233,15 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
Value *CreateShadowCast(IRBuilder<> &IRB, Value *V, Type *dstTy) {
Type *srcTy = V->getType();
if (dstTy->isIntegerTy() && srcTy->isIntegerTy())
- return IRB.CreateIntCast(V, dstTy, false);
+ return IRB.CreateIntCast(V, dstTy, true);
if (dstTy->isVectorTy() && srcTy->isVectorTy() &&
dstTy->getVectorNumElements() == srcTy->getVectorNumElements())
- return IRB.CreateIntCast(V, dstTy, false);
+ return IRB.CreateIntCast(V, dstTy, true);
size_t srcSizeInBits = VectorOrPrimitiveTypeSizeInBits(srcTy);
size_t dstSizeInBits = VectorOrPrimitiveTypeSizeInBits(dstTy);
Value *V1 = IRB.CreateBitCast(V, Type::getIntNTy(*MS.C, srcSizeInBits));
Value *V2 =
- IRB.CreateIntCast(V1, Type::getIntNTy(*MS.C, dstSizeInBits), false);
+ IRB.CreateIntCast(V1, Type::getIntNTy(*MS.C, dstSizeInBits), true);
return IRB.CreateBitCast(V2, dstTy);
// TODO: handle struct types.
}
@@ -1899,7 +1899,7 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
} else {
// Sa = (sext Sb) | (select b, Sc, Sd)
S = IRB.CreateOr(
- S, IRB.CreateSExt(getShadow(I.getCondition()), S->getType()),
+ S, CreateShadowCast(IRB, getShadow(I.getCondition()), S->getType()),
"_msprop_select");
}
setShadow(&I, S);
OpenPOWER on IntegriCloud