-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Revert "[TTI][ASan][RISCV] Move InterestingMemoryOperand to Analysis and embed in MemIntrinsicInfo" #159700
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
fmayer
merged 1 commit into
main
from
revert-157863-HankChang736/Enhance-getTgtMemIntrinsic-Asan
Sep 19, 2025
Merged
Revert "[TTI][ASan][RISCV] Move InterestingMemoryOperand to Analysis and embed in MemIntrinsicInfo" #159700
fmayer
merged 1 commit into
main
from
revert-157863-HankChang736/Enhance-getTgtMemIntrinsic-Asan
Sep 19, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…and embe…" This reverts commit f8b7f64.
@llvm/pr-subscribers-llvm-analysis @llvm/pr-subscribers-llvm-transforms Author: Florian Mayer (fmayer) ChangesReverts llvm/llvm-project#157863 Patch is 176.74 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/159700.diff 8 Files Affected:
diff --git a/llvm/include/llvm/Analysis/InterestingMemoryOperand.h b/llvm/include/llvm/Analysis/InterestingMemoryOperand.h
deleted file mode 100644
index 7a381554488db..0000000000000
--- a/llvm/include/llvm/Analysis/InterestingMemoryOperand.h
+++ /dev/null
@@ -1,55 +0,0 @@
-//===- InterestingMemoryOperand.h -------------------------------*- C++ -*-===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines InterestingMemoryOperand class that is used when getting
-// the information of a memory reference instruction.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_ANALYSIS_INTERESTINGMEMORYOPERAND_H
-#define LLVM_ANALYSIS_INTERESTINGMEMORYOPERAND_H
-
-#include "llvm/IR/DataLayout.h"
-#include "llvm/IR/Instruction.h"
-#include "llvm/Support/TypeSize.h"
-
-namespace llvm {
-class InterestingMemoryOperand {
-public:
- Use *PtrUse;
- bool IsWrite;
- Type *OpType;
- TypeSize TypeStoreSize = TypeSize::getFixed(0);
- MaybeAlign Alignment;
- // The mask Value, if we're looking at a masked load/store.
- Value *MaybeMask;
- // The EVL Value, if we're looking at a vp intrinsic.
- Value *MaybeEVL;
- // The Stride Value, if we're looking at a strided load/store.
- Value *MaybeStride;
-
- InterestingMemoryOperand(Instruction *I, unsigned OperandNo, bool IsWrite,
- class Type *OpType, MaybeAlign Alignment,
- Value *MaybeMask = nullptr,
- Value *MaybeEVL = nullptr,
- Value *MaybeStride = nullptr)
- : IsWrite(IsWrite), OpType(OpType), Alignment(Alignment),
- MaybeMask(MaybeMask), MaybeEVL(MaybeEVL), MaybeStride(MaybeStride) {
- const DataLayout &DL = I->getDataLayout();
- TypeStoreSize = DL.getTypeStoreSizeInBits(OpType);
- PtrUse = &I->getOperandUse(OperandNo);
- }
-
- Instruction *getInsn() { return cast<Instruction>(PtrUse->getUser()); }
-
- Value *getPtr() { return PtrUse->get(); }
-};
-
-} // namespace llvm
-
-#endif // LLVM_ANALYSIS_INTERESTINGMEMORYOPERAND_H
diff --git a/llvm/include/llvm/Analysis/TargetTransformInfo.h b/llvm/include/llvm/Analysis/TargetTransformInfo.h
index 7a4abe9ee5082..41ff54f0781a2 100644
--- a/llvm/include/llvm/Analysis/TargetTransformInfo.h
+++ b/llvm/include/llvm/Analysis/TargetTransformInfo.h
@@ -25,7 +25,6 @@
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/BitmaskEnum.h"
#include "llvm/Analysis/IVDescriptors.h"
-#include "llvm/Analysis/InterestingMemoryOperand.h"
#include "llvm/IR/FMF.h"
#include "llvm/IR/InstrTypes.h"
#include "llvm/IR/PassManager.h"
@@ -89,8 +88,6 @@ struct MemIntrinsicInfo {
bool WriteMem = false;
bool IsVolatile = false;
- SmallVector<InterestingMemoryOperand, 1> InterestingOperands;
-
bool isUnordered() const {
return (Ordering == AtomicOrdering::NotAtomic ||
Ordering == AtomicOrdering::Unordered) &&
diff --git a/llvm/include/llvm/Transforms/Instrumentation/AddressSanitizerCommon.h b/llvm/include/llvm/Transforms/Instrumentation/AddressSanitizerCommon.h
index 6d2def3d2b72d..4e0e9010b42f0 100644
--- a/llvm/include/llvm/Transforms/Instrumentation/AddressSanitizerCommon.h
+++ b/llvm/include/llvm/Transforms/Instrumentation/AddressSanitizerCommon.h
@@ -14,7 +14,6 @@
#define LLVM_TRANSFORMS_INSTRUMENTATION_ADDRESSSANITIZERCOMMON_H
#include "llvm/Analysis/CFG.h"
-#include "llvm/Analysis/InterestingMemoryOperand.h"
#include "llvm/Analysis/PostDominators.h"
#include "llvm/IR/Dominators.h"
#include "llvm/IR/Instruction.h"
@@ -22,6 +21,38 @@
#include "llvm/IR/Module.h"
namespace llvm {
+
+class InterestingMemoryOperand {
+public:
+ Use *PtrUse;
+ bool IsWrite;
+ Type *OpType;
+ TypeSize TypeStoreSize = TypeSize::getFixed(0);
+ MaybeAlign Alignment;
+ // The mask Value, if we're looking at a masked load/store.
+ Value *MaybeMask;
+ // The EVL Value, if we're looking at a vp intrinsic.
+ Value *MaybeEVL;
+ // The Stride Value, if we're looking at a strided load/store.
+ Value *MaybeStride;
+
+ InterestingMemoryOperand(Instruction *I, unsigned OperandNo, bool IsWrite,
+ class Type *OpType, MaybeAlign Alignment,
+ Value *MaybeMask = nullptr,
+ Value *MaybeEVL = nullptr,
+ Value *MaybeStride = nullptr)
+ : IsWrite(IsWrite), OpType(OpType), Alignment(Alignment),
+ MaybeMask(MaybeMask), MaybeEVL(MaybeEVL), MaybeStride(MaybeStride) {
+ const DataLayout &DL = I->getDataLayout();
+ TypeStoreSize = DL.getTypeStoreSizeInBits(OpType);
+ PtrUse = &I->getOperandUse(OperandNo);
+ }
+
+ Instruction *getInsn() { return cast<Instruction>(PtrUse->getUser()); }
+
+ Value *getPtr() { return PtrUse->get(); }
+};
+
// Get AddressSanitizer parameters.
void getAddressSanitizerParams(const Triple &TargetTriple, int LongSize,
bool IsKasan, uint64_t *ShadowBase,
diff --git a/llvm/lib/Analysis/TargetTransformInfo.cpp b/llvm/lib/Analysis/TargetTransformInfo.cpp
index bf62623099a97..09b50c5270e57 100644
--- a/llvm/lib/Analysis/TargetTransformInfo.cpp
+++ b/llvm/lib/Analysis/TargetTransformInfo.cpp
@@ -7,7 +7,6 @@
//===----------------------------------------------------------------------===//
#include "llvm/Analysis/TargetTransformInfo.h"
-#include "llvm/ADT/SmallVector.h"
#include "llvm/Analysis/CFG.h"
#include "llvm/Analysis/LoopIterator.h"
#include "llvm/Analysis/TargetLibraryInfo.h"
diff --git a/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp b/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp
index 72a35ee2bc309..a06faa414a2ef 100644
--- a/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp
+++ b/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp
@@ -15,7 +15,6 @@
#include "llvm/CodeGen/TargetLowering.h"
#include "llvm/CodeGen/ValueTypes.h"
#include "llvm/IR/Instructions.h"
-#include "llvm/IR/IntrinsicsRISCV.h"
#include "llvm/IR/PatternMatch.h"
#include <cmath>
#include <optional>
@@ -2702,82 +2701,6 @@ void RISCVTTIImpl::getPeelingPreferences(Loop *L, ScalarEvolution &SE,
BaseT::getPeelingPreferences(L, SE, PP);
}
-bool RISCVTTIImpl::getTgtMemIntrinsic(IntrinsicInst *Inst,
- MemIntrinsicInfo &Info) const {
- const DataLayout &DL = getDataLayout();
- Intrinsic::ID IID = Inst->getIntrinsicID();
- LLVMContext &C = Inst->getContext();
- bool HasMask = false;
- switch (IID) {
- case Intrinsic::riscv_vle_mask:
- case Intrinsic::riscv_vse_mask:
- HasMask = true;
- [[fallthrough]];
- case Intrinsic::riscv_vle:
- case Intrinsic::riscv_vse: {
- // Intrinsic interface:
- // riscv_vle(merge, ptr, vl)
- // riscv_vle_mask(merge, ptr, mask, vl, policy)
- // riscv_vse(val, ptr, vl)
- // riscv_vse_mask(val, ptr, 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 - 1 - HasMask;
- MaybeAlign Alignment =
- Inst->getArgOperand(PtrOperandNo)->getPointerAlignment(DL);
- Type *MaskType = Ty->getWithNewType(Type::getInt1Ty(C));
- Value *Mask = ConstantInt::getTrue(MaskType);
- if (HasMask)
- Mask = Inst->getArgOperand(VLIndex - 1);
- Value *EVL = Inst->getArgOperand(VLIndex);
- Info.InterestingOperands.emplace_back(Inst, PtrOperandNo, IsWrite, Ty,
- Alignment, Mask, EVL);
- return true;
- }
- case Intrinsic::riscv_vlse_mask:
- case Intrinsic::riscv_vsse_mask:
- HasMask = true;
- [[fallthrough]];
- case Intrinsic::riscv_vlse:
- case Intrinsic::riscv_vsse: {
- // Intrinsic interface:
- // riscv_vlse(merge, ptr, stride, vl)
- // riscv_vlse_mask(merge, ptr, stride, mask, vl, policy)
- // riscv_vsse(val, ptr, stride, vl)
- // riscv_vsse_mask(val, ptr, stride, 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;
- MaybeAlign Alignment =
- Inst->getArgOperand(PtrOperandNo)->getPointerAlignment(DL);
-
- Value *Stride = Inst->getArgOperand(PtrOperandNo + 1);
- // Use the pointer alignment as the element alignment if the stride is a
- // multiple of the pointer alignment. Otherwise, the element alignment
- // should be the greatest common divisor of pointer alignment and stride.
- // For simplicity, just consider unalignment for elements.
- unsigned PointerAlign = Alignment.valueOrOne().value();
- if (!isa<ConstantInt>(Stride) ||
- cast<ConstantInt>(Stride)->getZExtValue() % PointerAlign != 0)
- Alignment = Align(1);
-
- Type *MaskType = Ty->getWithNewType(Type::getInt1Ty(C));
- Value *Mask = ConstantInt::getTrue(MaskType);
- if (HasMask)
- Mask = Inst->getArgOperand(VLIndex - 1);
- Value *EVL = Inst->getArgOperand(VLIndex);
- Info.InterestingOperands.emplace_back(Inst, PtrOperandNo, IsWrite, Ty,
- Alignment, Mask, EVL, Stride);
- return true;
- }
- }
- return false;
-}
-
unsigned RISCVTTIImpl::getRegUsageForType(Type *Ty) const {
if (Ty->isVectorTy()) {
// f16 with only zvfhmin and bf16 will be promoted to f32
diff --git a/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.h b/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.h
index 6886e8964e29e..47e0a250d285a 100644
--- a/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.h
+++ b/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.h
@@ -160,9 +160,6 @@ class RISCVTTIImpl final : public BasicTTIImplBase<RISCVTTIImpl> {
void getPeelingPreferences(Loop *L, ScalarEvolution &SE,
TTI::PeelingPreferences &PP) const override;
- bool getTgtMemIntrinsic(IntrinsicInst *Inst,
- MemIntrinsicInfo &Info) const override;
-
unsigned getMinVectorRegisterBitWidth() const override {
return ST->useRVVForFixedLengthVectors() ? 16 : 0;
}
diff --git a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
index a20e0dec8841b..42c3d4a4f4c46 100644
--- a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
+++ b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
@@ -29,7 +29,6 @@
#include "llvm/Analysis/MemoryBuiltins.h"
#include "llvm/Analysis/StackSafetyAnalysis.h"
#include "llvm/Analysis/TargetLibraryInfo.h"
-#include "llvm/Analysis/TargetTransformInfo.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/BinaryFormat/MachO.h"
#include "llvm/Demangle/Demangle.h"
@@ -804,8 +803,7 @@ struct AddressSanitizer {
bool ignoreAccess(Instruction *Inst, Value *Ptr);
void getInterestingMemoryOperands(
- Instruction *I, SmallVectorImpl<InterestingMemoryOperand> &Interesting,
- const TargetTransformInfo *TTI);
+ Instruction *I, SmallVectorImpl<InterestingMemoryOperand> &Interesting);
void instrumentMop(ObjectSizeOffsetVisitor &ObjSizeVis,
InterestingMemoryOperand &O, bool UseCalls,
@@ -845,8 +843,7 @@ struct AddressSanitizer {
void instrumentMemIntrinsic(MemIntrinsic *MI, RuntimeCallInserter &RTCI);
Value *memToShadow(Value *Shadow, IRBuilder<> &IRB);
bool suppressInstrumentationSiteForDebug(int &Instrumented);
- bool instrumentFunction(Function &F, const TargetLibraryInfo *TLI,
- const TargetTransformInfo *TTI);
+ bool instrumentFunction(Function &F, const TargetLibraryInfo *TLI);
bool maybeInsertAsanInitAtFunctionEntry(Function &F);
bool maybeInsertDynamicShadowAtFunctionEntry(Function &F);
void markEscapedLocalAllocas(Function &F);
@@ -1317,8 +1314,7 @@ PreservedAnalyses AddressSanitizerPass::run(Module &M,
Options.MaxInlinePoisoningSize, Options.CompileKernel, Options.Recover,
Options.UseAfterScope, Options.UseAfterReturn);
const TargetLibraryInfo &TLI = FAM.getResult<TargetLibraryAnalysis>(F);
- const TargetTransformInfo &TTI = FAM.getResult<TargetIRAnalysis>(F);
- Modified |= FunctionSanitizer.instrumentFunction(F, &TLI, &TTI);
+ Modified |= FunctionSanitizer.instrumentFunction(F, &TLI);
}
Modified |= ModuleSanitizer.instrumentModule();
if (!Modified)
@@ -1456,8 +1452,7 @@ bool AddressSanitizer::ignoreAccess(Instruction *Inst, Value *Ptr) {
}
void AddressSanitizer::getInterestingMemoryOperands(
- Instruction *I, SmallVectorImpl<InterestingMemoryOperand> &Interesting,
- const TargetTransformInfo *TTI) {
+ Instruction *I, SmallVectorImpl<InterestingMemoryOperand> &Interesting) {
// Do not instrument the load fetching the dynamic shadow address.
if (LocalDynamicShadow == I)
return;
@@ -1575,12 +1570,6 @@ void AddressSanitizer::getInterestingMemoryOperands(
break;
}
default:
- if (auto *II = dyn_cast<IntrinsicInst>(I)) {
- MemIntrinsicInfo IntrInfo;
- if (TTI->getTgtMemIntrinsic(II, IntrInfo))
- Interesting = IntrInfo.InterestingOperands;
- return;
- }
for (unsigned ArgNo = 0; ArgNo < CI->arg_size(); ArgNo++) {
if (!ClInstrumentByval || !CI->isByValArgument(ArgNo) ||
ignoreAccess(I, CI->getArgOperand(ArgNo)))
@@ -2996,8 +2985,7 @@ bool AddressSanitizer::suppressInstrumentationSiteForDebug(int &Instrumented) {
}
bool AddressSanitizer::instrumentFunction(Function &F,
- const TargetLibraryInfo *TLI,
- const TargetTransformInfo *TTI) {
+ const TargetLibraryInfo *TLI) {
bool FunctionModified = false;
// Do not apply any instrumentation for naked functions.
@@ -3050,7 +3038,7 @@ bool AddressSanitizer::instrumentFunction(Function &F,
if (Inst.hasMetadata(LLVMContext::MD_nosanitize))
continue;
SmallVector<InterestingMemoryOperand, 1> InterestingOperands;
- getInterestingMemoryOperands(&Inst, InterestingOperands, TTI);
+ getInterestingMemoryOperands(&Inst, InterestingOperands);
if (!InterestingOperands.empty()) {
for (auto &Operand : InterestingOperands) {
diff --git a/llvm/test/Instrumentation/AddressSanitizer/RISCV/asan-rvv-intrinsics.ll b/llvm/test/Instrumentation/AddressSanitizer/RISCV/asan-rvv-intrinsics.ll
deleted file mode 100644
index 34b88daca4025..0000000000000
--- a/llvm/test/Instrumentation/AddressSanitizer/RISCV/asan-rvv-intrinsics.ll
+++ /dev/null
@@ -1,2304 +0,0 @@
-; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
-; RUN: opt < %s -mtriple=riscv64 -mattr=+v -passes=asan \
-; RUN: -asan-instrumentation-with-call-threshold=0 -S | FileCheck %s
-
-declare <vscale x 1 x i32> @llvm.riscv.vle.nxv1i32(
- <vscale x 1 x i32>,
- <vscale x 1 x i32>*,
- i64)
-define <vscale x 1 x i32> @intrinsic_vle_v_nxv1i32_nxv1i32(<vscale x 1 x i32>* align 4 %0, i64 %1) sanitize_address {
-; CHECK-LABEL: @intrinsic_vle_v_nxv1i32_nxv1i32(
-; CHECK-NEXT: entry:
-; CHECK-NEXT: [[TMP2:%.*]] = load i64, ptr @__asan_shadow_memory_dynamic_address, align 8
-; CHECK-NEXT: [[TMP3:%.*]] = icmp ne i64 [[TMP1:%.*]], 0
-; CHECK-NEXT: br i1 [[TMP3]], label [[TMP4:%.*]], label [[TMP12:%.*]]
-; CHECK: 4:
-; CHECK-NEXT: [[TMP5:%.*]] = call i64 @llvm.vscale.i64()
-; CHECK-NEXT: [[TMP6:%.*]] = call i64 @llvm.umin.i64(i64 [[TMP1]], i64 [[TMP5]])
-; CHECK-NEXT: br label [[DOTSPLIT:%.*]]
-; CHECK: .split:
-; CHECK-NEXT: [[IV:%.*]] = phi i64 [ 0, [[TMP4]] ], [ [[IV_NEXT:%.*]], [[TMP11:%.*]] ]
-; CHECK-NEXT: [[TMP7:%.*]] = extractelement <vscale x 1 x i1> splat (i1 true), i64 [[IV]]
-; CHECK-NEXT: br i1 [[TMP7]], label [[TMP8:%.*]], label [[TMP11]]
-; CHECK: 8:
-; CHECK-NEXT: [[TMP9:%.*]] = getelementptr <vscale x 1 x i32>, ptr [[TMP0:%.*]], i64 0, i64 [[IV]]
-; CHECK-NEXT: [[TMP10:%.*]] = ptrtoint ptr [[TMP9]] to i64
-; CHECK-NEXT: call void @__asan_load4(i64 [[TMP10]])
-; CHECK-NEXT: br label [[TMP11]]
-; CHECK: 11:
-; CHECK-NEXT: [[IV_NEXT]] = add nuw nsw i64 [[IV]], 1
-; CHECK-NEXT: [[IV_CHECK:%.*]] = icmp eq i64 [[IV_NEXT]], [[TMP6]]
-; CHECK-NEXT: br i1 [[IV_CHECK]], label [[DOTSPLIT_SPLIT:%.*]], label [[DOTSPLIT]]
-; CHECK: .split.split:
-; CHECK-NEXT: br label [[TMP12]]
-; CHECK: 12:
-; CHECK-NEXT: [[A:%.*]] = call <vscale x 1 x i32> @llvm.riscv.vle.nxv1i32.p0.i64(<vscale x 1 x i32> undef, ptr [[TMP0]], i64 [[TMP1]])
-; CHECK-NEXT: ret <vscale x 1 x i32> [[A]]
-;
-entry:
- %a = call <vscale x 1 x i32> @llvm.riscv.vle.nxv1i32(
- <vscale x 1 x i32> undef,
- <vscale x 1 x i32>* %0,
- i64 %1)
- ret <vscale x 1 x i32> %a
-}
-
-declare <vscale x 1 x i32> @llvm.riscv.vle.mask.nxv1i32(
- <vscale x 1 x i32>,
- <vscale x 1 x i32>*,
- <vscale x 1 x i1>,
- i64,
- i64)
-define <vscale x 1 x i32> @intrinsic_vle_mask_v_nxv1i32_nxv1i32(<vscale x 1 x i32> %0, <vscale x 1 x i32>* align 4 %1, <vscale x 1 x i1> %2, i64 %3) sanitize_address {
-; CHECK-LABEL: @intrinsic_vle_mask_v_nxv1i32_nxv1i32(
-; CHECK-NEXT: entry:
-; CHECK-NEXT: [[TMP4:%.*]] = load i64, ptr @__asan_shadow_memory_dynamic_address, align 8
-; CHECK-NEXT: [[TMP5:%.*]] = icmp ne i64 [[TMP3:%.*]], 0
-; CHECK-NEXT: br i1 [[TMP5]], label [[TMP6:%.*]], label [[TMP14:%.*]]
-; CHECK: 6:
-; CHECK-NEXT: [[TMP7:%.*]] = call i64 @llvm.vscale.i64()
-; CHECK-NEXT: [[TMP8:%.*]] = call i64 @llvm.umin.i64(i64 [[TMP3]], i64 [[TMP7]])
-; CHECK-NEXT: br label [[DOTSPLIT:%.*]]
-; CHECK: .split:
-; CHECK-NEXT: [[IV:%.*]] = phi i64 [ 0, [[TMP6]] ], [ [[IV_NEXT:%.*]], [[TMP13:%.*]] ]
-; CHECK-NEXT: [[TMP9:%.*]] = extractelement <vscale x 1 x i1> [[TMP2:%.*]], i64 [[IV]]
-; CHECK-NEXT: br i1 [[TMP9]], label [[TMP10:%.*]], label [[TMP13]]
-; CHECK: 10:
-; CHECK-NEXT: [[TMP11:%.*]] = getelementptr <vscale x 1 x i32>, ptr [[TMP1:%.*]], i64 0, i64 [[IV]]
-; CHECK-NEXT: [[TMP12:%.*]] = ptrtoint ptr [[TMP11]] to i64
-; CHECK-NEXT: call void @__asan_load4(i64 [[TMP12]])
-; CHECK-NEXT: br label [[TMP13]]
-; CHECK: 13:
-; CHECK-NEXT: [[IV_NEXT]] = add nuw nsw i64 [[IV]], 1
-; CHECK-NEXT: [[IV_CHECK:%.*]] = icmp eq i64 [[IV_NEXT]], [[TMP8]]
-; CHECK-NEXT: br i1 [[IV_CHECK]], label [[DOTSPLIT_SPLIT:%.*]], label [[DOTSPLIT]]
-; CHECK: .split.split:
-; CHECK-NEXT: br label [[TMP14]]
-; CHECK: 14:
-; CHECK-NEXT: [[A:%.*]] = call <vscale x 1 x i32> @llvm.riscv.vle.mask.nxv1i32.p0.i64(<vscale x 1 x i32> [[TMP0:%.*]], ptr [[TMP1]], <vscale x 1 x i1> [[TMP2]], i64 [[TMP3]], i64 1)
-; CHECK-NEXT: ret <vscale x 1 x i32> [[A]]
-;
-entry:
- %a = call <vscale x 1 x i32> @llvm.riscv.vle.mask.nxv1i32(
- <vscale x 1 x i32> %0,
- <vscale x 1 x i32>* %1,
- <vscale x 1 x i1> %2,
- i64 %3, i64 1)
- ret <vscale x 1 x i32> %a
-}
-
-declare void @llvm.riscv.vse.nxv1i32(
- <vscale x 1 x i32>,
- <vscale x 1 x i32>*,
- i64)
-define void @intrinsic_vse_v_nxv1i32_nxv1i32(<vscale x 1 x i32> %0, <vscale x 1 x i32>* align 4 %1, i64 %2) sanitize_address {
-; CHECK-LABEL: @intrinsic_vse_v_nxv1i32_nxv1i32(
-; CHECK-NEXT: entry:
-; CHECK-NEXT: [[TMP3:%.*]] = load i64, ptr @__asan_shadow_memory_dynamic_address, align 8
-; CHECK-NEXT: [[TMP4:%.*]] = icmp ne i64 [[TMP2:%.*]], 0
-; CHECK-NEXT: br i1 [[TMP4]], label [[TMP5:%.*]], label [[TMP13:%.*]]
-; CHECK: 5:
-; CHECK-NEXT: [[TMP6:%.*]] = call i64 @llvm.vscale.i64()
-; CHECK-NEXT: [[TMP7:%.*]] = call i64 @llvm.umin.i64(i64 [[TMP2]], i64 [[TMP6]])
-; CHECK-NEXT: br label [[DOTSPLIT:%.*]]
-; CHECK: .split:
-; CHECK-NEXT: [[IV:%.*]] = phi i64 [ 0, [[TMP5]] ], [ [[IV_NEXT:%.*]], [[TMP12:%.*]] ]
-; CHECK-NEXT: [[TMP8:%.*]] = extractelement <vscale x 1 x i1> splat (i1 true), i64 [[IV]]
-; CHECK-NEXT: br i1 [[TMP8]], label [[TMP9:%.*]], label [[TMP12]]
-; CHECK: 9:
-; CHECK-NEXT: [[TMP10:...
[truncated]
|
I fixed it and create another pr #159713. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
backend:RISC-V
compiler-rt:sanitizer
llvm:analysis
Includes value tracking, cost tables and constant folding
llvm:transforms
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Reverts #157863