@@ -1771,6 +1771,10 @@ class TargetTransformInfo {
17711771 // / scalable version of the vectorized loop.
17721772 bool preferFixedOverScalableIfEqualCost () const ;
17731773
1774+ // / \returns True if target prefers SLP vectorizer with altermate opcode
1775+ // / vectorization, false - otherwise.
1776+ bool preferAlternateOpcodeVectorization () const ;
1777+
17741778 // / \returns True if the target prefers reductions in loop.
17751779 bool preferInLoopReduction (unsigned Opcode, Type *Ty) const ;
17761780
@@ -2325,6 +2329,7 @@ class TargetTransformInfo::Concept {
23252329 virtual bool preferInLoopReduction (unsigned Opcode, Type *Ty) const = 0;
23262330 virtual bool preferPredicatedReductionSelect (unsigned Opcode,
23272331 Type *Ty) const = 0;
2332+ virtual bool preferAlternateOpcodeVectorization () const = 0;
23282333 virtual bool preferEpilogueVectorization () const = 0;
23292334
23302335 virtual bool shouldExpandReduction (const IntrinsicInst *II) const = 0;
@@ -3135,6 +3140,9 @@ class TargetTransformInfo::Model final : public TargetTransformInfo::Concept {
31353140 bool preferInLoopReduction (unsigned Opcode, Type *Ty) const override {
31363141 return Impl.preferInLoopReduction (Opcode, Ty);
31373142 }
3143+ bool preferAlternateOpcodeVectorization () const override {
3144+ return Impl.preferAlternateOpcodeVectorization ();
3145+ }
31383146 bool preferPredicatedReductionSelect (unsigned Opcode,
31393147 Type *Ty) const override {
31403148 return Impl.preferPredicatedReductionSelect (Opcode, Ty);
0 commit comments