[PATCH] D115462: [SLP]Improve shuffles cost estimation where possible.

Alexey Bataev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 23 13:20:24 PDT 2022


ABataev added a comment.

In D115462#3606101 <https://reviews.llvm.org/D115462#3606101>, @MaskRay wrote:

> In D115462#3605808 <https://reviews.llvm.org/D115462#3605808>, @ABataev wrote:
>
>> In D115462#3603899 <https://reviews.llvm.org/D115462#3603899>, @MaskRay wrote:
>>
>>> Here is `-mllvm -print-changed -mllvm -print-module-scope` output before SLPVectorizer: https://gist.github.com/MaskRay/23f0db50e136127fda1b4f83db2488da
>>
>> Double checked the patch and the results. The patch itself does not change the vectorization, just adjusts the cost model estimation. Some of the buildvector sequences are not profitable for re-vectorization after this patch, nothing else. Plus, the code after this patch results in the same code, being applied to the compiler without the patch, i.e. the code transformations are the same, just different vectorization.
>
> I have added IR before/after SLPVectorizer, with and without the two commits, and generated assembly to https://gist.github.com/MaskRay/23f0db50e136127fda1b4f83db2488da
> Hope they are useful.
>
>> Maybe the debug info is corrupted somehow? Or there are other effects?
>
> The codegen is corrupted. I provide debug info just in case it helps analyze the problem.

Try to run something like:
opt -slp-vectorizer -S ./post-slp-bad.ll -o post-slp-after.ll

(opt without these patches) and compare post-slp-after.ll with post-slp-good.ll. It will be the same. The only thing the patch does is prevents some insertelement vectorization in your case, nothing else. That's why the result will be same. Most probably it just reveals the bug somewhere in the compiler, maybe in lowering.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D115462



More information about the llvm-commits mailing list