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

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
So I think we can avoid swapping operands but what we cannot (current) avoid
is adjusting the tree code.  The operand swapping should be subsumed by
get_slp_defs no longer looking at the scalar stmt for mapping operand number
to defs but using the SLP children exclusively.  But of course we're still
looking at the actual comparison code - which we _could_ copy to the SLP
node as well - or is the comparison code adjustment not an issue here?
Quickly scanning I only see vectorizable_condition ever looking at the code
so there would be only a single place to adjust.

I'm not sure about test coverage, on x86_64 I see only

FAIL: gcc.dg/vect/vect-cselim-1.c (internal compiler error)
FAIL: gcc.dg/vect/vect-cselim-1.c (test for excess errors)
FAIL: gcc.dg/vect/vect-cselim-1.c scan-tree-dump-times vect "vectorized 1
loops" 1
FAIL: gcc.dg/vect/slp-cond-1.c (internal compiler error)
FAIL: gcc.dg/vect/slp-cond-1.c (test for excess errors)
FAIL: gcc.dg/vect/slp-cond-1.c scan-tree-dump-times vect "vectorizing stmts
using SLP" 3
FAIL: gcc.dg/vect/slp-cond-2-big-array.c (internal compiler error)
FAIL: gcc.dg/vect/slp-cond-2-big-array.c (test for excess errors)
FAIL: gcc.dg/vect/slp-cond-2-big-array.c scan-tree-dump-times vect "vectorizing
stmts using SLP" 3
FAIL: gcc.dg/vect/slp-cond-2.c (internal compiler error)
FAIL: gcc.dg/vect/slp-cond-2.c (test for excess errors)
FAIL: gcc.dg/vect/slp-cond-2.c scan-tree-dump-times vect "vectorizing stmts
using SLP" 3
FAIL: gcc.dg/vect/slp-cond-3.c (internal compiler error)
FAIL: gcc.dg/vect/slp-cond-3.c (test for excess errors)
FAIL: gcc.dg/vect/slp-cond-3.c scan-tree-dump-times vect "vectorizing stmts
using SLP" 1

when placing gcc_unreachable () at the swapping place and most testcases
still pass when removing the IL operand swapping, only vect-cselim-1.c
runfails (investigating).

I'd love to get rid of that last operand swapping case (because I'd like to
get rid of STMT_VINFO_NUM_SLP_USES...).  Yes, I'm working on adding a vectype
to slp_tree ...

Reply via email to