[llvm] f41223e - [AArch64][SVE2] Delete an unused parameter for isExtPartOfAvgExpr, NFC
via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 1 08:49:52 PDT 2023
Author: zhongyunde
Date: 2023-09-01T23:40:52+08:00
New Revision: f41223eecaeb4d854500a13bd7f9be7529636cb5
URL: https://github.com/llvm/llvm-project/commit/f41223eecaeb4d854500a13bd7f9be7529636cb5
DIFF: https://github.com/llvm/llvm-project/commit/f41223eecaeb4d854500a13bd7f9be7529636cb5.diff
LOG: [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
Added:
Modified:
llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
llvm/lib/Target/AArch64/AArch64TargetTransformInfo.h
Removed:
################################################################################
diff --git a/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp b/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
index 404b5f170d061e..e6209ca12a48c3 100644
--- a/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
+++ b/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
@@ -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;
}
diff --git a/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.h b/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.h
index 4d24a0ef20b649..a6baade412c77d 100644
--- a/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.h
+++ b/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.h
@@ -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,
More information about the llvm-commits
mailing list