[PATCH] D14185: Extend SLP Vectorizer to deal with aggregates
Arnold Schwaighofer via llvm-commits
llvm-commits at lists.llvm.org
Sun Nov 1 09:34:25 PST 2015
aschwaighofer added inline comments.
================
Comment at: lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp:875
@@ +874,3 @@
+ }
+ }
+ return U;
----------------
I think we must also check for DataLayout::getTypeSizeInBits(VectorType) == DataLayout::getTypeSizeInBits(StructType/ArrayType) to show that it is truly isomorphic.
The allocated size for elements in an aggregate might be different because of padding.
For example: {<i2, i2>} != <2 x i2>
================
Comment at: lib/Transforms/Vectorize/SLPVectorizer.cpp:279
@@ +278,3 @@
+/// \returns number of elements in vector if isomorphism exists, 0 otherwise.
+static unsigned canMapToVector(Type *T) {
+ unsigned N;
----------------
Similar to my previous comment we must check that the type sizes are equivalent.
http://reviews.llvm.org/D14185
More information about the llvm-commits
mailing list