|
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" |
@@ -1778,7 +1779,7 @@ class TargetTransformInfo { |
1778 | 1779 | bool preferAlternateOpcodeVectorization() const; |
1779 | 1780 |
|
1780 | 1781 | /// \returns True if the target prefers reductions in loop. |
1781 | | - bool preferInLoopReduction(unsigned Opcode, Type *Ty) const; |
| 1782 | + bool preferInLoopReduction(RecurKind Kind, Type *Ty) const; |
1782 | 1783 |
|
1783 | 1784 | /// \returns True if the target prefers reductions select kept in the loop |
1784 | 1785 | /// when tail folding. i.e. |
@@ -2330,7 +2331,7 @@ class TargetTransformInfo::Concept { |
2330 | 2331 | unsigned ChainSizeInBytes, |
2331 | 2332 | VectorType *VecTy) const = 0; |
2332 | 2333 | virtual bool preferFixedOverScalableIfEqualCost() const = 0; |
2333 | | - virtual bool preferInLoopReduction(unsigned Opcode, Type *Ty) const = 0; |
| 2334 | + virtual bool preferInLoopReduction(RecurKind Kind, Type *Ty) const = 0; |
2334 | 2335 | virtual bool preferPredicatedReductionSelect(unsigned Opcode, |
2335 | 2336 | Type *Ty) const = 0; |
2336 | 2337 | virtual bool preferAlternateOpcodeVectorization() const = 0; |
@@ -3143,8 +3144,8 @@ class TargetTransformInfo::Model final : public TargetTransformInfo::Concept { |
3143 | 3144 | bool preferFixedOverScalableIfEqualCost() const override { |
3144 | 3145 | return Impl.preferFixedOverScalableIfEqualCost(); |
3145 | 3146 | } |
3146 | | - bool preferInLoopReduction(unsigned Opcode, Type *Ty) const override { |
3147 | | - return Impl.preferInLoopReduction(Opcode, Ty); |
| 3147 | + bool preferInLoopReduction(RecurKind Kind, Type *Ty) const override { |
| 3148 | + return Impl.preferInLoopReduction(Kind, Ty); |
3148 | 3149 | } |
3149 | 3150 | bool preferAlternateOpcodeVectorization() const override { |
3150 | 3151 | return Impl.preferAlternateOpcodeVectorization(); |
|
0 commit comments