[llvm] df20ff9 - [TTI] Kill last couple uses of OperandValueKind in targets [nfc]
Philip Reames via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 23 08:54:53 PDT 2022
Author: Philip Reames
Date: 2022-08-23T08:54:41-07:00
New Revision: df20ff9ae2061b843e9557a73c1f6534af9c4cfd
URL: https://github.com/llvm/llvm-project/commit/df20ff9ae2061b843e9557a73c1f6534af9c4cfd
DIFF: https://github.com/llvm/llvm-project/commit/df20ff9ae2061b843e9557a73c1f6534af9c4cfd.diff
LOG: [TTI] Kill last couple uses of OperandValueKind in targets [nfc]
Use the accessor methods on the containing class instead so that we can change the representation.
Added:
Modified:
llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp
llvm/lib/Target/X86/X86TargetTransformInfo.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp b/llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp
index 095631145b3af..f5b99d0e23e68 100644
--- a/llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp
+++ b/llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp
@@ -1386,8 +1386,7 @@ InstructionCost ARMTTIImpl::getArithmeticInstrCost(
// sequences look particularly beneficial to vectorize.
// To work around this we increase the cost of v2i64 operations to make them
// seem less beneficial.
- if (LT.second == MVT::v2i64 &&
- Op2Info.Kind == TargetTransformInfo::OK_UniformConstantValue)
+ if (LT.second == MVT::v2i64 && Op2Info.isUniform() && Op2Info.isConstant())
Cost += 4;
return Cost;
@@ -1401,7 +1400,7 @@ InstructionCost ARMTTIImpl::getArithmeticInstrCost(
if (!CxtI || !CxtI->hasOneUse() || !CxtI->isShift())
return false;
- if (Op2Info.Kind != TargetTransformInfo::OK_UniformConstantValue)
+ if (!Op2Info.isUniform() || !Op2Info.isConstant())
return false;
// Folded into a ADC/ADD/AND/BIC/CMP/EOR/MVN/ORR/ORN/RSB/SBC/SUB
diff --git a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp b/llvm/lib/Target/X86/X86TargetTransformInfo.cpp
index c05ad2ce5db8c..5d7e7ae532044 100644
--- a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp
+++ b/llvm/lib/Target/X86/X86TargetTransformInfo.cpp
@@ -776,8 +776,7 @@ InstructionCost X86TTIImpl::getArithmeticInstrCost(
return LT.first * Entry->Cost;
}
- if (ISD == ISD::SHL &&
- Op2Info.Kind == TargetTransformInfo::OK_NonUniformConstantValue) {
+ if (ISD == ISD::SHL && !Op2Info.isUniform() && Op2Info.isConstant()) {
MVT VT = LT.second;
// Vector shift left by non uniform constant can be lowered
// into vector multiply.
More information about the llvm-commits
mailing list