[PATCH] D44742: [SLP] Stop counting cost of gather sequences with multiple uses

Alexey Bataev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 21 09:50:55 PDT 2018


ABataev added inline comments.


================
Comment at: lib/Transforms/Vectorize/SLPVectorizer.cpp:2476-2481
+      auto It =
+          std::find_if(std::next(VectorizableTree.begin(), I + 1),
+                       VectorizableTree.end(), [TE](TreeEntry &Entry) {
+                         return Entry.NeedToGather && Entry.isSame(TE.Scalars);
+                       });
+      if (It != VectorizableTree.end())
----------------
I think you can use `std::any_of`


================
Comment at: test/Transforms/SLPVectorizer/AArch64/gather-cost.ll:1
+; RUN: opt < %s -S -slp-vectorizer -instcombine -pass-remarks-output=%t | FileCheck %s
+; RUN: cat %t | FileCheck -check-prefix=REMARK %s
----------------
1. Commit this test as a separate NFC patch with the current codegen and then update it to show changes.
2. use `utils/update_test_checks.py` to generate test checks.


Repository:
  rL LLVM

https://reviews.llvm.org/D44742





More information about the llvm-commits mailing list