[PATCH] D19504: LoadStoreVectorizer: Check TTI for vec reg bit width

Justin Lebar via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 13 14:04:46 PDT 2016

jlebar added a subscriber: jlebar.
jlebar accepted this revision.
jlebar added a reviewer: jlebar.
This revision is now accepted and ready to land.

Comment at: lib/Transforms/Vectorize/LoadStoreVectorizer.cpp:471
@@ -466,1 +470,3 @@
+      unsigned AS = Ptr->getType()->getPointerAddressSpace();
+      unsigned VecRegSize = TTI.getLoadStoreVecRegBitWidth(AS);
       // No point in looking at these if they're too big to vectorize.
Nit, since all we actually want is VecRegSize, consider making at least 'AS' a temporary:

  Value *Ptr = LI->getPointerOperand();
  unsigned VecRegSize = TTI.getLoadStoreVecRegBitWidth(Ptr, Ptr->getType()->getPointerAddressSpace());

This way readers have to carry one less local variable.  Same elsewhere.


More information about the llvm-commits mailing list