Skip to content

Commit

Permalink
[AArch64][SVE2] Delete an unused parameter for isExtPartOfAvgExpr, NFC
Browse files Browse the repository at this point in the history
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
  • Loading branch information
vfdff committed Sep 1, 2023
1 parent 8fb12f8 commit f41223e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
6 changes: 2 additions & 4 deletions llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()))
Expand Down Expand Up @@ -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;
}

Expand Down
3 changes: 1 addition & 2 deletions llvm/lib/Target/AArch64/AArch64TargetTransformInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,7 @@ class AArch64TTIImpl : public BasicTTIImplBase<AArch64TTIImpl> {
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,
Expand Down

0 comments on commit f41223e

Please sign in to comment.