[llvm] b0a2c48 - [tti] Consolidate getOperandInfo without OperandValueProperties copies [nfc]
Philip Reames via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 19 16:22:34 PDT 2022
Author: Philip Reames
Date: 2022-08-19T16:22:22-07:00
New Revision: b0a2c48e9f29bd49a8315dca10248cc3c1df5b7f
URL: https://github.com/llvm/llvm-project/commit/b0a2c48e9f29bd49a8315dca10248cc3c1df5b7f
DIFF: https://github.com/llvm/llvm-project/commit/b0a2c48e9f29bd49a8315dca10248cc3c1df5b7f.diff
LOG: [tti] Consolidate getOperandInfo without OperandValueProperties copies [nfc]
Added:
Modified:
llvm/include/llvm/Analysis/TargetTransformInfo.h
llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
llvm/lib/Analysis/TargetTransformInfo.cpp
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/Analysis/TargetTransformInfo.h b/llvm/include/llvm/Analysis/TargetTransformInfo.h
index ab9b701808202..1eb416496bf32 100644
--- a/llvm/include/llvm/Analysis/TargetTransformInfo.h
+++ b/llvm/include/llvm/Analysis/TargetTransformInfo.h
@@ -1032,6 +1032,8 @@ class TargetTransformInfo {
/// Collect properties of V used in cost analysis, e.g. OP_PowerOf2.
static OperandValueKind getOperandInfo(const Value *V,
OperandValueProperties &OpProps);
+ static OperandValueKind getOperandInfo(const Value *V);
+
/// This is an approximation of reciprocal throughput of a math/logic op.
/// A higher cost indicates less expected throughput.
diff --git a/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h b/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
index a11e540cb7d9b..42282a77fa41e 100644
--- a/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
+++ b/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
@@ -1100,8 +1100,7 @@ class TargetTransformInfoImplCRTPBase : public TargetTransformInfoImplBase {
case Instruction::Store: {
auto *SI = cast<StoreInst>(U);
Type *ValTy = U->getOperand(0)->getType();
- TTI::OperandValueProperties OpVP = TTI::OP_None;
- TTI::OperandValueKind OpVK = TTI::getOperandInfo(U->getOperand(0), OpVP);
+ TTI::OperandValueKind OpVK = TTI::getOperandInfo(U->getOperand(0));
return TargetTTI->getMemoryOpCost(Opcode, ValTy, SI->getAlign(),
SI->getPointerAddressSpace(), CostKind,
OpVK, I);
diff --git a/llvm/lib/Analysis/TargetTransformInfo.cpp b/llvm/lib/Analysis/TargetTransformInfo.cpp
index b0f8fdeead00f..bba09f7dd8c22 100644
--- a/llvm/lib/Analysis/TargetTransformInfo.cpp
+++ b/llvm/lib/Analysis/TargetTransformInfo.cpp
@@ -762,6 +762,12 @@ TargetTransformInfo::getOperandInfo(const Value *V,
return OpInfo;
}
+TargetTransformInfo::OperandValueKind
+TargetTransformInfo::getOperandInfo(const Value *V) {
+ OperandValueProperties Discard = OP_None;
+ return getOperandInfo(V, Discard);
+}
+
InstructionCost TargetTransformInfo::getArithmeticInstrCost(
unsigned Opcode, Type *Ty, TTI::TargetCostKind CostKind,
OperandValueKind Opd1Info, OperandValueKind Opd2Info,
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index 09139a8920f36..39cd9ecca8884 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -6398,8 +6398,7 @@ LoopVectorizationCostModel::getConsecutiveMemOpCost(Instruction *I,
Cost += TTI.getMaskedMemoryOpCost(I->getOpcode(), VectorTy, Alignment, AS,
CostKind);
} else {
- TTI::OperandValueProperties OpVP = TTI::OP_None;
- TTI::OperandValueKind OpVK = TTI::getOperandInfo(I->getOperand(0), OpVP);
+ TTI::OperandValueKind OpVK = TTI::getOperandInfo(I->getOperand(0));
Cost += TTI.getMemoryOpCost(I->getOpcode(), VectorTy, Alignment, AS,
CostKind, OpVK, I);
}
@@ -6679,8 +6678,7 @@ LoopVectorizationCostModel::getMemoryInstructionCost(Instruction *I,
const Align Alignment = getLoadStoreAlignment(I);
unsigned AS = getLoadStoreAddressSpace(I);
- TTI::OperandValueProperties OpVP = TTI::OP_None;
- TTI::OperandValueKind OpVK = TTI::getOperandInfo(I->getOperand(0), OpVP);
+ TTI::OperandValueKind OpVK = TTI::getOperandInfo(I->getOperand(0));
return TTI.getAddressComputationCost(ValTy) +
TTI.getMemoryOpCost(I->getOpcode(), ValTy, Alignment, AS,
TTI::TCK_RecipThroughput, OpVK, I);
diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
index 5af240b71c405..f2a7233caf4dd 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -6483,8 +6483,7 @@ InstructionCost BoUpSLP::getEntryCost(const TreeEntry *E,
auto *SI =
cast<StoreInst>(IsReorder ? VL[E->ReorderIndices.front()] : VL0);
Align Alignment = SI->getAlign();
- TTI::OperandValueProperties OpVP = TTI::OP_None;
- TTI::OperandValueKind OpVK = TTI::getOperandInfo(SI->getOperand(0), OpVP);
+ TTI::OperandValueKind OpVK = TTI::getOperandInfo(SI->getOperand(0));
InstructionCost ScalarEltCost = TTI->getMemoryOpCost(
Instruction::Store, ScalarTy, Alignment, 0, CostKind, OpVK, VL0);
InstructionCost ScalarStCost = VecTy->getNumElements() * ScalarEltCost;
More information about the llvm-commits
mailing list