[PATCH] D57779: [SLP] Add support for throttling.

Alexey Bataev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 21 12:56:34 PDT 2019


ABataev added inline comments.


================
Comment at: lib/Transforms/Vectorize/SLPVectorizer.cpp:2487
+  // to populate ExternalUser list with canceled elements.
+  for (unsigned I = 0, E = ScalarizeAt; I <= E; I++) {
+    TreeEntry *Entry = &VectorizableTree[I];
----------------
No need for `E` here


================
Comment at: lib/Transforms/Vectorize/SLPVectorizer.cpp:2755
+    int ScalarizeAtSpillCost = 0;
+    for (unsigned I = VectorizableTree.size()-1; I > 0; I--) {
+      TreeEntry *Entry = &VectorizableTree[I];
----------------
1. Unformatted.
2. Use `--I`;
3. Are you sure that the exit condition is correct? Maybe `>=`, since you start from `size()-1`?


================
Comment at: lib/Transforms/Vectorize/SLPVectorizer.cpp:4413
+  BS->initialFillReadyList(BS->ReadyInsts);
+  for (auto *I = BS->ScheduleStart; I != BS->ScheduleEnd;
+       I = I->getNextNode()) {
----------------
Replace `auto` here with the real type.


================
Comment at: lib/Transforms/Vectorize/SLPVectorizer.cpp:4732
                        << NV("TreeSize", R.getTreeSize()));
-
       R.vectorizeTree();
----------------
Restore


================
Comment at: lib/Transforms/Vectorize/SLPVectorizer.cpp:4921
+    assert(isa<StoreInst>(V) && "Expected only StoreInst here!");
+    if (StoreInst *SI = cast<StoreInst>(V))
+      if (SI->getValueOperand())
----------------
`StoreInst *`->`auto *`


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57779/new/

https://reviews.llvm.org/D57779





More information about the llvm-commits mailing list