Skip to content

Commit 51d8255

Browse files
authored
[msan] Handle Arm NEON saturating extract and narrow (llvm#125742)
This handles NEON saturating extract and narrow (Intrinsic::aarch64_neon_{sqxtn, sqxtun, uqxtn}) by (ab)using handleShadowOr() to perform the shadow cast. Previously, these were unknown intrinsics handled suboptimally by visitInstruction. Updates the tests from llvm#125288 and llvm#125140
1 parent 1b582ef commit 51d8255

File tree

3 files changed

+127
-324
lines changed

3 files changed

+127
-324
lines changed

llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4894,6 +4894,16 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
48944894
break;
48954895
}
48964896

4897+
// Saturating extract narrow
4898+
case Intrinsic::aarch64_neon_sqxtn:
4899+
case Intrinsic::aarch64_neon_sqxtun:
4900+
case Intrinsic::aarch64_neon_uqxtn:
4901+
// These only have one argument, but we (ab)use handleShadowOr because it
4902+
// does work on single argument intrinsics and will typecast the shadow
4903+
// (and update the origin).
4904+
handleShadowOr(I);
4905+
break;
4906+
48974907
case Intrinsic::aarch64_neon_st1x2:
48984908
case Intrinsic::aarch64_neon_st1x3:
48994909
case Intrinsic::aarch64_neon_st1x4:

0 commit comments

Comments
 (0)