[llvm] [ASan][RISCV] Teach AddressSanitizer to support indexed load/store. (PR #160443)
Florian Mayer via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 26 10:28:21 PDT 2025
================
@@ -2774,6 +2774,40 @@ bool RISCVTTIImpl::getTgtMemIntrinsic(IntrinsicInst *Inst,
Alignment, Mask, EVL, Stride);
return true;
}
+ case Intrinsic::riscv_vloxei_mask:
+ case Intrinsic::riscv_vluxei_mask:
+ case Intrinsic::riscv_vsoxei_mask:
+ case Intrinsic::riscv_vsuxei_mask:
+ HasMask = true;
+ [[fallthrough]];
+ case Intrinsic::riscv_vloxei:
+ case Intrinsic::riscv_vluxei:
+ case Intrinsic::riscv_vsoxei:
+ case Intrinsic::riscv_vsuxei: {
+ // Intrinsic interface (only listed ordered version):
+ // riscv_vloxei(merge, ptr, index, vl)
+ // riscv_vloxei_mask(merge, ptr, index, mask, vl, policy)
+ // riscv_vsoxei(val, ptr, index, vl)
+ // riscv_vsoxei_mask(val, ptr, index, mask, vl, policy)
+ bool IsWrite = Inst->getType()->isVoidTy();
+ Type *Ty = IsWrite ? Inst->getArgOperand(0)->getType() : Inst->getType();
+ const auto *RVVIInfo = RISCVVIntrinsicsTable::getRISCVVIntrinsicInfo(IID);
+ unsigned VLIndex = RVVIInfo->VLOperand;
+ unsigned PtrOperandNo = VLIndex - 2 - HasMask;
+ Value *Mask;
+ if (HasMask) {
+ Mask = Inst->getArgOperand(VLIndex - 1);
+ } else {
+ Type *MaskType = Ty->getWithNewType(Type::getInt1Ty(C));
+ Mask = ConstantInt::getTrue(MaskType);
----------------
fmayer wrote:
Please add this into a comment.
https://github.com/llvm/llvm-project/pull/160443
More information about the llvm-commits
mailing list