[llvm] [msan] Support vst{2,3,4}_lane instructions (PR #101215)
Thurston Dang via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 9 10:16:24 PDT 2024
================
@@ -3873,38 +3873,49 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
setOriginForNaryOp(I);
}
- /// Handle Arm NEON vector store intrinsics (vst{2,3,4} and vst1x_{2,3,4}).
+ /// Handle Arm NEON vector store intrinsics (vst{2,3,4}, vst1x_{2,3,4},
+ /// and vst{2,3,4}lane).
///
/// Arm NEON vector store intrinsics have the output address (pointer) as the
- /// last argument, with the initial arguments being the inputs. They return
- /// void.
+ /// last argument, with the initial arguments being the inputs (and lane
+ /// number for vst{2,3,4}lane). They return void.
///
/// - st4 interleaves the output e.g., st4 (inA, inB, inC, inD, outP) writes
/// abcdabcdabcdabcd... into *outP
/// - st1_x4 is non-interleaved e.g., st1_x4 (inA, inB, inC, inD, outP)
/// writes aaaa...bbbb...cccc...dddd... into *outP
+ /// - st4lane has arguments of (inA, inB, inC, inD, lane, outP)
/// These instructions can all be instrumented with essentially the same
/// MSan logic, simply by applying the corresponding intrinsic to the shadow.
- void handleNEONVectorStoreIntrinsic(IntrinsicInst &I) {
+ void handleNEONVectorStoreIntrinsic(IntrinsicInst &I, bool useLane) {
IRBuilder<> IRB(&I);
// Don't use getNumOperands() because it includes the callee
int numArgOperands = I.arg_size();
- assert(numArgOperands >= 1);
- // The last arg operand is the output
+ // The last arg operand is the output (pointer)
+ assert(numArgOperands >= 1);
Value *Addr = I.getArgOperand(numArgOperands - 1);
assert(Addr->getType()->isPointerTy());
+ unsigned int skipTrailingOperands = 1;
----------------
thurstond wrote:
Done
https://github.com/llvm/llvm-project/pull/101215
More information about the llvm-commits
mailing list