Skip to content

Commit ad745b3

Browse files
authored
Merge pull request #5852 from zjaffal/stable/20220421
Revert "[AArch64] Fix cost model for `udiv` instruction when one of t…
2 parents 2a76faf + 205bdc2 commit ad745b3

File tree

2 files changed

+45
-57
lines changed

2 files changed

+45
-57
lines changed

llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1835,18 +1835,6 @@ InstructionCost AArch64TTIImpl::getArithmeticInstrCost(
18351835
InstructionCost Cost = BaseT::getArithmeticInstrCost(
18361836
Opcode, Ty, CostKind, Opd1Info, Opd2Info, Opd1PropInfo, Opd2PropInfo);
18371837
if (Ty->isVectorTy()) {
1838-
// If one of the operands is a uniform constant then the cost for each
1839-
// element is Cost for insertion, extraction and division.
1840-
// Insertion cost = 2, Extraction Cost = 2, Division = cost for the
1841-
// operation with scalar type
1842-
if ( Opd1Info == TargetTransformInfo::OK_UniformConstantValue ||
1843-
Opd2Info == TargetTransformInfo::OK_UniformConstantValue) {
1844-
if (auto *VTy = dyn_cast<FixedVectorType>(Ty)) {
1845-
InstructionCost DivCost = BaseT::getArithmeticInstrCost(
1846-
Opcode, Ty->getScalarType(), CostKind, Opd1Info, Opd2Info);
1847-
return (4 + DivCost) * VTy->getNumElements();
1848-
}
1849-
}
18501838
// On AArch64, vector divisions are not supported natively and are
18511839
// expanded into scalar divisions of each pair of elements.
18521840
Cost += getArithmeticInstrCost(Instruction::ExtractElement, Ty, CostKind,

0 commit comments

Comments
 (0)