Skip to content

Commit f41223e

Browse files
committed
[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
1 parent 8fb12f8 commit f41223e

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2049,10 +2049,8 @@ bool AArch64TTIImpl::isWideningInstruction(Type *DstTy, unsigned Opcode,
20492049
// %y = (zext i8 -> i16)
20502050
// trunc i16 (lshr (add %x, %y), 1) -> i8
20512051
//
2052-
bool AArch64TTIImpl::isExtPartOfAvgExpr(const Instruction *ExtUser,
2053-
const CastInst *Ext, Type *Dst,
2052+
bool AArch64TTIImpl::isExtPartOfAvgExpr(const Instruction *ExtUser, Type *Dst,
20542053
Type *Src) {
2055-
20562054
// The source should be a legal vector type.
20572055
if (!Src->isVectorTy() || !TLI->isTypeLegal(TLI->getValueType(DL, Src)) ||
20582056
(Src->isScalableTy() && !ST->hasSVE2()))
@@ -2120,7 +2118,7 @@ InstructionCost AArch64TTIImpl::getCastInstrCost(unsigned Opcode, Type *Dst,
21202118

21212119
// The cast will be free for the s/urhadd instructions
21222120
if ((isa<ZExtInst>(I) || isa<SExtInst>(I)) &&
2123-
isExtPartOfAvgExpr(SingleUser, cast<CastInst>(I), Dst, Src))
2121+
isExtPartOfAvgExpr(SingleUser, Dst, Src))
21242122
return 0;
21252123
}
21262124

llvm/lib/Target/AArch64/AArch64TargetTransformInfo.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,7 @@ class AArch64TTIImpl : public BasicTTIImplBase<AArch64TTIImpl> {
163163
TTI::TargetCostKind CostKind,
164164
const Instruction *I = nullptr);
165165

166-
bool isExtPartOfAvgExpr(const Instruction *ExtUser, const CastInst *Ext,
167-
Type *Dst, Type *Src);
166+
bool isExtPartOfAvgExpr(const Instruction *ExtUser, Type *Dst, Type *Src);
168167

169168
InstructionCost getCastInstrCost(unsigned Opcode, Type *Dst, Type *Src,
170169
TTI::CastContextHint CCH,

0 commit comments

Comments
 (0)