diff options
author | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2012-12-25 14:56:21 +0000 |
---|---|---|
committer | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2012-12-25 14:56:21 +0000 |
commit | 6607716368ba04454ff9ad62ac25936357d67c51 (patch) | |
tree | cd08a448ef8066db3fb3235e350885849923783b /lib | |
parent | 50ec431c9fafaf06a6dcfa8d9d298eda8cda6092 (diff) | |
download | external_llvm-6607716368ba04454ff9ad62ac25936357d67c51.zip external_llvm-6607716368ba04454ff9ad62ac25936357d67c51.tar.gz external_llvm-6607716368ba04454ff9ad62ac25936357d67c51.tar.bz2 |
[msan] Fix handling of select with vector condition.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171069 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Transforms/Instrumentation/MemorySanitizer.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/Transforms/Instrumentation/MemorySanitizer.cpp b/lib/Transforms/Instrumentation/MemorySanitizer.cpp index c151c3b..ba16e3d 100644 --- a/lib/Transforms/Instrumentation/MemorySanitizer.cpp +++ b/lib/Transforms/Instrumentation/MemorySanitizer.cpp @@ -1566,9 +1566,18 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> { setShadow(&I, IRB.CreateSelect(I.getCondition(), getShadow(I.getTrueValue()), getShadow(I.getFalseValue()), "_msprop")); - if (MS.TrackOrigins) - setOrigin(&I, IRB.CreateSelect(I.getCondition(), + if (MS.TrackOrigins) { + // Origins are always i32, so any vector conditions must be flattened. + // FIXME: consider tracking vector origins for app vectors? + Value *Cond = I.getCondition(); + if (Cond->getType()->isVectorTy()) { + Value *ConvertedShadow = convertToShadowTyNoVec(Cond, IRB); + Cond = IRB.CreateICmpNE(ConvertedShadow, + getCleanShadow(ConvertedShadow), "_mso_select"); + } + setOrigin(&I, IRB.CreateSelect(Cond, getOrigin(I.getTrueValue()), getOrigin(I.getFalseValue()))); + } } void visitLandingPadInst(LandingPadInst &I) { |