target/99881 - x86 vector cost of CTOR from integer regs
authorRichard Biener <rguenther@suse.de>
Fri, 18 Feb 2022 13:32:14 +0000 (14:32 +0100)
committerRichard Biener <rguenther@suse.de>
Tue, 22 Feb 2022 06:48:45 +0000 (07:48 +0100)
commit90d693bdc9d71841f51d68826ffa5bd685d7f0bc
treef466ae8d8c711c6e67955c2febf119ee33c6a804
parentf24dfc76177b3994434c8beb287cde1a9976b5ce
target/99881 - x86 vector cost of CTOR from integer regs

This uses the now passed SLP node to the vectorizer costing hook
to adjust vector construction costs for the cost of moving an
integer component from a GPR to a vector register when that's
required for building a vector from components.  A cruical difference
here is whether the component is loaded from memory or extracted
from a vector register as in those cases no intermediate GPR is involved.

The pr99881.c testcase can be Un-XFAILed with this patch, the
pr91446.c testcase now produces scalar code which looks superior
to me so I've adjusted it as well.

2022-02-18  Richard Biener  <rguenther@suse.de>

PR tree-optimization/104582
PR target/99881
* config/i386/i386.cc (ix86_vector_costs::add_stmt_cost):
Cost GPR to vector register moves for integer vector construction.

* gcc.dg/vect/costmodel/x86_64/costmodel-pr104582-1.c: New.
* gcc.dg/vect/costmodel/x86_64/costmodel-pr104582-2.c: Likewise.
* gcc.dg/vect/costmodel/x86_64/costmodel-pr104582-3.c: Likewise.
* gcc.dg/vect/costmodel/x86_64/costmodel-pr104582-4.c: Likewise.
* gcc.target/i386/pr99881.c: Un-XFAIL.
* gcc.target/i386/pr91446.c: Adjust to not expect vectorization.
gcc/config/i386/i386.cc
gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-pr104582-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-pr104582-2.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-pr104582-3.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-pr104582-4.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr91446.c
gcc/testsuite/gcc.target/i386/pr99881.c