@@ -1771,6 +1771,10 @@ class TargetTransformInfo {
1771
1771
// / scalable version of the vectorized loop.
1772
1772
bool preferFixedOverScalableIfEqualCost () const ;
1773
1773
1774
+ // / \returns True if target prefers SLP vectorizer with altermate opcode
1775
+ // / vectorization, false - otherwise.
1776
+ bool preferAlternateOpcodeVectorization () const ;
1777
+
1774
1778
// / \returns True if the target prefers reductions in loop.
1775
1779
bool preferInLoopReduction (unsigned Opcode, Type *Ty) const ;
1776
1780
@@ -2325,6 +2329,7 @@ class TargetTransformInfo::Concept {
2325
2329
virtual bool preferInLoopReduction (unsigned Opcode, Type *Ty) const = 0;
2326
2330
virtual bool preferPredicatedReductionSelect (unsigned Opcode,
2327
2331
Type *Ty) const = 0;
2332
+ virtual bool preferAlternateOpcodeVectorization () const = 0;
2328
2333
virtual bool preferEpilogueVectorization () const = 0;
2329
2334
2330
2335
virtual bool shouldExpandReduction (const IntrinsicInst *II) const = 0;
@@ -3135,6 +3140,9 @@ class TargetTransformInfo::Model final : public TargetTransformInfo::Concept {
3135
3140
bool preferInLoopReduction (unsigned Opcode, Type *Ty) const override {
3136
3141
return Impl.preferInLoopReduction (Opcode, Ty);
3137
3142
}
3143
+ bool preferAlternateOpcodeVectorization () const override {
3144
+ return Impl.preferAlternateOpcodeVectorization ();
3145
+ }
3138
3146
bool preferPredicatedReductionSelect (unsigned Opcode,
3139
3147
Type *Ty) const override {
3140
3148
return Impl.preferPredicatedReductionSelect (Opcode, Ty);
0 commit comments