Skip to content

Commit 2be906b

Browse files
committed
Revert "[TTI][RISCV] Add cost modelling for intrinsic vp.load.ff (#160470)"
This reverts commit aa08b1a.
1 parent 727ce02 commit 2be906b

File tree

9 files changed

+65
-128
lines changed

9 files changed

+65
-128
lines changed

llvm/include/llvm/Analysis/TargetTransformInfo.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1619,11 +1619,6 @@ class TargetTransformInfo {
16191619
TTI::TargetCostKind CostKind = TTI::TCK_RecipThroughput,
16201620
bool UseMaskForCond = false, bool UseMaskForGaps = false) const;
16211621

1622-
/// \return The cost of vp intrinsic vp.load.ff.
1623-
LLVM_ABI InstructionCost getFirstFaultLoadCost(
1624-
Type *DataTy, Align Alignment,
1625-
TTI::TargetCostKind CostKind = TTI::TCK_RecipThroughput) const;
1626-
16271622
/// A helper function to determine the type of reduction algorithm used
16281623
/// for a given \p Opcode and set of FastMathFlags \p FMF.
16291624
static bool requiresOrderedReduction(std::optional<FastMathFlags> FMF) {

llvm/include/llvm/Analysis/TargetTransformInfoImpl.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -885,12 +885,6 @@ class TargetTransformInfoImplBase {
885885
return 1;
886886
}
887887

888-
virtual InstructionCost
889-
getFirstFaultLoadCost(Type *DataTy, Align Alignment,
890-
TTI::TargetCostKind CostKind) const {
891-
return InstructionCost::getInvalid();
892-
}
893-
894888
virtual InstructionCost
895889
getIntrinsicInstrCost(const IntrinsicCostAttributes &ICA,
896890
TTI::TargetCostKind CostKind) const {

llvm/include/llvm/CodeGen/BasicTTIImpl.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1795,14 +1795,6 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
17951795
}
17961796
}
17971797

1798-
if (ICA.getID() == Intrinsic::vp_load_ff) {
1799-
Type *RetTy = ICA.getReturnType();
1800-
Type *DataTy = cast<StructType>(RetTy)->getElementType(0);
1801-
Align Alignment;
1802-
if (auto *VPI = dyn_cast_or_null<VPIntrinsic>(ICA.getInst()))
1803-
Alignment = VPI->getPointerAlignment().valueOrOne();
1804-
return thisT()->getFirstFaultLoadCost(DataTy, Alignment, CostKind);
1805-
}
18061798
if (ICA.getID() == Intrinsic::vp_scatter) {
18071799
if (ICA.isTypeBasedOnly()) {
18081800
IntrinsicCostAttributes MaskedScatter(

llvm/lib/Analysis/TargetTransformInfo.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1218,15 +1218,6 @@ InstructionCost TargetTransformInfo::getInterleavedMemoryOpCost(
12181218
return Cost;
12191219
}
12201220

1221-
InstructionCost
1222-
TargetTransformInfo::getFirstFaultLoadCost(Type *DataTy, Align Alignment,
1223-
TTI::TargetCostKind CostKind) const {
1224-
InstructionCost Cost =
1225-
TTIImpl->getFirstFaultLoadCost(DataTy, Alignment, CostKind);
1226-
assert(Cost >= 0 && "TTI should not produce negative costs!");
1227-
return Cost;
1228-
}
1229-
12301221
InstructionCost
12311222
TargetTransformInfo::getIntrinsicInstrCost(const IntrinsicCostAttributes &ICA,
12321223
TTI::TargetCostKind CostKind) const {

llvm/lib/Target/RISCV/RISCVISelLowering.cpp

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24884,22 +24884,6 @@ bool RISCVTargetLowering::isLegalStridedLoadStore(EVT DataType,
2488424884
return true;
2488524885
}
2488624886

24887-
bool RISCVTargetLowering::isLegalFirstFaultLoad(EVT DataType,
24888-
Align Alignment) const {
24889-
if (!Subtarget.hasVInstructions())
24890-
return false;
24891-
24892-
EVT ScalarType = DataType.getScalarType();
24893-
if (!isLegalElementTypeForRVV(ScalarType))
24894-
return false;
24895-
24896-
if (!Subtarget.enableUnalignedVectorMem() &&
24897-
Alignment < ScalarType.getStoreSize())
24898-
return false;
24899-
24900-
return true;
24901-
}
24902-
2490324887
MachineInstr *
2490424888
RISCVTargetLowering::EmitKCFICheck(MachineBasicBlock &MBB,
2490524889
MachineBasicBlock::instr_iterator &MBBI,

llvm/lib/Target/RISCV/RISCVISelLowering.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -425,10 +425,6 @@ class RISCVTargetLowering : public TargetLowering {
425425
/// alignment is legal.
426426
bool isLegalStridedLoadStore(EVT DataType, Align Alignment) const;
427427

428-
/// Return true if a fault-only-first load of the given result type and
429-
/// alignment is legal.
430-
bool isLegalFirstFaultLoad(EVT DataType, Align Alignment) const;
431-
432428
unsigned getMaxSupportedInterleaveFactor() const override { return 8; }
433429

434430
bool fallBackToDAGISel(const Instruction &Inst) const override;

llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,17 +1070,6 @@ InstructionCost RISCVTTIImpl::getInterleavedMemoryOpCost(
10701070
return MemCost + ShuffleCost;
10711071
}
10721072

1073-
InstructionCost
1074-
RISCVTTIImpl::getFirstFaultLoadCost(Type *DataTy, Align Alignment,
1075-
TTI::TargetCostKind CostKind) const {
1076-
EVT DataTypeVT = TLI->getValueType(DL, DataTy);
1077-
if (!TLI->isLegalFirstFaultLoad(DataTypeVT, Alignment))
1078-
return BaseT::getFirstFaultLoadCost(DataTy, Alignment, CostKind);
1079-
1080-
return getMemoryOpCost(Instruction::Load, DataTy, Alignment, 0, CostKind,
1081-
{TTI::OK_AnyValue, TTI::OP_None}, nullptr);
1082-
}
1083-
10841073
InstructionCost RISCVTTIImpl::getGatherScatterOpCost(
10851074
unsigned Opcode, Type *DataTy, const Value *Ptr, bool VariableMask,
10861075
Align Alignment, TTI::TargetCostKind CostKind, const Instruction *I) const {

llvm/lib/Target/RISCV/RISCVTargetTransformInfo.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,10 +191,6 @@ class RISCVTTIImpl final : public BasicTTIImplBase<RISCVTTIImpl> {
191191
Align Alignment, unsigned AddressSpace, TTI::TargetCostKind CostKind,
192192
bool UseMaskForCond = false, bool UseMaskForGaps = false) const override;
193193

194-
InstructionCost
195-
getFirstFaultLoadCost(Type *DataTy, Align Alignment,
196-
TTI::TargetCostKind CostKind) const override;
197-
198194
InstructionCost getGatherScatterOpCost(unsigned Opcode, Type *DataTy,
199195
const Value *Ptr, bool VariableMask,
200196
Align Alignment,

0 commit comments

Comments
 (0)