[PATCH] D149993: [SLP][NFC] Cleanup: Separate vectorization of Inserts and CmpInsts.

Alexey Bataev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 5 14:09:28 PDT 2023


ABataev added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:14732-14736
+      if (it->isTerminator()) {
+        OpsChanged |= vectorizeCmpInsts(reverse(PostProcessCmps), BB, R);
+        PostProcessCmps.clear();
+      }
+      PostProcessInserts.clear();
----------------
vporpo wrote:
> ABataev wrote:
> > You have to duplicate the same code, which is more complex than before
> The check for `it->isTerminator()` controls whether we vectorize CmpInsts. Hiding it within `vectorizeSimpleInstructions` is just confusing and makes it harder to read.
> To avoid repeating the code we can use a lambda for this, but the separation of vectorizing Inserts and CmpInsts should be clear. Wdyt?
You can try, but check that the logic does not become more complex than before.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D149993



More information about the llvm-commits mailing list