[PATCH] D23473: [LSV] Use a set rather than an ArraySlice at the end of getVectorizablePrefix. NFC

Justin Lebar via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 12 17:12:15 PDT 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL278581: [LSV] Use a set rather than an ArraySlice at the end of getVectorizablePrefix. (authored by jlebar).

Changed prior to commit:
  https://reviews.llvm.org/D23473?vs=67932&id=67944#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D23473

Files:
  llvm/trunk/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp

Index: llvm/trunk/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp
===================================================================
--- llvm/trunk/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp
+++ llvm/trunk/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp
@@ -516,12 +516,11 @@
   // ChainInstrs[0, ChainInstrIdx).  This is the largest vectorizable prefix of
   // Chain.  (Recall that Chain is in address order, but ChainInstrs is in BB
   // order.)
-  auto VectorizableChainInstrs =
-      makeArrayRef(ChainInstrs.data(), ChainInstrIdx);
-  unsigned ChainIdx, ChainLen;
-  for (ChainIdx = 0, ChainLen = Chain.size(); ChainIdx < ChainLen; ++ChainIdx) {
-    Instruction *I = Chain[ChainIdx];
-    if (!is_contained(VectorizableChainInstrs, I))
+  SmallPtrSet<Instruction *, 8> VectorizableChainInstrs(
+      ChainInstrs.begin(), ChainInstrs.begin() + ChainInstrIdx);
+  unsigned ChainIdx = 0;
+  for (unsigned ChainLen = Chain.size(); ChainIdx < ChainLen; ++ChainIdx) {
+    if (!VectorizableChainInstrs.count(Chain[ChainIdx]))
       break;
   }
   return Chain.slice(0, ChainIdx);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D23473.67944.patch
Type: text/x-patch
Size: 1094 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160813/e936b88c/attachment.bin>


More information about the llvm-commits mailing list