[llvm-branch-commits] [llvm] [SLP][modularisation][NFC] Move full-vector width helpers to SLPTypeUtils (2/2) (PR #214673)

Alexey Bataev via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Sun Aug 9 15:21:18 PDT 2026


================
@@ -41,6 +43,32 @@ Type *getValueType(Value *V, bool LookThroughCmp = false);
 /// \returns the vector type of ScalarTy based on vectorization factor.
 Type *getWidenedType(Type *ScalarTy, unsigned VF);
 
+/// Returns the number of elements of the given type \p Ty, not less than \p Sz,
+/// which forms type, which splits by \p TTI into whole vector types during
+/// legalization.
+unsigned getFullVectorNumberOfElements(const TargetTransformInfo &TTI, Type *Ty,
+                                       unsigned Sz);
+
+/// Returns the number of elements of the given type \p Ty, not greater than \p
+/// Sz, which forms type, which splits by \p TTI into whole vector types during
+/// legalization.
+unsigned getFloorFullVectorNumberOfElements(const TargetTransformInfo &TTI,
+                                            Type *Ty, unsigned Sz);
+
+/// For a non-power-of-2 \p NumElts-wide integer div/rem \p Opcode, returns the
+/// padded full-register vector type if padding is structurally possible, or
+/// nullptr if the vector already fills a register or the opcode is not
+/// div/rem. Does not check profitability; see getMaskedDivRemCost for that.
----------------
alexey-bataev wrote:

```suggestion
/// div/rem. Does not check profitability.
```
since getMaskedDivRemCost is in another file

https://github.com/llvm/llvm-project/pull/214673


More information about the llvm-branch-commits mailing list