[PATCH] D8943: Calculate vectorization factor using the narrowest type instead of widest type

hfinkel@anl.gov via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 28 17:58:39 PDT 2015


hfinkel accepted this revision.
hfinkel added a comment.

LGTM.

After you commit, send a message to llvmdev asking people to test with the flag enabled.


================
Comment at: lib/Transforms/Vectorize/LoopVectorize.cpp:5166
@@ +5165,3 @@
+        auto TypeSize =
+            (unsigned)DL.getTypeSizeInBits(Inst->getType()->getScalarType());
+        RegUsage += std::max<unsigned>(1, VFs[j] * TypeSize / WidestRegister);
----------------
hfinkel wrote:
> Does this do the right thing for stores? For stores, you want the type of the stored value, right?
Okay, that makes sense. The register will be accounted for at its source.


http://reviews.llvm.org/D8943





More information about the llvm-commits mailing list