Skip to content

Commit

Permalink
[msan] Relax handling of llvm.masked.expandload and llvm.masked.gather
Browse files Browse the repository at this point in the history
This is work around for new false positives. Real implementation will
follow.
  • Loading branch information
vitalybuka committed Sep 10, 2022
1 parent a931dbf commit 6fc3171
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 6fc3171

Please sign in to comment.