Skip to content

Commit 9be511d

Browse files
committed
Revert "FP reduction cost functions (for SLP)"
Wait with this and first evaluate the scalarization costs separately.
1 parent d067ccd commit 9be511d

File tree

6 files changed

+0
-976
lines changed

6 files changed

+0
-976
lines changed

llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.cpp

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1388,57 +1388,6 @@ InstructionCost SystemZTTIImpl::getInterleavedMemoryOpCost(
13881388
return NumVectorMemOps + NumPermutes;
13891389
}
13901390

1391-
// EXPERIMENTAL
1392-
static cl::opt<unsigned> REDLIM("redlim", cl::init(0));
1393-
1394-
InstructionCost getFPReductionCost(unsigned NumVec, unsigned ScalarBits) {
1395-
unsigned NumEltsPerVecReg = (SystemZ::VectorBits / ScalarBits);
1396-
InstructionCost Cost = 0;
1397-
Cost += NumVec - 1; // Full vector operations.
1398-
Cost += NumEltsPerVecReg; // Last vector scalar operations.
1399-
return Cost;
1400-
}
1401-
1402-
InstructionCost
1403-
SystemZTTIImpl::getArithmeticReductionCost(unsigned Opcode, VectorType *Ty,
1404-
std::optional<FastMathFlags> FMF,
1405-
TTI::TargetCostKind CostKind) {
1406-
if (!TTI::requiresOrderedReduction(FMF) && ST->hasVector() &&
1407-
(Opcode == Instruction::FAdd || Opcode == Instruction::FMul)) {
1408-
unsigned NumVectors = getNumVectorRegs(Ty);
1409-
unsigned ScalarBits = Ty->getScalarSizeInBits();
1410-
1411-
// // EXPERIMENTAL: better to not vectorize small vectors?:
1412-
// unsigned NumElts = cast<FixedVectorType>(Ty)->getNumElements();
1413-
// if (NumElts <= REDLIM)
1414-
// return NumVectors * 8; // => MachineCombiner
1415-
1416-
// // EXPERIMENTAL: Return a low cost to enable heavily.
1417-
// return NumVectors / 2;
1418-
1419-
return getFPReductionCost(NumVectors, ScalarBits);
1420-
}
1421-
1422-
return BaseT::getArithmeticReductionCost(Opcode, Ty, FMF, CostKind);
1423-
}
1424-
1425-
InstructionCost
1426-
SystemZTTIImpl::getMinMaxReductionCost(Intrinsic::ID IID, VectorType *Ty,
1427-
FastMathFlags FMF,
1428-
TTI::TargetCostKind CostKind) {
1429-
if (Ty->isFPOrFPVectorTy() && ST->hasVectorEnhancements1()) {
1430-
unsigned NumVectors = getNumVectorRegs(Ty);
1431-
unsigned ScalarBits = Ty->getScalarSizeInBits();
1432-
1433-
// // EXPERIMENTAL: Return a low cost to enable heavily.
1434-
// return NumVectors / 2;
1435-
1436-
return getFPReductionCost(NumVectors, ScalarBits);
1437-
}
1438-
1439-
return BaseT::getMinMaxReductionCost(IID, Ty, FMF, CostKind);
1440-
}
1441-
14421391
static int
14431392
getVectorIntrinsicInstrCost(Intrinsic::ID ID, Type *RetTy,
14441393
const SmallVectorImpl<Type *> &ParamTys) {

llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -129,13 +129,6 @@ class SystemZTTIImpl : public BasicTTIImplBase<SystemZTTIImpl> {
129129
Align Alignment, unsigned AddressSpace, TTI::TargetCostKind CostKind,
130130
bool UseMaskForCond = false, bool UseMaskForGaps = false);
131131

132-
InstructionCost getArithmeticReductionCost(unsigned Opcode, VectorType *Ty,
133-
std::optional<FastMathFlags> FMF,
134-
TTI::TargetCostKind CostKind);
135-
InstructionCost getMinMaxReductionCost(Intrinsic::ID IID, VectorType *Ty,
136-
FastMathFlags FMF,
137-
TTI::TargetCostKind CostKind);
138-
139132
InstructionCost getIntrinsicInstrCost(const IntrinsicCostAttributes &ICA,
140133
TTI::TargetCostKind CostKind);
141134

llvm/test/Analysis/CostModel/SystemZ/vector-reductions-fp.ll

Lines changed: 0 additions & 131 deletions
This file was deleted.

0 commit comments

Comments
 (0)