diff --git a/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.h b/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.h --- a/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.h +++ b/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.h @@ -163,8 +163,7 @@ 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, diff --git a/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp b/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp --- a/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp +++ b/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp @@ -2049,10 +2049,8 @@ // %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 @@ // The cast will be free for the s/urhadd instructions if ((isa(I) || isa(I)) && - isExtPartOfAvgExpr(SingleUser, cast(I), Dst, Src)) + isExtPartOfAvgExpr(SingleUser, Dst, Src)) return 0; }