Skip to content

Commit 73f01e3

Browse files
committed
[TTI] Add VecPred argument to getCmpSelInstrCost.
On some targets, like AArch64, vector selects can be efficiently lowered if the vector condition is a compare with a supported predicate. This patch adds a new argument to getCmpSelInstrCost, to indicate the predicate of the feeding select condition. Note that it is not sufficient to use the context instruction when querying the cost of a vector select starting from a scalar one, because the condition of the vector select could be composed of compares with different predicates. This change greatly improves modeling the costs of certain compare/select patterns on AArch64. I am also planning on putting up patches to make use of the new argument in SLPVectorizer & LV. Reviewed By: dmgreen, RKSimon Differential Revision: https://reviews.llvm.org/D90070
1 parent ec809e4 commit 73f01e3

21 files changed

+148
-78
lines changed

llvm/include/llvm/Analysis/TargetTransformInfo.h

+12-5
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#ifndef LLVM_ANALYSIS_TARGETTRANSFORMINFO_H
2222
#define LLVM_ANALYSIS_TARGETTRANSFORMINFO_H
2323

24+
#include "llvm/IR/InstrTypes.h"
2425
#include "llvm/IR/Operator.h"
2526
#include "llvm/IR/PassManager.h"
2627
#include "llvm/Pass.h"
@@ -1092,10 +1093,14 @@ class TargetTransformInfo {
10921093

10931094
/// \returns The expected cost of compare and select instructions. If there
10941095
/// is an existing instruction that holds Opcode, it may be passed in the
1095-
/// 'I' parameter.
1096-
int getCmpSelInstrCost(unsigned Opcode, Type *ValTy, Type *CondTy = nullptr,
1097-
TTI::TargetCostKind CostKind = TTI::TCK_RecipThroughput,
1098-
const Instruction *I = nullptr) const;
1096+
/// 'I' parameter. The \p VecPred parameter can be used to indicate the select
1097+
/// is using a compare with the specified predicate as condition. When vector
1098+
/// types are passed, \p VecPred must be used for all lanes.
1099+
int getCmpSelInstrCost(
1100+
unsigned Opcode, Type *ValTy, Type *CondTy = nullptr,
1101+
CmpInst::Predicate VecPred = CmpInst::BAD_ICMP_PREDICATE,
1102+
TTI::TargetCostKind CostKind = TTI::TCK_RecipThroughput,
1103+
const Instruction *I = nullptr) const;
10991104

11001105
/// \return The expected cost of vector Insert and Extract.
11011106
/// Use -1 to indicate that there is no information on the index value.
@@ -1534,6 +1539,7 @@ class TargetTransformInfo::Concept {
15341539
virtual int getCFInstrCost(unsigned Opcode,
15351540
TTI::TargetCostKind CostKind) = 0;
15361541
virtual int getCmpSelInstrCost(unsigned Opcode, Type *ValTy, Type *CondTy,
1542+
CmpInst::Predicate VecPred,
15371543
TTI::TargetCostKind CostKind,
15381544
const Instruction *I) = 0;
15391545
virtual int getVectorInstrCost(unsigned Opcode, Type *Val,
@@ -1975,9 +1981,10 @@ class TargetTransformInfo::Model final : public TargetTransformInfo::Concept {
19751981
return Impl.getCFInstrCost(Opcode, CostKind);
19761982
}
19771983
int getCmpSelInstrCost(unsigned Opcode, Type *ValTy, Type *CondTy,
1984+
CmpInst::Predicate VecPred,
19781985
TTI::TargetCostKind CostKind,
19791986
const Instruction *I) override {
1980-
return Impl.getCmpSelInstrCost(Opcode, ValTy, CondTy, CostKind, I);
1987+
return Impl.getCmpSelInstrCost(Opcode, ValTy, CondTy, VecPred, CostKind, I);
19811988
}
19821989
int getVectorInstrCost(unsigned Opcode, Type *Val, unsigned Index) override {
19831990
return Impl.getVectorInstrCost(Opcode, Val, Index);

llvm/include/llvm/Analysis/TargetTransformInfoImpl.h

+3
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,7 @@ class TargetTransformInfoImplBase {
478478
}
479479

480480
unsigned getCmpSelInstrCost(unsigned Opcode, Type *ValTy, Type *CondTy,
481+
CmpInst::Predicate VecPred,
481482
TTI::TargetCostKind CostKind,
482483
const Instruction *I) const {
483484
return 1;
@@ -947,12 +948,14 @@ class TargetTransformInfoImplCRTPBase : public TargetTransformInfoImplBase {
947948
case Instruction::Select: {
948949
Type *CondTy = U->getOperand(0)->getType();
949950
return TargetTTI->getCmpSelInstrCost(Opcode, U->getType(), CondTy,
951+
CmpInst::BAD_ICMP_PREDICATE,
950952
CostKind, I);
951953
}
952954
case Instruction::ICmp:
953955
case Instruction::FCmp: {
954956
Type *ValTy = U->getOperand(0)->getType();
955957
return TargetTTI->getCmpSelInstrCost(Opcode, ValTy, U->getType(),
958+
cast<CmpInst>(U)->getPredicate(),
956959
CostKind, I);
957960
}
958961
case Instruction::InsertElement: {

llvm/include/llvm/CodeGen/BasicTTIImpl.h

+43-28
Original file line numberDiff line numberDiff line change
@@ -881,6 +881,7 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
881881
}
882882

883883
unsigned getCmpSelInstrCost(unsigned Opcode, Type *ValTy, Type *CondTy,
884+
CmpInst::Predicate VecPred,
884885
TTI::TargetCostKind CostKind,
885886
const Instruction *I = nullptr) {
886887
const TargetLoweringBase *TLI = getTLI();
@@ -889,7 +890,8 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
889890

890891
// TODO: Handle other cost kinds.
891892
if (CostKind != TTI::TCK_RecipThroughput)
892-
return BaseT::getCmpSelInstrCost(Opcode, ValTy, CondTy, CostKind, I);
893+
return BaseT::getCmpSelInstrCost(Opcode, ValTy, CondTy, VecPred, CostKind,
894+
I);
893895

894896
// Selects on vectors are actually vector selects.
895897
if (ISD == ISD::SELECT) {
@@ -914,7 +916,7 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
914916
if (CondTy)
915917
CondTy = CondTy->getScalarType();
916918
unsigned Cost = thisT()->getCmpSelInstrCost(
917-
Opcode, ValVTy->getScalarType(), CondTy, CostKind, I);
919+
Opcode, ValVTy->getScalarType(), CondTy, VecPred, CostKind, I);
918920

919921
// Return the cost of multiple scalar invocation plus the cost of
920922
// inserting and extracting the values.
@@ -1241,10 +1243,12 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
12411243
// For non-rotates (X != Y) we must add shift-by-zero handling costs.
12421244
if (X != Y) {
12431245
Type *CondTy = RetTy->getWithNewBitWidth(1);
1244-
Cost += thisT()->getCmpSelInstrCost(BinaryOperator::ICmp, RetTy, CondTy,
1245-
CostKind);
1246-
Cost += thisT()->getCmpSelInstrCost(BinaryOperator::Select, RetTy,
1247-
CondTy, CostKind);
1246+
Cost +=
1247+
thisT()->getCmpSelInstrCost(BinaryOperator::ICmp, RetTy, CondTy,
1248+
CmpInst::BAD_ICMP_PREDICATE, CostKind);
1249+
Cost +=
1250+
thisT()->getCmpSelInstrCost(BinaryOperator::Select, RetTy, CondTy,
1251+
CmpInst::BAD_ICMP_PREDICATE, CostKind);
12481252
}
12491253
return Cost;
12501254
}
@@ -1483,10 +1487,12 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
14831487
Type *CondTy = RetTy->getWithNewBitWidth(1);
14841488
unsigned Cost = 0;
14851489
// TODO: Ideally getCmpSelInstrCost would accept an icmp condition code.
1486-
Cost += thisT()->getCmpSelInstrCost(BinaryOperator::ICmp, RetTy, CondTy,
1487-
CostKind);
1488-
Cost += thisT()->getCmpSelInstrCost(BinaryOperator::Select, RetTy, CondTy,
1489-
CostKind);
1490+
Cost +=
1491+
thisT()->getCmpSelInstrCost(BinaryOperator::ICmp, RetTy, CondTy,
1492+
CmpInst::BAD_ICMP_PREDICATE, CostKind);
1493+
Cost +=
1494+
thisT()->getCmpSelInstrCost(BinaryOperator::Select, RetTy, CondTy,
1495+
CmpInst::BAD_ICMP_PREDICATE, CostKind);
14901496
// TODO: Should we add an OperandValueProperties::OP_Zero property?
14911497
if (IID == Intrinsic::abs)
14921498
Cost += thisT()->getArithmeticInstrCost(
@@ -1508,10 +1514,12 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
15081514
IntrinsicCostAttributes Attrs(OverflowOp, OpTy, {RetTy, RetTy}, FMF,
15091515
ScalarizationCostPassed);
15101516
Cost += thisT()->getIntrinsicInstrCost(Attrs, CostKind);
1511-
Cost += thisT()->getCmpSelInstrCost(BinaryOperator::ICmp, RetTy, CondTy,
1512-
CostKind);
1513-
Cost += 2 * thisT()->getCmpSelInstrCost(BinaryOperator::Select, RetTy,
1514-
CondTy, CostKind);
1517+
Cost +=
1518+
thisT()->getCmpSelInstrCost(BinaryOperator::ICmp, RetTy, CondTy,
1519+
CmpInst::BAD_ICMP_PREDICATE, CostKind);
1520+
Cost += 2 * thisT()->getCmpSelInstrCost(
1521+
BinaryOperator::Select, RetTy, CondTy,
1522+
CmpInst::BAD_ICMP_PREDICATE, CostKind);
15151523
return Cost;
15161524
}
15171525
case Intrinsic::uadd_sat:
@@ -1527,8 +1535,9 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
15271535
IntrinsicCostAttributes Attrs(OverflowOp, OpTy, {RetTy, RetTy}, FMF,
15281536
ScalarizationCostPassed);
15291537
Cost += thisT()->getIntrinsicInstrCost(Attrs, CostKind);
1530-
Cost += thisT()->getCmpSelInstrCost(BinaryOperator::Select, RetTy, CondTy,
1531-
CostKind);
1538+
Cost +=
1539+
thisT()->getCmpSelInstrCost(BinaryOperator::Select, RetTy, CondTy,
1540+
CmpInst::BAD_ICMP_PREDICATE, CostKind);
15321541
return Cost;
15331542
}
15341543
case Intrinsic::smul_fix:
@@ -1573,10 +1582,12 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
15731582
// Overflow -> (LHSSign != RHSSign) && (LHSSign != SumSign)
15741583
unsigned Cost = 0;
15751584
Cost += thisT()->getArithmeticInstrCost(Opcode, SumTy, CostKind);
1576-
Cost += 3 * thisT()->getCmpSelInstrCost(BinaryOperator::ICmp, SumTy,
1577-
OverflowTy, CostKind);
1578-
Cost += 2 * thisT()->getCmpSelInstrCost(BinaryOperator::ICmp, OverflowTy,
1579-
OverflowTy, CostKind);
1585+
Cost += 3 * thisT()->getCmpSelInstrCost(
1586+
BinaryOperator::ICmp, SumTy, OverflowTy,
1587+
CmpInst::BAD_ICMP_PREDICATE, CostKind);
1588+
Cost += 2 * thisT()->getCmpSelInstrCost(
1589+
BinaryOperator::ICmp, OverflowTy, OverflowTy,
1590+
CmpInst::BAD_ICMP_PREDICATE, CostKind);
15801591
Cost += thisT()->getArithmeticInstrCost(BinaryOperator::And, OverflowTy,
15811592
CostKind);
15821593
return Cost;
@@ -1591,8 +1602,9 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
15911602

15921603
unsigned Cost = 0;
15931604
Cost += thisT()->getArithmeticInstrCost(Opcode, SumTy, CostKind);
1594-
Cost += thisT()->getCmpSelInstrCost(BinaryOperator::ICmp, SumTy,
1595-
OverflowTy, CostKind);
1605+
Cost +=
1606+
thisT()->getCmpSelInstrCost(BinaryOperator::ICmp, SumTy, OverflowTy,
1607+
CmpInst::BAD_ICMP_PREDICATE, CostKind);
15961608
return Cost;
15971609
}
15981610
case Intrinsic::smul_with_overflow:
@@ -1621,8 +1633,9 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
16211633
CostKind, TTI::OK_AnyValue,
16221634
TTI::OK_UniformConstantValue);
16231635

1624-
Cost += thisT()->getCmpSelInstrCost(BinaryOperator::ICmp, MulTy,
1625-
OverflowTy, CostKind);
1636+
Cost +=
1637+
thisT()->getCmpSelInstrCost(BinaryOperator::ICmp, MulTy, OverflowTy,
1638+
CmpInst::BAD_ICMP_PREDICATE, CostKind);
16261639
return Cost;
16271640
}
16281641
case Intrinsic::ctpop:
@@ -1864,9 +1877,10 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
18641877
(IsPairwise + 1) * thisT()->getShuffleCost(TTI::SK_ExtractSubvector,
18651878
Ty, NumVecElts, SubTy);
18661879
MinMaxCost +=
1867-
thisT()->getCmpSelInstrCost(CmpOpcode, SubTy, CondTy, CostKind) +
1880+
thisT()->getCmpSelInstrCost(CmpOpcode, SubTy, CondTy,
1881+
CmpInst::BAD_ICMP_PREDICATE, CostKind) +
18681882
thisT()->getCmpSelInstrCost(Instruction::Select, SubTy, CondTy,
1869-
CostKind);
1883+
CmpInst::BAD_ICMP_PREDICATE, CostKind);
18701884
Ty = SubTy;
18711885
++LongVectorCount;
18721886
}
@@ -1888,9 +1902,10 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
18881902
thisT()->getShuffleCost(TTI::SK_PermuteSingleSrc, Ty, 0, Ty);
18891903
MinMaxCost +=
18901904
NumReduxLevels *
1891-
(thisT()->getCmpSelInstrCost(CmpOpcode, Ty, CondTy, CostKind) +
1905+
(thisT()->getCmpSelInstrCost(CmpOpcode, Ty, CondTy,
1906+
CmpInst::BAD_ICMP_PREDICATE, CostKind) +
18921907
thisT()->getCmpSelInstrCost(Instruction::Select, Ty, CondTy,
1893-
CostKind));
1908+
CmpInst::BAD_ICMP_PREDICATE, CostKind));
18941909
// The last min/max should be in vector registers and we counted it above.
18951910
// So just need a single extractelement.
18961911
return ShuffleCost + MinMaxCost +

llvm/lib/Analysis/TargetTransformInfo.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -807,11 +807,13 @@ int TargetTransformInfo::getCFInstrCost(unsigned Opcode,
807807

808808
int TargetTransformInfo::getCmpSelInstrCost(unsigned Opcode, Type *ValTy,
809809
Type *CondTy,
810+
CmpInst::Predicate VecPred,
810811
TTI::TargetCostKind CostKind,
811812
const Instruction *I) const {
812813
assert((I == nullptr || I->getOpcode() == Opcode) &&
813814
"Opcode should reflect passed instruction.");
814-
int Cost = TTIImpl->getCmpSelInstrCost(Opcode, ValTy, CondTy, CostKind, I);
815+
int Cost =
816+
TTIImpl->getCmpSelInstrCost(Opcode, ValTy, CondTy, VecPred, CostKind, I);
815817
assert(Cost >= 0 && "TTI should not produce negative costs!");
816818
return Cost;
817819
}

llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp

+27-4
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#include "AArch64ExpandImm.h"
109
#include "AArch64TargetTransformInfo.h"
10+
#include "AArch64ExpandImm.h"
1111
#include "MCTargetDesc/AArch64AddressingModes.h"
1212
#include "llvm/Analysis/LoopInfo.h"
1313
#include "llvm/Analysis/TargetTransformInfo.h"
@@ -16,9 +16,11 @@
1616
#include "llvm/CodeGen/TargetLowering.h"
1717
#include "llvm/IR/IntrinsicInst.h"
1818
#include "llvm/IR/IntrinsicsAArch64.h"
19+
#include "llvm/IR/PatternMatch.h"
1920
#include "llvm/Support/Debug.h"
2021
#include <algorithm>
2122
using namespace llvm;
23+
using namespace llvm::PatternMatch;
2224

2325
#define DEBUG_TYPE "aarch64tti"
2426

@@ -675,19 +677,40 @@ int AArch64TTIImpl::getAddressComputationCost(Type *Ty, ScalarEvolution *SE,
675677
}
676678

677679
int AArch64TTIImpl::getCmpSelInstrCost(unsigned Opcode, Type *ValTy,
678-
Type *CondTy,
680+
Type *CondTy, CmpInst::Predicate VecPred,
679681
TTI::TargetCostKind CostKind,
680682
const Instruction *I) {
681683
// TODO: Handle other cost kinds.
682684
if (CostKind != TTI::TCK_RecipThroughput)
683-
return BaseT::getCmpSelInstrCost(Opcode, ValTy, CondTy, CostKind, I);
685+
return BaseT::getCmpSelInstrCost(Opcode, ValTy, CondTy, VecPred, CostKind,
686+
I);
684687

685688
int ISD = TLI->InstructionOpcodeToISD(Opcode);
686689
// We don't lower some vector selects well that are wider than the register
687690
// width.
688691
if (ValTy->isVectorTy() && ISD == ISD::SELECT) {
689692
// We would need this many instructions to hide the scalarization happening.
690693
const int AmortizationCost = 20;
694+
695+
// If VecPred is not set, check if we can get a predicate from the context
696+
// instruction, if its type matches the requested ValTy.
697+
if (VecPred == CmpInst::BAD_ICMP_PREDICATE && I && I->getType() == ValTy) {
698+
CmpInst::Predicate CurrentPred;
699+
if (match(I, m_Select(m_Cmp(CurrentPred, m_Value(), m_Value()), m_Value(),
700+
m_Value())))
701+
VecPred = CurrentPred;
702+
}
703+
// Check if we have a compare/select chain that can be lowered using CMxx &
704+
// BFI pair.
705+
if (CmpInst::isIntPredicate(VecPred)) {
706+
static const auto ValidMinMaxTys = {MVT::v8i8, MVT::v16i8, MVT::v4i16,
707+
MVT::v8i16, MVT::v2i32, MVT::v4i32,
708+
MVT::v2i64};
709+
auto LT = TLI->getTypeLegalizationCost(DL, ValTy);
710+
if (any_of(ValidMinMaxTys, [&LT](MVT M) { return M == LT.second; }))
711+
return LT.first;
712+
}
713+
691714
static const TypeConversionCostTblEntry
692715
VectorSelectTbl[] = {
693716
{ ISD::SELECT, MVT::v16i1, MVT::v16i16, 16 },
@@ -707,7 +730,7 @@ int AArch64TTIImpl::getCmpSelInstrCost(unsigned Opcode, Type *ValTy,
707730
return Entry->Cost;
708731
}
709732
}
710-
return BaseT::getCmpSelInstrCost(Opcode, ValTy, CondTy, CostKind, I);
733+
return BaseT::getCmpSelInstrCost(Opcode, ValTy, CondTy, VecPred, CostKind, I);
711734
}
712735

713736
AArch64TTIImpl::TTI::MemCmpExpansionOptions

llvm/lib/Target/AArch64/AArch64TargetTransformInfo.h

+1
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ class AArch64TTIImpl : public BasicTTIImplBase<AArch64TTIImpl> {
141141
int getAddressComputationCost(Type *Ty, ScalarEvolution *SE, const SCEV *Ptr);
142142

143143
int getCmpSelInstrCost(unsigned Opcode, Type *ValTy, Type *CondTy,
144+
CmpInst::Predicate VecPred,
144145
TTI::TargetCostKind CostKind,
145146
const Instruction *I = nullptr);
146147

llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp

+5-3
Original file line numberDiff line numberDiff line change
@@ -810,6 +810,7 @@ int ARMTTIImpl::getVectorInstrCost(unsigned Opcode, Type *ValTy,
810810
}
811811

812812
int ARMTTIImpl::getCmpSelInstrCost(unsigned Opcode, Type *ValTy, Type *CondTy,
813+
CmpInst::Predicate VecPred,
813814
TTI::TargetCostKind CostKind,
814815
const Instruction *I) {
815816
int ISD = TLI->InstructionOpcodeToISD(Opcode);
@@ -839,7 +840,8 @@ int ARMTTIImpl::getCmpSelInstrCost(unsigned Opcode, Type *ValTy, Type *CondTy,
839840
}
840841

841842
if (CostKind != TTI::TCK_RecipThroughput)
842-
return BaseT::getCmpSelInstrCost(Opcode, ValTy, CondTy, CostKind, I);
843+
return BaseT::getCmpSelInstrCost(Opcode, ValTy, CondTy, VecPred, CostKind,
844+
I);
843845

844846
// On NEON a vector select gets lowered to vbsl.
845847
if (ST->hasNEON() && ValTy->isVectorTy() && ISD == ISD::SELECT) {
@@ -866,8 +868,8 @@ int ARMTTIImpl::getCmpSelInstrCost(unsigned Opcode, Type *ValTy, Type *CondTy,
866868
int BaseCost = ST->hasMVEIntegerOps() && ValTy->isVectorTy()
867869
? ST->getMVEVectorCostFactor()
868870
: 1;
869-
return BaseCost * BaseT::getCmpSelInstrCost(Opcode, ValTy, CondTy, CostKind,
870-
I);
871+
return BaseCost *
872+
BaseT::getCmpSelInstrCost(Opcode, ValTy, CondTy, VecPred, CostKind, I);
871873
}
872874

873875
int ARMTTIImpl::getAddressComputationCost(Type *Ty, ScalarEvolution *SE,

llvm/lib/Target/ARM/ARMTargetTransformInfo.h

+1
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ class ARMTTIImpl : public BasicTTIImplBase<ARMTTIImpl> {
213213
const Instruction *I = nullptr);
214214

215215
int getCmpSelInstrCost(unsigned Opcode, Type *ValTy, Type *CondTy,
216+
CmpInst::Predicate VecPred,
216217
TTI::TargetCostKind CostKind,
217218
const Instruction *I = nullptr);
218219

llvm/lib/Target/Hexagon/HexagonTargetTransformInfo.cpp

+5-2
Original file line numberDiff line numberDiff line change
@@ -242,13 +242,16 @@ unsigned HexagonTTIImpl::getInterleavedMemoryOpCost(
242242
}
243243

244244
unsigned HexagonTTIImpl::getCmpSelInstrCost(unsigned Opcode, Type *ValTy,
245-
Type *CondTy, TTI::TargetCostKind CostKind, const Instruction *I) {
245+
Type *CondTy,
246+
CmpInst::Predicate VecPred,
247+
TTI::TargetCostKind CostKind,
248+
const Instruction *I) {
246249
if (ValTy->isVectorTy() && CostKind == TTI::TCK_RecipThroughput) {
247250
std::pair<int, MVT> LT = TLI.getTypeLegalizationCost(DL, ValTy);
248251
if (Opcode == Instruction::FCmp)
249252
return LT.first + FloatFactor * getTypeNumElements(ValTy);
250253
}
251-
return BaseT::getCmpSelInstrCost(Opcode, ValTy, CondTy, CostKind, I);
254+
return BaseT::getCmpSelInstrCost(Opcode, ValTy, CondTy, VecPred, CostKind, I);
252255
}
253256

254257
unsigned HexagonTTIImpl::getArithmeticInstrCost(

llvm/lib/Target/Hexagon/HexagonTargetTransformInfo.h

+2
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,8 @@ class HexagonTTIImpl : public BasicTTIImplBase<HexagonTTIImpl> {
134134
TTI::TargetCostKind CostKind = TTI::TCK_SizeAndLatency,
135135
bool UseMaskForCond = false, bool UseMaskForGaps = false);
136136
unsigned getCmpSelInstrCost(unsigned Opcode, Type *ValTy, Type *CondTy,
137+
138+
CmpInst::Predicate VecPred,
137139
TTI::TargetCostKind CostKind,
138140
const Instruction *I = nullptr);
139141
unsigned getArithmeticInstrCost(

0 commit comments

Comments
 (0)