summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>2013-10-17 10:53:50 +0000
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>2013-10-17 10:53:50 +0000
commit21a9c93a4d1551474dd65c8da1c8fc3f2848455d (patch)
tree91a92dd7b0cd6af7c44de0b840447a23a224fbd1 /llvm/lib/Transforms
parent39f5d7d5f09ed2c6f362ed484110ac3deb2a400d (diff)
downloadbcm5719-llvm-21a9c93a4d1551474dd65c8da1c8fc3f2848455d.tar.gz
bcm5719-llvm-21a9c93a4d1551474dd65c8da1c8fc3f2848455d.zip
[msan] Use zero-extension in shadow cast by default.
Switch to sign-extension in r192575 caused 7% perf loss on 482.sphinx3. llvm-svn: 192882
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp b/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
index 88a8d415760..5ce88a9d895 100644
--- a/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
+++ b/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
@@ -1244,18 +1244,19 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
/// \brief Cast between two shadow types, extending or truncating as
/// necessary.
- Value *CreateShadowCast(IRBuilder<> &IRB, Value *V, Type *dstTy) {
+ Value *CreateShadowCast(IRBuilder<> &IRB, Value *V, Type *dstTy,
+ bool Signed = false) {
Type *srcTy = V->getType();
if (dstTy->isIntegerTy() && srcTy->isIntegerTy())
- return IRB.CreateIntCast(V, dstTy, true);
+ return IRB.CreateIntCast(V, dstTy, Signed);
if (dstTy->isVectorTy() && srcTy->isVectorTy() &&
dstTy->getVectorNumElements() == srcTy->getVectorNumElements())
- return IRB.CreateIntCast(V, dstTy, true);
+ return IRB.CreateIntCast(V, dstTy, Signed);
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), true);
+ IRB.CreateIntCast(V1, Type::getIntNTy(*MS.C, dstSizeInBits), Signed);
return IRB.CreateBitCast(V2, dstTy);
// TODO: handle struct types.
}
@@ -2019,9 +2020,9 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
"_msprop_select_agg");
} else {
// Sa = (sext Sb) | (select b, Sc, Sd)
- S = IRB.CreateOr(
- S, CreateShadowCast(IRB, getShadow(I.getCondition()), S->getType()),
- "_msprop_select");
+ S = IRB.CreateOr(S, CreateShadowCast(IRB, getShadow(I.getCondition()),
+ S->getType(), true),
+ "_msprop_select");
}
setShadow(&I, S);
if (MS.TrackOrigins) {
OpenPOWER on IntegriCloud