[llvm] [msan] Fix shadow computation for partially undefined constant fixed-length vectors (PR #143837)
Thurston Dang via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 12 14:04:19 PDT 2025
================
@@ -2086,8 +2088,26 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
return ShadowPtr;
}
- // TODO: Partially undefined vectors are handled by the fall-through case
- // below (see partial-poison.ll); this causes false negatives.
+ // Check for partially undefined constant vectors
+ // TODO: scalable vectors (this is hard because we do not have IRBuilder)
+ if (isa<FixedVectorType>(V->getType()) && isa<Constant>(V) &&
+ (cast<Constant>(V))->containsUndefOrPoisonElement() &&
+ PropagateShadow && PoisonUndef) {
+ unsigned NumElems =
+ (cast<FixedVectorType>(V->getType()))->getNumElements();
+ SmallVector<Constant *, 32> ShadowVector(NumElems);
+ for (unsigned i = 0; i != NumElems; ++i) {
+ Constant *Elem = (cast<Constant>(V))->getAggregateElement(i);
----------------
thurstond wrote:
Removed
https://github.com/llvm/llvm-project/pull/143837
More information about the llvm-commits
mailing list