|
23 | 23 |
|
24 | 24 | #include "llvm/ADT/APInt.h" |
25 | 25 | #include "llvm/ADT/ArrayRef.h" |
| 26 | +#include "llvm/Analysis/IVDescriptors.h" |
26 | 27 | #include "llvm/IR/FMF.h" |
27 | 28 | #include "llvm/IR/InstrTypes.h" |
28 | 29 | #include "llvm/IR/PassManager.h" |
@@ -1777,8 +1778,9 @@ class TargetTransformInfo { |
1777 | 1778 | /// vectorization, false - otherwise. |
1778 | 1779 | bool preferAlternateOpcodeVectorization() const; |
1779 | 1780 |
|
1780 | | - /// \returns True if the target prefers reductions in loop. |
1781 | | - bool preferInLoopReduction(unsigned Opcode, Type *Ty) const; |
| 1781 | + /// \returns True if the target prefers reductions of \p Kind to be performed |
| 1782 | + /// in the loop. |
| 1783 | + bool preferInLoopReduction(RecurKind Kind, Type *Ty) const; |
1782 | 1784 |
|
1783 | 1785 | /// \returns True if the target prefers reductions select kept in the loop |
1784 | 1786 | /// when tail folding. i.e. |
@@ -2330,7 +2332,7 @@ class TargetTransformInfo::Concept { |
2330 | 2332 | unsigned ChainSizeInBytes, |
2331 | 2333 | VectorType *VecTy) const = 0; |
2332 | 2334 | virtual bool preferFixedOverScalableIfEqualCost() const = 0; |
2333 | | - virtual bool preferInLoopReduction(unsigned Opcode, Type *Ty) const = 0; |
| 2335 | + virtual bool preferInLoopReduction(RecurKind Kind, Type *Ty) const = 0; |
2334 | 2336 | virtual bool preferPredicatedReductionSelect(unsigned Opcode, |
2335 | 2337 | Type *Ty) const = 0; |
2336 | 2338 | virtual bool preferAlternateOpcodeVectorization() const = 0; |
@@ -3143,8 +3145,8 @@ class TargetTransformInfo::Model final : public TargetTransformInfo::Concept { |
3143 | 3145 | bool preferFixedOverScalableIfEqualCost() const override { |
3144 | 3146 | return Impl.preferFixedOverScalableIfEqualCost(); |
3145 | 3147 | } |
3146 | | - bool preferInLoopReduction(unsigned Opcode, Type *Ty) const override { |
3147 | | - return Impl.preferInLoopReduction(Opcode, Ty); |
| 3148 | + bool preferInLoopReduction(RecurKind Kind, Type *Ty) const override { |
| 3149 | + return Impl.preferInLoopReduction(Kind, Ty); |
3148 | 3150 | } |
3149 | 3151 | bool preferAlternateOpcodeVectorization() const override { |
3150 | 3152 | return Impl.preferAlternateOpcodeVectorization(); |
|
0 commit comments