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

Alexey Bataev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 27 13:05:50 PDT 2022


ABataev added a comment.

In D115462#3613388 <https://reviews.llvm.org/D115462#3613388>, @manojgupta wrote:

> Still crashes on trunk.
>
> C-reduce Test case:
>
>   typedef __INT64_TYPE__ int64_t;
>   int sbr_autocorrelate_c_x_i;
>   void phiautocorr_calc(int64_t );
>   
>   void sbr_autocorrelate_c_x(void) {
>     int(*x)[2] = sbr_autocorrelate_c_x;
>     int64_t accu_re , accu_im = 0;
>     for (; sbr_autocorrelate_c_x_i; sbr_autocorrelate_c_x_i++) {
>       accu_re +=
>           x[sbr_autocorrelate_c_x_i][0] * x[sbr_autocorrelate_c_x_i + 2][0];
>       accu_re +=
>           x[sbr_autocorrelate_c_x_i][1] * x[sbr_autocorrelate_c_x_i + 2][1];
>       accu_im +=
>           x[sbr_autocorrelate_c_x_i][0] * x[sbr_autocorrelate_c_x_i + 2][1];
>       accu_im -=
>           x[sbr_autocorrelate_c_x_i][1] * x[sbr_autocorrelate_c_x_i + 2][0];
>     }
>     phiautocorr_calc(accu_im);
>     phiautocorr_calc(accu_re);
>   }
>
> Crashes with 
> `clang -Os -c test.c --target=armv7a-linux-gnueabihf -mfpu=neon -Wno-error `
>
> llvm/llvm-project/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:7744: llvm::Value *llvm::slpvectorizer::BoUpSLP::createBuildVector(ArrayRef<llvm::Value *>): Assertion `any_of(VectorizableTree, [VL](const std::unique_ptr<TreeEntry> &TE) { return TE->State == TreeEntry::NeedToGather && TE->isSame(VL); }) && "Non-matching gather node."' failed.

Thanks, there is PR56251 already. The patch is not a cause of the crash, it has an extra assert that reveals internal bug in SLP vectorizer. Will send a patch with a fix in a few minutes.


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