[Bug tree-optimization/82255] Vectorizer cost model overcounts cost of some vectorized loads
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82255 Kewen Lin changed: What|Removed |Added Resolution|--- |FIXED Status|ASSIGNED|RESOLVED --- Comment #13 from Kewen Lin --- Should be fixed on trunk.
[Bug tree-optimization/82255] Vectorizer cost model overcounts cost of some vectorized loads
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82255 --- Comment #12 from CVS Commits --- The master branch has been updated by Kewen Lin : https://gcc.gnu.org/g:090d83c25508c108756a534c765d2fa8c07eb261 commit r14-2490-g090d83c25508c108756a534c765d2fa8c07eb261 Author: Kewen Lin Date: Wed Jul 12 21:23:21 2023 -0500 vect: Adjust vectorizable_load costing on VMAT_ELEMENTWISE and VMAT_STRIDED_SLP This patch adjusts the cost handling on VMAT_ELEMENTWISE and VMAT_STRIDED_SLP in function vectorizable_load. We don't call function vect_model_load_cost for them any more. As PR82255 shows, we don't always need a vector construction there, moving costing next to the transform can make us only cost for vector construction when it's actually needed. Besides, it can count the number of loads consistently for some cases. PR tree-optimization/82255 gcc/ChangeLog: * tree-vect-stmts.cc (vectorizable_load): Adjust the cost handling on VMAT_ELEMENTWISE and VMAT_STRIDED_SLP without calling vect_model_load_cost. (vect_model_load_cost): Assert it won't get VMAT_ELEMENTWISE and VMAT_STRIDED_SLP any more, and remove their related handlings. gcc/testsuite/ChangeLog: * gcc.dg/vect/costmodel/ppc/costmodel-pr82255.c: New test. 2023-06-13 Bill Schmidt Kewen Lin
[Bug tree-optimization/82255] Vectorizer cost model overcounts cost of some vectorized loads
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82255 Richard Biener changed: What|Removed |Added Target Milestone|10.5|---
[Bug tree-optimization/82255] Vectorizer cost model overcounts cost of some vectorized loads
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82255 Jakub Jelinek changed: What|Removed |Added Target Milestone|10.4|10.5 --- Comment #11 from Jakub Jelinek --- GCC 10.4 is being released, retargeting bugs to GCC 10.5.
[Bug tree-optimization/82255] Vectorizer cost model overcounts cost of some vectorized loads
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82255 Richard Biener changed: What|Removed |Added Status|NEW |ASSIGNED
[Bug tree-optimization/82255] Vectorizer cost model overcounts cost of some vectorized loads
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82255 Richard Biener changed: What|Removed |Added Target Milestone|10.3|10.4 --- Comment #10 from Richard Biener --- GCC 10.3 is being released, retargeting bugs to GCC 10.4.
[Bug tree-optimization/82255] Vectorizer cost model overcounts cost of some vectorized loads
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82255 Richard Biener changed: What|Removed |Added Target Milestone|10.2|10.3 --- Comment #9 from Richard Biener --- GCC 10.2 is released, adjusting target milestone.
[Bug tree-optimization/82255] Vectorizer cost model overcounts cost of some vectorized loads
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82255 Jakub Jelinek changed: What|Removed |Added Target Milestone|10.0|10.2 --- Comment #8 from Jakub Jelinek --- GCC 10.1 has been released.
[Bug tree-optimization/82255] Vectorizer cost model overcounts cost of some vectorized loads
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82255 Bill Schmidt changed: What|Removed |Added Target Milestone|8.4 |10.0
[Bug tree-optimization/82255] Vectorizer cost model overcounts cost of some vectorized loads
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82255 Jakub Jelinek changed: What|Removed |Added Target Milestone|8.3 |8.4 --- Comment #7 from Jakub Jelinek --- GCC 8.3 has been released.
[Bug tree-optimization/82255] Vectorizer cost model overcounts cost of some vectorized loads
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82255 Jakub Jelinek changed: What|Removed |Added Target Milestone|8.2 |8.3 --- Comment #6 from Jakub Jelinek --- GCC 8.2 has been released.
[Bug tree-optimization/82255] Vectorizer cost model overcounts cost of some vectorized loads
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82255 Jakub Jelinek changed: What|Removed |Added Target Milestone|8.0 |8.2 --- Comment #5 from Jakub Jelinek --- GCC 8.1 has been released.
[Bug tree-optimization/82255] Vectorizer cost model overcounts cost of some vectorized loads
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82255 --- Comment #4 from Bill Schmidt --- Created attachment 42217 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42217=edit Test case patch Here's a test case (and some associated changes to add debug code for the test case) that can be used to verify a fix.
[Bug tree-optimization/82255] Vectorizer cost model overcounts cost of some vectorized loads
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82255 Bill Schmidt changed: What|Removed |Added Assignee|wschmidt at gcc dot gnu.org|unassigned at gcc dot gnu.org --- Comment #3 from Bill Schmidt --- We've had a conversation about this on-list, starting with https://gcc.gnu.org/ml/gcc-patches/2017-09/msg01280.html. We're agreed that a proper solution is going to be complex. Taking my name off this one for now as I won't have time for it in the short term.
[Bug tree-optimization/82255] Vectorizer cost model overcounts cost of some vectorized loads
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82255 --- Comment #2 from Richard Biener --- Yeah, this is a known "missing feature" in the cost model. It's pessimistic about the fancy way we can process both strided SLP loads and stores. I didn't want to tackle this before trying to sort out the ugliness in SLP vs. non-SLP costing (that we need two copies of all the cost compute in two different places). I wanted to add sth like STMT_VINFO_{PROLOGUE,BODY}_COST_VEC and SLP_NODE_{PROLOGUE,BODY}_COST_VEC that can be filled from vectorizable_* and just collected from the cost processing code.
[Bug tree-optimization/82255] Vectorizer cost model overcounts cost of some vectorized loads
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82255 Bill Schmidt changed: What|Removed |Added Status|UNCONFIRMED |NEW Keywords||missed-optimization Last reconfirmed||2017-09-19 CC||rguenth at gcc dot gnu.org Assignee|unassigned at gcc dot gnu.org |wschmidt at gcc dot gnu.org Ever confirmed|0 |1 Target Milestone|--- |8.0 Known to fail||7.2.1, 8.0
[Bug tree-optimization/82255] Vectorizer cost model overcounts cost of some vectorized loads
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82255 --- Comment #1 from Bill Schmidt --- Created attachment 42206 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42206=edit Patch under test Here's a patch I'm testing. It solves the problem for this test case but hasn't been regstrapped yet.