|
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" |
@@ -1776,7 +1777,7 @@ class TargetTransformInfo { |
1776 | 1777 | bool preferAlternateOpcodeVectorization() const; |
1777 | 1778 |
|
1778 | 1779 | /// \returns True if the target prefers reductions in loop. |
1779 | | - bool preferInLoopReduction(unsigned Opcode, Type *Ty) const; |
| 1780 | + bool preferInLoopReduction(RecurKind Kind, Type *Ty) const; |
1780 | 1781 |
|
1781 | 1782 | /// \returns True if the target prefers reductions select kept in the loop |
1782 | 1783 | /// when tail folding. i.e. |
@@ -2326,7 +2327,7 @@ class TargetTransformInfo::Concept { |
2326 | 2327 | unsigned ChainSizeInBytes, |
2327 | 2328 | VectorType *VecTy) const = 0; |
2328 | 2329 | virtual bool preferFixedOverScalableIfEqualCost() const = 0; |
2329 | | - virtual bool preferInLoopReduction(unsigned Opcode, Type *Ty) const = 0; |
| 2330 | + virtual bool preferInLoopReduction(RecurKind Kind, Type *Ty) const = 0; |
2330 | 2331 | virtual bool preferPredicatedReductionSelect(unsigned Opcode, |
2331 | 2332 | Type *Ty) const = 0; |
2332 | 2333 | virtual bool preferAlternateOpcodeVectorization() const = 0; |
@@ -3137,8 +3138,8 @@ class TargetTransformInfo::Model final : public TargetTransformInfo::Concept { |
3137 | 3138 | bool preferFixedOverScalableIfEqualCost() const override { |
3138 | 3139 | return Impl.preferFixedOverScalableIfEqualCost(); |
3139 | 3140 | } |
3140 | | - bool preferInLoopReduction(unsigned Opcode, Type *Ty) const override { |
3141 | | - return Impl.preferInLoopReduction(Opcode, Ty); |
| 3141 | + bool preferInLoopReduction(RecurKind Kind, Type *Ty) const override { |
| 3142 | + return Impl.preferInLoopReduction(Kind, Ty); |
3142 | 3143 | } |
3143 | 3144 | bool preferAlternateOpcodeVectorization() const override { |
3144 | 3145 | return Impl.preferAlternateOpcodeVectorization(); |
|
0 commit comments