[PATCH] D126939: [SLP] Avoid converting undef to poison when gathering.

Alexey Bataev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 4 03:21:14 PDT 2022


ABataev added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:7565
+    // Pad UniqueValues with any existing undef/poison values.
+    UniqueValues.append(
+        std::next(VL.begin(), VL.size() - (VF - UniqueValues.size())),
----------------
ABataev wrote:
> Try this to fix the regressions:
> ```
> UniqueValues.append(NumValues-UniqueValues.size(), PoisonValue::get(VL[0]->getType())); 
> UniqueValue.append(std::next(VL.begin(), NumValues), VL.end());
> 
> ```
Though, I think, it still may lead to incorrect results. We'd better to keep the original VL here or just do something like:
```
UniqueValues.assign(VL.begin(), VL end());
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D126939



More information about the llvm-commits mailing list