Skip to content

Commit

Permalink
[msan] Support NEON vector multiplication instructions (llvm#117944)
Browse files Browse the repository at this point in the history
Approximates the shadow propagation via OR'ing.

Updates the neon_vmul.ll test introduced in
llvm#117935
  • Loading branch information
thurstond authored Dec 9, 2024
1 parent e81130a commit 3b74abd
Show file tree
Hide file tree
Showing 2 changed files with 384 additions and 675 deletions.
15 changes: 15 additions & 0 deletions llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4026,6 +4026,11 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
setOriginForNaryOp(I);
}

// Approximation only
void handleNEONVectorMultiplyIntrinsic(IntrinsicInst &I) {
handleShadowOr(I);
}

void visitIntrinsicInst(IntrinsicInst &I) {
switch (I.getIntrinsicID()) {
case Intrinsic::uadd_with_overflow:
Expand Down Expand Up @@ -4429,6 +4434,16 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
break;
}

case Intrinsic::aarch64_neon_fmulx:
case Intrinsic::aarch64_neon_pmul:
case Intrinsic::aarch64_neon_pmull:
case Intrinsic::aarch64_neon_smull:
case Intrinsic::aarch64_neon_pmull64:
case Intrinsic::aarch64_neon_umull: {
handleNEONVectorMultiplyIntrinsic(I);
break;
}

default:
if (!handleUnknownIntrinsic(I))
visitInstruction(I);
Expand Down
Loading

0 comments on commit 3b74abd

Please sign in to comment.