[llvm] [LV] Teach LoopVectorizationLegality about struct vector calls (PR #119221)

Benjamin Maxwell via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 19 02:17:12 PST 2024


================
@@ -71,6 +75,18 @@ inline bool isVectorizedTy(Type *Ty) {
   return Ty->isVectorTy();
 }
 
+// Returns true if `Ty` is a valid vector element type, void, or an unpacked
+// literal struct where all elements are valid vector element types.
+// Note: Even if a type can be vectorized that does not mean it is valid to do
+// so in all cases. For example, a vectorized struct (as returned by
+// toVectorizedTy) does not perform (de)interleaving, so it can't be used for
+// vectorizing loads/stores.
+inline bool canVectorizeTy(Type *Ty) {
----------------
MacDue wrote:

No, the meaning of `canVectorizeTy()` here follows the `toVectorizedTy()`. In LVL `canWidenCallReturnType()` is what is used in LVL (which adds additional restrictions on `canVectorizeTy()`).  

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


More information about the llvm-commits mailing list