diff options
author | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2013-10-14 09:52:09 +0000 |
---|---|---|
committer | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2013-10-14 09:52:09 +0000 |
commit | a0f6d1651b08254982244e18afcdd513ca34a3ca (patch) | |
tree | 877837e5becf44ab7cde0f06a28da23243e70875 /lib/Transforms/Instrumentation/MemorySanitizer.cpp | |
parent | 55240a5ddbaebc44c9acb0353c18a394b06f348f (diff) | |
download | external_llvm-a0f6d1651b08254982244e18afcdd513ca34a3ca.zip external_llvm-a0f6d1651b08254982244e18afcdd513ca34a3ca.tar.gz external_llvm-a0f6d1651b08254982244e18afcdd513ca34a3ca.tar.bz2 |
[msan] Fix handling of scalar select of vectors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192575 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Instrumentation/MemorySanitizer.cpp')
-rw-r--r-- | lib/Transforms/Instrumentation/MemorySanitizer.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Transforms/Instrumentation/MemorySanitizer.cpp b/lib/Transforms/Instrumentation/MemorySanitizer.cpp index 65db206..f158cee 100644 --- a/lib/Transforms/Instrumentation/MemorySanitizer.cpp +++ b/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); |