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

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 19 14:42:24 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) {
----------------
fhahn wrote:

Ah right, thanks, I guess I got confused mixing the terminology.

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


More information about the llvm-commits mailing list