Skip to content

Commit 688bccb

Browse files
authored
[TTI][LV] Simplify the prototype of preferPredicatedReductionSelect. nfc (llvm#139265)
1 parent d102e90 commit 688bccb

File tree

7 files changed

+10
-20
lines changed

7 files changed

+10
-20
lines changed

llvm/include/llvm/Analysis/TargetTransformInfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1797,7 +1797,7 @@ class TargetTransformInfo {
17971797
/// As opposed to the normal scheme of p = phi (0, a) which allows the select
17981798
/// to be pulled out of the loop. If the select(.., add, ..) can be predicated
17991799
/// by the target, this can lead to cleaner code generation.
1800-
bool preferPredicatedReductionSelect(unsigned Opcode, Type *Ty) const;
1800+
bool preferPredicatedReductionSelect() const;
18011801

18021802
/// Return true if the loop vectorizer should consider vectorizing an
18031803
/// otherwise scalar epilogue loop.

llvm/include/llvm/Analysis/TargetTransformInfoImpl.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,10 +1087,7 @@ class TargetTransformInfoImplBase {
10871087
}
10881088
virtual bool preferAlternateOpcodeVectorization() const { return true; }
10891089

1090-
virtual bool preferPredicatedReductionSelect(unsigned Opcode,
1091-
Type *Ty) const {
1092-
return false;
1093-
}
1090+
virtual bool preferPredicatedReductionSelect() const { return false; }
10941091

10951092
virtual bool preferEpilogueVectorization() const { return true; }
10961093

llvm/lib/Analysis/TargetTransformInfo.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1395,9 +1395,8 @@ bool TargetTransformInfo::preferAlternateOpcodeVectorization() const {
13951395
return TTIImpl->preferAlternateOpcodeVectorization();
13961396
}
13971397

1398-
bool TargetTransformInfo::preferPredicatedReductionSelect(unsigned Opcode,
1399-
Type *Ty) const {
1400-
return TTIImpl->preferPredicatedReductionSelect(Opcode, Ty);
1398+
bool TargetTransformInfo::preferPredicatedReductionSelect() const {
1399+
return TTIImpl->preferPredicatedReductionSelect();
14011400
}
14021401

14031402
bool TargetTransformInfo::preferEpilogueVectorization() const {

llvm/lib/Target/AArch64/AArch64TargetTransformInfo.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -435,10 +435,7 @@ class AArch64TTIImpl : public BasicTTIImplBase<AArch64TTIImpl> {
435435
bool isLegalToVectorizeReduction(const RecurrenceDescriptor &RdxDesc,
436436
ElementCount VF) const override;
437437

438-
bool preferPredicatedReductionSelect(unsigned Opcode,
439-
Type *Ty) const override {
440-
return ST->hasSVE();
441-
}
438+
bool preferPredicatedReductionSelect() const override { return ST->hasSVE(); }
442439

443440
InstructionCost
444441
getArithmeticReductionCost(unsigned Opcode, VectorType *Ty,

llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2704,8 +2704,7 @@ bool ARMTTIImpl::preferInLoopReduction(RecurKind Kind, Type *Ty) const {
27042704
}
27052705
}
27062706

2707-
bool ARMTTIImpl::preferPredicatedReductionSelect(unsigned Opcode,
2708-
Type *Ty) const {
2707+
bool ARMTTIImpl::preferPredicatedReductionSelect() const {
27092708
if (!ST->hasMVEIntegerOps())
27102709
return false;
27112710
return true;

llvm/lib/Target/ARM/ARMTargetTransformInfo.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,7 @@ class ARMTTIImpl : public BasicTTIImplBase<ARMTTIImpl> {
230230

231231
bool preferInLoopReduction(RecurKind Kind, Type *Ty) const override;
232232

233-
bool preferPredicatedReductionSelect(unsigned Opcode,
234-
Type *Ty) const override;
233+
bool preferPredicatedReductionSelect() const override;
235234

236235
bool shouldExpandReduction(const IntrinsicInst *II) const override {
237236
return false;

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1446,13 +1446,13 @@ class LoopVectorizationCostModel {
14461446

14471447
/// Returns true if the predicated reduction select should be used to set the
14481448
/// incoming value for the reduction phi.
1449-
bool usePredicatedReductionSelect(unsigned Opcode, Type *PhiTy) const {
1449+
bool usePredicatedReductionSelect() const {
14501450
// Force to use predicated reduction select since the EVL of the
14511451
// second-to-last iteration might not be VF*UF.
14521452
if (foldTailWithEVL())
14531453
return true;
14541454
return PreferPredicatedReductionSelect ||
1455-
TTI.preferPredicatedReductionSelect(Opcode, PhiTy);
1455+
TTI.preferPredicatedReductionSelect();
14561456
}
14571457

14581458
/// Estimate cost of an intrinsic call instruction CI if it were vectorized
@@ -9909,8 +9909,7 @@ void LoopVectorizationPlanner::adjustRecipesForReductions(
99099909
cast<VPInstruction>(&U)->getOpcode() ==
99109910
VPInstruction::ComputeFindLastIVResult);
99119911
});
9912-
if (CM.usePredicatedReductionSelect(
9913-
PhiR->getRecurrenceDescriptor().getOpcode(), PhiTy))
9912+
if (CM.usePredicatedReductionSelect())
99149913
PhiR->setOperand(1, NewExitingVPV);
99159914
}
99169915

0 commit comments

Comments
 (0)