Skip to content

Commit e33ca43

Browse files
author
git apple-llvm automerger
committed
Merge commit 'd0e4fe0417e8' from apple/stable/20200714 into swift/main
2 parents 05bbaaf + d0e4fe0 commit e33ca43

25 files changed

+2148
-64
lines changed

llvm/include/llvm/Analysis/TargetTransformInfo.h

Lines changed: 12 additions & 5 deletions
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"
@@ -1015,10 +1016,14 @@ class TargetTransformInfo {
10151016

10161017
/// \returns The expected cost of compare and select instructions. If there
10171018
/// is an existing instruction that holds Opcode, it may be passed in the
1018-
/// 'I' parameter.
1019-
int getCmpSelInstrCost(unsigned Opcode, Type *ValTy, Type *CondTy = nullptr,
1020-
TTI::TargetCostKind CostKind = TTI::TCK_RecipThroughput,
1021-
const Instruction *I = nullptr) const;
1019+
/// 'I' parameter. The \p VecPred parameter can be used to indicate the select
1020+
/// is using a compare with the specified predicate as condition. When vector
1021+
/// types are passed, \p VecPred must be used for all lanes.
1022+
int getCmpSelInstrCost(
1023+
unsigned Opcode, Type *ValTy, Type *CondTy = nullptr,
1024+
CmpInst::Predicate VecPred = CmpInst::BAD_ICMP_PREDICATE,
1025+
TTI::TargetCostKind CostKind = TTI::TCK_RecipThroughput,
1026+
const Instruction *I = nullptr) const;
10221027

10231028
/// \return The expected cost of vector Insert and Extract.
10241029
/// Use -1 to indicate that there is no information on the index value.
@@ -1425,6 +1430,7 @@ class TargetTransformInfo::Concept {
14251430
virtual int getCFInstrCost(unsigned Opcode,
14261431
TTI::TargetCostKind CostKind) = 0;
14271432
virtual int getCmpSelInstrCost(unsigned Opcode, Type *ValTy, Type *CondTy,
1433+
CmpInst::Predicate VecPred,
14281434
TTI::TargetCostKind CostKind,
14291435
const Instruction *I) = 0;
14301436
virtual int getVectorInstrCost(unsigned Opcode, Type *Val,
@@ -1838,9 +1844,10 @@ class TargetTransformInfo::Model final : public TargetTransformInfo::Concept {
18381844
return Impl.getCFInstrCost(Opcode, CostKind);
18391845
}
18401846
int getCmpSelInstrCost(unsigned Opcode, Type *ValTy, Type *CondTy,
1847+
CmpInst::Predicate VecPred,
18411848
TTI::TargetCostKind CostKind,
18421849
const Instruction *I) override {
1843-
return Impl.getCmpSelInstrCost(Opcode, ValTy, CondTy, CostKind, I);
1850+
return Impl.getCmpSelInstrCost(Opcode, ValTy, CondTy, VecPred, CostKind, I);
18441851
}
18451852
int getVectorInstrCost(unsigned Opcode, Type *Val, unsigned Index) override {
18461853
return Impl.getVectorInstrCost(Opcode, Val, Index);

llvm/include/llvm/Analysis/TargetTransformInfoImpl.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,7 @@ class TargetTransformInfoImplBase {
452452
}
453453

454454
unsigned getCmpSelInstrCost(unsigned Opcode, Type *ValTy, Type *CondTy,
455+
CmpInst::Predicate VecPred,
455456
TTI::TargetCostKind CostKind,
456457
const Instruction *I) const {
457458
return 1;
@@ -912,12 +913,16 @@ class TargetTransformInfoImplCRTPBase : public TargetTransformInfoImplBase {
912913
case Instruction::Select: {
913914
Type *CondTy = U->getOperand(0)->getType();
914915
return TargetTTI->getCmpSelInstrCost(Opcode, U->getType(), CondTy,
916+
CmpInst::BAD_ICMP_PREDICATE,
915917
CostKind, I);
916918
}
917919
case Instruction::ICmp:
918920
case Instruction::FCmp: {
919921
Type *ValTy = U->getOperand(0)->getType();
922+
// TODO: Also handle ICmp/FCmp constant expressions.
920923
return TargetTTI->getCmpSelInstrCost(Opcode, ValTy, U->getType(),
924+
I ? cast<CmpInst>(I)->getPredicate()
925+
: CmpInst::BAD_ICMP_PREDICATE,
921926
CostKind, I);
922927
}
923928
case Instruction::InsertElement: {

llvm/include/llvm/CodeGen/BasicTTIImpl.h

Lines changed: 37 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -855,6 +855,7 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
855855
}
856856

857857
unsigned getCmpSelInstrCost(unsigned Opcode, Type *ValTy, Type *CondTy,
858+
CmpInst::Predicate VecPred,
858859
TTI::TargetCostKind CostKind,
859860
const Instruction *I = nullptr) {
860861
const TargetLoweringBase *TLI = getTLI();
@@ -863,7 +864,8 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
863864

864865
// TODO: Handle other cost kinds.
865866
if (CostKind != TTI::TCK_RecipThroughput)
866-
return BaseT::getCmpSelInstrCost(Opcode, ValTy, CondTy, CostKind, I);
867+
return BaseT::getCmpSelInstrCost(Opcode, ValTy, CondTy, VecPred, CostKind,
868+
I);
867869

868870
// Selects on vectors are actually vector selects.
869871
if (ISD == ISD::SELECT) {
@@ -888,7 +890,7 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
888890
if (CondTy)
889891
CondTy = CondTy->getScalarType();
890892
unsigned Cost = thisT()->getCmpSelInstrCost(
891-
Opcode, ValVTy->getScalarType(), CondTy, CostKind, I);
893+
Opcode, ValVTy->getScalarType(), CondTy, VecPred, CostKind, I);
892894

893895
// Return the cost of multiple scalar invocation plus the cost of
894896
// inserting and extracting the values.
@@ -1232,10 +1234,12 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
12321234
// For non-rotates (X != Y) we must add shift-by-zero handling costs.
12331235
if (X != Y) {
12341236
Type *CondTy = RetTy->getWithNewBitWidth(1);
1235-
Cost += thisT()->getCmpSelInstrCost(BinaryOperator::ICmp, RetTy, CondTy,
1236-
CostKind);
1237-
Cost += thisT()->getCmpSelInstrCost(BinaryOperator::Select, RetTy,
1238-
CondTy, CostKind);
1237+
Cost +=
1238+
thisT()->getCmpSelInstrCost(BinaryOperator::ICmp, RetTy, CondTy,
1239+
CmpInst::BAD_ICMP_PREDICATE, CostKind);
1240+
Cost +=
1241+
thisT()->getCmpSelInstrCost(BinaryOperator::Select, RetTy, CondTy,
1242+
CmpInst::BAD_ICMP_PREDICATE, CostKind);
12391243
}
12401244
return Cost;
12411245
}
@@ -1447,10 +1451,12 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
14471451
IntrinsicCostAttributes Attrs(OverflowOp, OpTy, {RetTy, RetTy}, FMF,
14481452
ScalarizationCostPassed);
14491453
Cost += thisT()->getIntrinsicInstrCost(Attrs, CostKind);
1450-
Cost += thisT()->getCmpSelInstrCost(BinaryOperator::ICmp, RetTy, CondTy,
1451-
CostKind);
1452-
Cost += 2 * thisT()->getCmpSelInstrCost(BinaryOperator::Select, RetTy,
1453-
CondTy, CostKind);
1454+
Cost +=
1455+
thisT()->getCmpSelInstrCost(BinaryOperator::ICmp, RetTy, CondTy,
1456+
CmpInst::BAD_ICMP_PREDICATE, CostKind);
1457+
Cost += 2 * thisT()->getCmpSelInstrCost(
1458+
BinaryOperator::Select, RetTy, CondTy,
1459+
CmpInst::BAD_ICMP_PREDICATE, CostKind);
14541460
return Cost;
14551461
}
14561462
case Intrinsic::uadd_sat:
@@ -1466,8 +1472,9 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
14661472
IntrinsicCostAttributes Attrs(OverflowOp, OpTy, {RetTy, RetTy}, FMF,
14671473
ScalarizationCostPassed);
14681474
Cost += thisT()->getIntrinsicInstrCost(Attrs, CostKind);
1469-
Cost += thisT()->getCmpSelInstrCost(BinaryOperator::Select, RetTy, CondTy,
1470-
CostKind);
1475+
Cost +=
1476+
thisT()->getCmpSelInstrCost(BinaryOperator::Select, RetTy, CondTy,
1477+
CmpInst::BAD_ICMP_PREDICATE, CostKind);
14711478
return Cost;
14721479
}
14731480
case Intrinsic::smul_fix:
@@ -1511,10 +1518,12 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
15111518
// Overflow -> (LHSSign != RHSSign) && (LHSSign != SumSign)
15121519
unsigned Cost = 0;
15131520
Cost += thisT()->getArithmeticInstrCost(Opcode, SumTy, CostKind);
1514-
Cost += 3 * thisT()->getCmpSelInstrCost(BinaryOperator::ICmp, SumTy,
1515-
OverflowTy, CostKind);
1516-
Cost += 2 * thisT()->getCmpSelInstrCost(BinaryOperator::ICmp, OverflowTy,
1517-
OverflowTy, CostKind);
1521+
Cost += 3 * thisT()->getCmpSelInstrCost(
1522+
BinaryOperator::ICmp, SumTy, OverflowTy,
1523+
CmpInst::BAD_ICMP_PREDICATE, CostKind);
1524+
Cost += 2 * thisT()->getCmpSelInstrCost(
1525+
BinaryOperator::ICmp, OverflowTy, OverflowTy,
1526+
CmpInst::BAD_ICMP_PREDICATE, CostKind);
15181527
Cost += thisT()->getArithmeticInstrCost(BinaryOperator::And, OverflowTy,
15191528
CostKind);
15201529
return Cost;
@@ -1529,8 +1538,9 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
15291538

15301539
unsigned Cost = 0;
15311540
Cost += thisT()->getArithmeticInstrCost(Opcode, SumTy, CostKind);
1532-
Cost += thisT()->getCmpSelInstrCost(BinaryOperator::ICmp, SumTy,
1533-
OverflowTy, CostKind);
1541+
Cost +=
1542+
thisT()->getCmpSelInstrCost(BinaryOperator::ICmp, SumTy, OverflowTy,
1543+
CmpInst::BAD_ICMP_PREDICATE, CostKind);
15341544
return Cost;
15351545
}
15361546
case Intrinsic::smul_with_overflow:
@@ -1558,8 +1568,9 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
15581568
CostKind, TTI::OK_AnyValue,
15591569
TTI::OK_UniformConstantValue);
15601570

1561-
Cost += thisT()->getCmpSelInstrCost(BinaryOperator::ICmp, MulTy,
1562-
OverflowTy, CostKind);
1571+
Cost +=
1572+
thisT()->getCmpSelInstrCost(BinaryOperator::ICmp, MulTy, OverflowTy,
1573+
CmpInst::BAD_ICMP_PREDICATE, CostKind);
15631574
return Cost;
15641575
}
15651576
case Intrinsic::ctpop:
@@ -1801,9 +1812,10 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
18011812
(IsPairwise + 1) * thisT()->getShuffleCost(TTI::SK_ExtractSubvector,
18021813
Ty, NumVecElts, SubTy);
18031814
MinMaxCost +=
1804-
thisT()->getCmpSelInstrCost(CmpOpcode, SubTy, CondTy, CostKind) +
1815+
thisT()->getCmpSelInstrCost(CmpOpcode, SubTy, CondTy,
1816+
CmpInst::BAD_ICMP_PREDICATE, CostKind) +
18051817
thisT()->getCmpSelInstrCost(Instruction::Select, SubTy, CondTy,
1806-
CostKind);
1818+
CmpInst::BAD_ICMP_PREDICATE, CostKind);
18071819
Ty = SubTy;
18081820
++LongVectorCount;
18091821
}
@@ -1825,9 +1837,10 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
18251837
thisT()->getShuffleCost(TTI::SK_PermuteSingleSrc, Ty, 0, Ty);
18261838
MinMaxCost +=
18271839
NumReduxLevels *
1828-
(thisT()->getCmpSelInstrCost(CmpOpcode, Ty, CondTy, CostKind) +
1840+
(thisT()->getCmpSelInstrCost(CmpOpcode, Ty, CondTy,
1841+
CmpInst::BAD_ICMP_PREDICATE, CostKind) +
18291842
thisT()->getCmpSelInstrCost(Instruction::Select, Ty, CondTy,
1830-
CostKind));
1843+
CmpInst::BAD_ICMP_PREDICATE, CostKind));
18311844
// The last min/max should be in vector registers and we counted it above.
18321845
// So just need a single extractelement.
18331846
return ShuffleCost + MinMaxCost +

llvm/lib/Analysis/TargetTransformInfo.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -734,11 +734,13 @@ int TargetTransformInfo::getCFInstrCost(unsigned Opcode,
734734

735735
int TargetTransformInfo::getCmpSelInstrCost(unsigned Opcode, Type *ValTy,
736736
Type *CondTy,
737+
CmpInst::Predicate VecPred,
737738
TTI::TargetCostKind CostKind,
738739
const Instruction *I) const {
739740
assert((I == nullptr || I->getOpcode() == Opcode) &&
740741
"Opcode should reflect passed instruction.");
741-
int Cost = TTIImpl->getCmpSelInstrCost(Opcode, ValTy, CondTy, CostKind, I);
742+
int Cost =
743+
TTIImpl->getCmpSelInstrCost(Opcode, ValTy, CondTy, VecPred, CostKind, I);
742744
assert(Cost >= 0 && "TTI should not produce negative costs!");
743745
return Cost;
744746
}

llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1841,7 +1841,8 @@ static SUnit *popFromQueueImpl(std::vector<SUnit *> &Q, SF &Picker) {
18411841
unsigned BestIdx = 0;
18421842
// Only compute the cost for the first 1000 items in the queue, to avoid
18431843
// excessive compile-times for very large queues.
1844-
for (unsigned I = 1, E = std::min(Q.size(), 1000ul); I != E; I++)
1844+
for (unsigned I = 1, E = std::min(Q.size(), (decltype(Q.size()))1000); I != E;
1845+
I++)
18451846
if (Picker(Q[BestIdx], Q[I]))
18461847
BestIdx = I;
18471848
SUnit *V = Q[BestIdx];

llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp

Lines changed: 27 additions & 4 deletions
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

@@ -642,19 +644,40 @@ int AArch64TTIImpl::getAddressComputationCost(Type *Ty, ScalarEvolution *SE,
642644
}
643645

644646
int AArch64TTIImpl::getCmpSelInstrCost(unsigned Opcode, Type *ValTy,
645-
Type *CondTy,
647+
Type *CondTy, CmpInst::Predicate VecPred,
646648
TTI::TargetCostKind CostKind,
647649
const Instruction *I) {
648650
// TODO: Handle other cost kinds.
649651
if (CostKind != TTI::TCK_RecipThroughput)
650-
return BaseT::getCmpSelInstrCost(Opcode, ValTy, CondTy, CostKind, I);
652+
return BaseT::getCmpSelInstrCost(Opcode, ValTy, CondTy, VecPred, CostKind,
653+
I);
651654

652655
int ISD = TLI->InstructionOpcodeToISD(Opcode);
653656
// We don't lower some vector selects well that are wider than the register
654657
// width.
655658
if (ValTy->isVectorTy() && ISD == ISD::SELECT) {
656659
// We would need this many instructions to hide the scalarization happening.
657660
const int AmortizationCost = 20;
661+
662+
// If VecPred is not set, check if we can get a predicate from the context
663+
// instruction, if its type matches the requested ValTy.
664+
if (VecPred == CmpInst::BAD_ICMP_PREDICATE && I && I->getType() == ValTy) {
665+
CmpInst::Predicate CurrentPred;
666+
if (match(I, m_Select(m_Cmp(CurrentPred, m_Value(), m_Value()), m_Value(),
667+
m_Value())))
668+
VecPred = CurrentPred;
669+
}
670+
// Check if we have a compare/select chain that can be lowered using CMxx &
671+
// BFI pair.
672+
if (CmpInst::isIntPredicate(VecPred)) {
673+
static const auto ValidMinMaxTys = {MVT::v8i8, MVT::v16i8, MVT::v4i16,
674+
MVT::v8i16, MVT::v2i32, MVT::v4i32,
675+
MVT::v2i64};
676+
auto LT = TLI->getTypeLegalizationCost(DL, ValTy);
677+
if (any_of(ValidMinMaxTys, [&LT](MVT M) { return M == LT.second; }))
678+
return LT.first;
679+
}
680+
658681
static const TypeConversionCostTblEntry
659682
VectorSelectTbl[] = {
660683
{ ISD::SELECT, MVT::v16i1, MVT::v16i16, 16 },
@@ -674,7 +697,7 @@ int AArch64TTIImpl::getCmpSelInstrCost(unsigned Opcode, Type *ValTy,
674697
return Entry->Cost;
675698
}
676699
}
677-
return BaseT::getCmpSelInstrCost(Opcode, ValTy, CondTy, CostKind, I);
700+
return BaseT::getCmpSelInstrCost(Opcode, ValTy, CondTy, VecPred, CostKind, I);
678701
}
679702

680703
AArch64TTIImpl::TTI::MemCmpExpansionOptions

llvm/lib/Target/AArch64/AArch64TargetTransformInfo.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ class AArch64TTIImpl : public BasicTTIImplBase<AArch64TTIImpl> {
137137
int getAddressComputationCost(Type *Ty, ScalarEvolution *SE, const SCEV *Ptr);
138138

139139
int getCmpSelInstrCost(unsigned Opcode, Type *ValTy, Type *CondTy,
140+
CmpInst::Predicate VecPred,
140141
TTI::TargetCostKind CostKind,
141142
const Instruction *I = nullptr);
142143

llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -580,11 +580,13 @@ int ARMTTIImpl::getVectorInstrCost(unsigned Opcode, Type *ValTy,
580580
}
581581

582582
int ARMTTIImpl::getCmpSelInstrCost(unsigned Opcode, Type *ValTy, Type *CondTy,
583+
CmpInst::Predicate VecPred,
583584
TTI::TargetCostKind CostKind,
584585
const Instruction *I) {
585586
// TODO: Handle other cost kinds.
586587
if (CostKind != TTI::TCK_RecipThroughput)
587-
return BaseT::getCmpSelInstrCost(Opcode, ValTy, CondTy, CostKind, I);
588+
return BaseT::getCmpSelInstrCost(Opcode, ValTy, CondTy, VecPred, CostKind,
589+
I);
588590

589591
int ISD = TLI->InstructionOpcodeToISD(Opcode);
590592
// On NEON a vector select gets lowered to vbsl.
@@ -612,8 +614,8 @@ int ARMTTIImpl::getCmpSelInstrCost(unsigned Opcode, Type *ValTy, Type *CondTy,
612614
int BaseCost = ST->hasMVEIntegerOps() && ValTy->isVectorTy()
613615
? ST->getMVEVectorCostFactor()
614616
: 1;
615-
return BaseCost * BaseT::getCmpSelInstrCost(Opcode, ValTy, CondTy, CostKind,
616-
I);
617+
return BaseCost *
618+
BaseT::getCmpSelInstrCost(Opcode, ValTy, CondTy, VecPred, CostKind, I);
617619
}
618620

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

llvm/lib/Target/ARM/ARMTargetTransformInfo.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ class ARMTTIImpl : public BasicTTIImplBase<ARMTTIImpl> {
211211
const Instruction *I = nullptr);
212212

213213
int getCmpSelInstrCost(unsigned Opcode, Type *ValTy, Type *CondTy,
214+
CmpInst::Predicate VecPred,
214215
TTI::TargetCostKind CostKind,
215216
const Instruction *I = nullptr);
216217

llvm/lib/Target/Hexagon/HexagonTargetTransformInfo.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,13 +239,16 @@ unsigned HexagonTTIImpl::getInterleavedMemoryOpCost(
239239
}
240240

241241
unsigned HexagonTTIImpl::getCmpSelInstrCost(unsigned Opcode, Type *ValTy,
242-
Type *CondTy, TTI::TargetCostKind CostKind, const Instruction *I) {
242+
Type *CondTy,
243+
CmpInst::Predicate VecPred,
244+
TTI::TargetCostKind CostKind,
245+
const Instruction *I) {
243246
if (ValTy->isVectorTy() && CostKind == TTI::TCK_RecipThroughput) {
244247
std::pair<int, MVT> LT = TLI.getTypeLegalizationCost(DL, ValTy);
245248
if (Opcode == Instruction::FCmp)
246249
return LT.first + FloatFactor * getTypeNumElements(ValTy);
247250
}
248-
return BaseT::getCmpSelInstrCost(Opcode, ValTy, CondTy, CostKind, I);
251+
return BaseT::getCmpSelInstrCost(Opcode, ValTy, CondTy, VecPred, CostKind, I);
249252
}
250253

251254
unsigned HexagonTTIImpl::getArithmeticInstrCost(

llvm/lib/Target/Hexagon/HexagonTargetTransformInfo.h

Lines changed: 2 additions & 0 deletions
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(

llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -793,9 +793,11 @@ int PPCTTIImpl::getCastInstrCost(unsigned Opcode, Type *Dst, Type *Src,
793793
}
794794

795795
int PPCTTIImpl::getCmpSelInstrCost(unsigned Opcode, Type *ValTy, Type *CondTy,
796+
CmpInst::Predicate VecPred,
796797
TTI::TargetCostKind CostKind,
797798
const Instruction *I) {
798-
int Cost = BaseT::getCmpSelInstrCost(Opcode, ValTy, CondTy, CostKind, I);
799+
int Cost =
800+
BaseT::getCmpSelInstrCost(Opcode, ValTy, CondTy, VecPred, CostKind, I);
799801
// TODO: Handle other cost kinds.
800802
if (CostKind != TTI::TCK_RecipThroughput)
801803
return Cost;

0 commit comments

Comments
 (0)