Skip to content

Commit adecf3a

Browse files
committed
Rename getConsecutiveMemoryOpCost to getExpandCompressMemoryOpCost
1 parent d3da1a2 commit adecf3a

File tree

6 files changed

+29
-32
lines changed

6 files changed

+29
-32
lines changed

llvm/include/llvm/Analysis/TargetTransformInfo.h

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1500,7 +1500,7 @@ class TargetTransformInfo {
15001500
/// \p Alignment - alignment of single element
15011501
/// \p I - the optional original context instruction, if one exists, e.g. the
15021502
/// load/store to transform or the call to the gather/scatter intrinsic
1503-
InstructionCost getConsecutiveMemoryOpCost(
1503+
InstructionCost getExpandCompressMemoryOpCost(
15041504
unsigned Opcode, Type *DataTy, bool VariableMask, Align Alignment,
15051505
TTI::TargetCostKind CostKind = TTI::TCK_RecipThroughput,
15061506
const Instruction *I = nullptr) const;
@@ -2190,10 +2190,9 @@ class TargetTransformInfo::Concept {
21902190
bool VariableMask, Align Alignment,
21912191
TTI::TargetCostKind CostKind,
21922192
const Instruction *I = nullptr) = 0;
2193-
virtual InstructionCost
2194-
getConsecutiveMemoryOpCost(unsigned Opcode, Type *DataTy, bool VariableMask,
2195-
Align Alignment, TTI::TargetCostKind CostKind,
2196-
const Instruction *I = nullptr) = 0;
2193+
virtual InstructionCost getExpandCompressMemoryOpCost(
2194+
unsigned Opcode, Type *DataTy, bool VariableMask, Align Alignment,
2195+
TTI::TargetCostKind CostKind, const Instruction *I = nullptr) = 0;
21972196
virtual InstructionCost
21982197
getStridedMemoryOpCost(unsigned Opcode, Type *DataTy, const Value *Ptr,
21992198
bool VariableMask, Align Alignment,
@@ -2914,12 +2913,11 @@ class TargetTransformInfo::Model final : public TargetTransformInfo::Concept {
29142913
return Impl.getGatherScatterOpCost(Opcode, DataTy, Ptr, VariableMask,
29152914
Alignment, CostKind, I);
29162915
}
2917-
InstructionCost
2918-
getConsecutiveMemoryOpCost(unsigned Opcode, Type *DataTy, bool VariableMask,
2919-
Align Alignment, TTI::TargetCostKind CostKind,
2920-
const Instruction *I = nullptr) override {
2921-
return Impl.getConsecutiveMemoryOpCost(Opcode, DataTy, VariableMask,
2922-
Alignment, CostKind, I);
2916+
InstructionCost getExpandCompressMemoryOpCost(
2917+
unsigned Opcode, Type *DataTy, bool VariableMask, Align Alignment,
2918+
TTI::TargetCostKind CostKind, const Instruction *I = nullptr) override {
2919+
return Impl.getExpandCompressMemoryOpCost(Opcode, DataTy, VariableMask,
2920+
Alignment, CostKind, I);
29232921
}
29242922
InstructionCost
29252923
getStridedMemoryOpCost(unsigned Opcode, Type *DataTy, const Value *Ptr,

llvm/include/llvm/Analysis/TargetTransformInfoImpl.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -765,10 +765,9 @@ class TargetTransformInfoImplBase {
765765
return 1;
766766
}
767767

768-
InstructionCost
769-
getConsecutiveMemoryOpCost(unsigned Opcode, Type *DataTy, bool VariableMask,
770-
Align Alignment, TTI::TargetCostKind CostKind,
771-
const Instruction *I = nullptr) const {
768+
InstructionCost getExpandCompressMemoryOpCost(
769+
unsigned Opcode, Type *DataTy, bool VariableMask, Align Alignment,
770+
TTI::TargetCostKind CostKind, const Instruction *I = nullptr) const {
772771
return 1;
773772
}
774773

llvm/include/llvm/CodeGen/BasicTTIImpl.h

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1469,10 +1469,9 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
14691469
true, CostKind);
14701470
}
14711471

1472-
InstructionCost getConsecutiveMemoryOpCost(unsigned Opcode, Type *DataTy,
1473-
bool VariableMask, Align Alignment,
1474-
TTI::TargetCostKind CostKind,
1475-
const Instruction *I = nullptr) {
1472+
InstructionCost getExpandCompressMemoryOpCost(
1473+
unsigned Opcode, Type *DataTy, bool VariableMask, Align Alignment,
1474+
TTI::TargetCostKind CostKind, const Instruction *I = nullptr) {
14761475
return getCommonMaskedMemoryOpCost(Opcode, DataTy, Alignment, VariableMask,
14771476
true, CostKind);
14781477
}
@@ -1789,16 +1788,16 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
17891788
const Value *Data = Args[0];
17901789
const Value *Mask = Args[2];
17911790
Align Alignment = I->getParamAlign(1).valueOrOne();
1792-
return thisT()->getConsecutiveMemoryOpCost(
1791+
return thisT()->getExpandCompressMemoryOpCost(
17931792
Instruction::Store, Data->getType(), !isa<Constant>(Mask), Alignment,
17941793
CostKind, I);
17951794
}
17961795
case Intrinsic::masked_expandload: {
17971796
const Value *Mask = Args[1];
17981797
Align Alignment = I->getParamAlign(0).valueOrOne();
1799-
return thisT()->getConsecutiveMemoryOpCost(Instruction::Load, RetTy,
1800-
!isa<Constant>(Mask),
1801-
Alignment, CostKind, I);
1798+
return thisT()->getExpandCompressMemoryOpCost(Instruction::Load, RetTy,
1799+
!isa<Constant>(Mask),
1800+
Alignment, CostKind, I);
18021801
}
18031802
case Intrinsic::experimental_vp_strided_store: {
18041803
const Value *Data = Args[0];

llvm/lib/Analysis/TargetTransformInfo.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1135,10 +1135,10 @@ InstructionCost TargetTransformInfo::getGatherScatterOpCost(
11351135
return Cost;
11361136
}
11371137

1138-
InstructionCost TargetTransformInfo::getConsecutiveMemoryOpCost(
1138+
InstructionCost TargetTransformInfo::getExpandCompressMemoryOpCost(
11391139
unsigned Opcode, Type *DataTy, bool VariableMask, Align Alignment,
11401140
TTI::TargetCostKind CostKind, const Instruction *I) const {
1141-
InstructionCost Cost = TTIImpl->getConsecutiveMemoryOpCost(
1141+
InstructionCost Cost = TTIImpl->getExpandCompressMemoryOpCost(
11421142
Opcode, DataTy, VariableMask, Alignment, CostKind, I);
11431143
assert(Cost >= 0 && "TTI should not produce negative costs!");
11441144
return Cost;

llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -838,16 +838,16 @@ InstructionCost RISCVTTIImpl::getGatherScatterOpCost(
838838
return NumLoads * MemOpCost;
839839
}
840840

841-
InstructionCost RISCVTTIImpl::getConsecutiveMemoryOpCost(
841+
InstructionCost RISCVTTIImpl::getExpandCompressMemoryOpCost(
842842
unsigned Opcode, Type *DataTy, bool VariableMask, Align Alignment,
843843
TTI::TargetCostKind CostKind, const Instruction *I) {
844844
bool IsLegal = (Opcode == Instruction::Store &&
845845
isLegalMaskedCompressStore(DataTy, Alignment)) ||
846846
(Opcode == Instruction::Load &&
847847
isLegalMaskedExpandLoad(DataTy, Alignment));
848848
if (!IsLegal || CostKind != TTI::TCK_RecipThroughput)
849-
return BaseT::getConsecutiveMemoryOpCost(Opcode, DataTy, VariableMask,
850-
Alignment, CostKind, I);
849+
return BaseT::getExpandCompressMemoryOpCost(Opcode, DataTy, VariableMask,
850+
Alignment, CostKind, I);
851851
// Example compressstore sequence:
852852
// vsetivli zero, 8, e32, m2, ta, ma (ignored)
853853
// vcompress.vm v10, v8, v0

llvm/lib/Target/RISCV/RISCVTargetTransformInfo.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,11 @@ class RISCVTTIImpl : public BasicTTIImplBase<RISCVTTIImpl> {
166166
TTI::TargetCostKind CostKind,
167167
const Instruction *I);
168168

169-
InstructionCost getConsecutiveMemoryOpCost(unsigned Opcode, Type *Src,
170-
bool VariableMask, Align Alignment,
171-
TTI::TargetCostKind CostKind,
172-
const Instruction *I = nullptr);
169+
InstructionCost getExpandCompressMemoryOpCost(unsigned Opcode, Type *Src,
170+
bool VariableMask,
171+
Align Alignment,
172+
TTI::TargetCostKind CostKind,
173+
const Instruction *I = nullptr);
173174

174175
InstructionCost getStridedMemoryOpCost(unsigned Opcode, Type *DataTy,
175176
const Value *Ptr, bool VariableMask,

0 commit comments

Comments
 (0)