[PATCH] D114909: [SLP]Outline and fix code for finding common insertelement vectors.

Alexey Bataev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 2 05:50:43 PST 2021


ABataev marked an inline comment as done.
ABataev added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:5398
+    if (IE1) {
+      if (IE1 != VU && !IE1->hasOneUse())
+        IE1 = nullptr;
----------------
vporpo wrote:
> Just curious, why do we need to check for for a single use except for VU and V? Is this related to the bug you mentioned in the patch summary?
It is an early exit (which can be considered as a bugfix but not one mentioned in the description). Insertelements with multiple uses are not the part of the buildvector, they can only be used as an initial element for the buildvector sequence. We have a similar check in `findBuildAggregate_rec` function (requires only a single use for the insertelement instruction).
The bugfix I mentioned in the description relates to line 5395. Previously, the check there was `IE1 == VU || IE2 == V`, which is not correct.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D114909



More information about the llvm-commits mailing list