[llvm] 8817334 - [X86] getShuffleScalarElt - add CONCAT_VECTORS/INSERT_VECTOR_ELT support.

Martin Storsjö via llvm-commits llvm-commits at lists.llvm.org
Thu May 7 23:43:03 PDT 2020


On Wed, 6 May 2020, Simon Pilgrim via llvm-commits wrote:

>
> Author: Simon Pilgrim
> Date: 2020-05-06T18:13:33+01:00
> New Revision: 8817334ce3c71bf4c087adde60e11c7fe0aaceba
>
> URL: https://github.com/llvm/llvm-project/commit/8817334ce3c71bf4c087adde60e11c7fe0aaceba
> DIFF: https://github.com/llvm/llvm-project/commit/8817334ce3c71bf4c087adde60e11c7fe0aaceba.diff
>
> LOG: [X86] getShuffleScalarElt - add CONCAT_VECTORS/INSERT_VECTOR_ELT support.
>
> This helped fix some i686 vXi64 broadcast folds that were becoming v2Xi32 broadcasts because we didn't match the broadcast until after SimplifyDemandedBits worked out we only used the bottom 32-bits in PMUL(U)DQ and type legalization had split the original i64 load.
>
> A couple of regressions occurred which required some fixups - adding concat_vectors(broadcast_load,broadcast_load) splat support and recognising (unnecessary) unary shuffles of already broadcasted vectors.
>
> This came about as part of the work investigating vector load combining from shuffles for PR42550.

This triggers failed asserts for me:

$ cat repro.c
typedef struct {
   char a[8];
} b;
int d;
int e(b f) {
   int c = 0;
   for (; c < 8; c++)
     d += f.a[c];
   return d;
}
void g(int);
b h;
void i() {
   int j = e(h);
   g(j);
}
$ clang -target i686-linux-gnu repro.c -O2 -mavx2
Should not custom lower this!
UNREACHABLE executed at ../lib/Target/X86/X86ISelLowering.cpp:28991!


// Martin




More information about the llvm-commits mailing list