https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119181

--- Comment #6 from Hongtao Liu <liuhongt at gcc dot gnu.org> ---
void
foo (int* a, int* __restrict b, int* c)
{
    b[0] = a[0] * c[256];
    b[1] = c[257] * a[1];
    b[2] = a[2] * c[258];
    b[3] = c[259] * a[3];
    b[4] = c[260] * a[4];
    b[5] = c[261] * a[5];
    b[6] = a[6] * c[262];
    b[7] = a[7] * c[263];
}

BB vectorizer will retrying with swapped operand if different interleaving
chains in one node.

/app/example.cpp:4:10: note:   Build SLP for _1 = *a_26(D);
/app/example.cpp:4:10: note:   Build SLP for _4 = MEM[(int *)c_27(D) + 1028B];
/app/example.cpp:4:10: missed:   Build SLP failed: different interleaving
chains in one node _4 = MEM[(int *)c_27(D) + 1028B];
/app/example.cpp:4:10: note:   Build SLP for _7 = MEM[(int *)a_26(D) + 8B];
/app/example.cpp:4:10: note:   Build SLP for _10 = MEM[(int *)c_27(D) + 1036B];
/app/example.cpp:4:10: missed:   Build SLP failed: different interleaving
chains in one node _10 = MEM[(int *)c_27(D) + 1036B];
/app/example.cpp:4:10: note:   Build SLP for _13 = MEM[(int *)c_27(D) + 1040B];
/app/example.cpp:4:10: missed:   Build SLP failed: different interleaving
chains in one node _13 = MEM[(int *)c_27(D) + 1040B];
/app/example.cpp:4:10: note:   Build SLP for _16 = MEM[(int *)c_27(D) + 1044B];
/app/example.cpp:4:10: missed:   Build SLP failed: different interleaving
chains in one node _16 = MEM[(int *)c_27(D) + 1044B];
/app/example.cpp:4:10: note:   Build SLP for _19 = MEM[(int *)a_26(D) + 24B];
/app/example.cpp:4:10: note:   Build SLP for _22 = MEM[(int *)a_26(D) + 28B];
/app/example.cpp:4:10: note:   SLP discovery for node 0x10fbb9a0 failed
/app/example.cpp:4:10: note:   Re-trying with swapped operands of stmts 1 3 4 5 
/app/example.cpp:4:10: note:   starting SLP discovery for node 0x10fbba30
/app/example.cpp:4:10: note:   get vectype for scalar type (group size 8): int
/app/example.cpp:4:10: note:   vectype: vector(8) int
/app/example.cpp:4:10: note:   nunits = 8
/app/example.cpp:4:10: note:   Build SLP for _1 = *a_26(D);
/app/example.cpp:4:10: note:   Build SLP for _5 = MEM[(int *)a_26(D) + 4B];
/app/example.cpp:4:10: note:   Build SLP for _7 = MEM[(int *)a_26(D) + 8B];
/app/example.cpp:4:10: note:   Build SLP for _11 = MEM[(int *)a_26(D) + 12B];
/app/example.cpp:4:10: note:   Build SLP for _14 = MEM[(int *)a_26(D) + 16B];
/app/example.cpp:4:10: note:   Build SLP for _17 = MEM[(int *)a_26(D) + 20B];
/app/example.cpp:4:10: note:   Build SLP for _19 = MEM[(int *)a_26(D) + 24B];
/app/example.cpp:4:10: note:   Build SLP for _22 = MEM[(int *)a_26(D) + 28B];
/app/example.cpp:4:10: note:   SLP discovery for node 0x10fbba30 succeeded
/app/example.cpp:4:10: note:   starting SLP discovery for node 0x10fbbac0
/app/example.cpp:4:10: note:   get vectype for scalar type (group size 8): int
/app/example.cpp:4:10: note:   vectype: vector(8) int

Reply via email to