[llvm] [msan] Add handleIntrinsicByApplyingToShadow; support NEON tbl/tbx (PR #114490)
Thurston Dang via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 1 12:56:55 PDT 2024
================
@@ -3944,6 +3944,45 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
}
}
+ /// Handle intrinsics by applying the intrinsic to the shadows. The trailing
+ /// arguments are passed verbatim e.g., for an intrinsic with one trailing
+ /// verbatim argument:
+ /// out = intrinsic(var1, var2, opType)
+ /// we compute:
+ /// shadow[out] = intrinsic(shadow[var1], shadow[var2], opType)
+ ///
+ /// For example, this can be applied to the Arm NEON vector table intrinsics
+ /// (tbl{1,2,3,4}).
+ ///
+ /// The origin is approximated using setOriginForNaryOp.
+ void handleIntrinsicByApplyingToShadow(IntrinsicInst &I,
+ unsigned int trailingVerbatimArgs) {
+ IRBuilder<> IRB(&I);
+
+ assert(trailingVerbatimArgs < I.arg_size());
+
+ SmallVector<Value *, 8> ShadowArgs;
+ // Don't use getNumOperands() because it includes the callee
+ for (unsigned int i = 0; i < I.arg_size(); i++) {
----------------
thurstond wrote:
Done
https://github.com/llvm/llvm-project/pull/114490
More information about the llvm-commits
mailing list