[msan] Relax handling of llvm.masked.expandload and llvm.masked.gather

This is work around for new false positives. Real implementation will
follow.
This commit is contained in:
Vitaly Buka 2022-09-10 12:09:51 -07:00
parent a931dbfbd3
commit 6fc31712f1
1 changed files with 20 additions and 0 deletions

View File

@ -3228,6 +3228,20 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
insertShadowCheck(Shadow, Origin, &I);
}
void handleMaskedExpandLoad(IntrinsicInst &I) {
// PassThru can be undef, so default visitInstruction is too strict.
// TODO: Provide real implementation.
setShadow(&I, getCleanShadow(&I));
setOrigin(&I, getCleanOrigin());
}
void handleMaskedGather(IntrinsicInst &I) {
// PassThru can be undef, so default visitInstruction is too strict.
// TODO: Provide real implementation.
setShadow(&I, getCleanShadow(&I));
setOrigin(&I, getCleanOrigin());
}
void handleMaskedStore(IntrinsicInst &I) {
IRBuilder<> IRB(&I);
Value *V = I.getArgOperand(0);
@ -3429,6 +3443,12 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
case Intrinsic::bswap:
handleBswap(I);
break;
case Intrinsic::masked_expandload:
handleMaskedExpandLoad(I);
break;
case Intrinsic::masked_gather:
handleMaskedGather(I);
break;
case Intrinsic::masked_store:
handleMaskedStore(I);
break;