[AArch64][SVE2] Delete an unused parameter for isExtPartOfAvgExpr, NFC

Depend on D157628, which set the cost of extends 0 because they will fold into
the s/urhadd.

Reviewed By: kmclaughlin
Differential Revision: https://reviews.llvm.org/D159273
This commit is contained in:
zhongyunde
2023-09-01 23:40:21 +08:00
parent 8fb12f8ade
commit f41223eeca
2 changed files with 3 additions and 6 deletions

View File

@@ -2049,10 +2049,8 @@ bool AArch64TTIImpl::isWideningInstruction(Type *DstTy, unsigned Opcode,
// %y = (zext i8 -> i16)
// trunc i16 (lshr (add %x, %y), 1) -> i8
//
bool AArch64TTIImpl::isExtPartOfAvgExpr(const Instruction *ExtUser,
const CastInst *Ext, Type *Dst,
bool AArch64TTIImpl::isExtPartOfAvgExpr(const Instruction *ExtUser, Type *Dst,
Type *Src) {
// The source should be a legal vector type.
if (!Src->isVectorTy() || !TLI->isTypeLegal(TLI->getValueType(DL, Src)) ||
(Src->isScalableTy() && !ST->hasSVE2()))
@@ -2120,7 +2118,7 @@ InstructionCost AArch64TTIImpl::getCastInstrCost(unsigned Opcode, Type *Dst,
// The cast will be free for the s/urhadd instructions
if ((isa<ZExtInst>(I) || isa<SExtInst>(I)) &&
isExtPartOfAvgExpr(SingleUser, cast<CastInst>(I), Dst, Src))
isExtPartOfAvgExpr(SingleUser, Dst, Src))
return 0;
}

View File

@@ -163,8 +163,7 @@ public:
TTI::TargetCostKind CostKind,
const Instruction *I = nullptr);
bool isExtPartOfAvgExpr(const Instruction *ExtUser, const CastInst *Ext,
Type *Dst, Type *Src);
bool isExtPartOfAvgExpr(const Instruction *ExtUser, Type *Dst, Type *Src);
InstructionCost getCastInstrCost(unsigned Opcode, Type *Dst, Type *Src,
TTI::CastContextHint CCH,