[Bug tree-optimization/104582] [11/12 Regression] Unoptimal code for __negdi2 (and others) from libgcc2 due to unwanted vectorization

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Feb 18 10:22:06 GMT 2022


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

--- Comment #13 from Richard Biener <rguenth at gcc dot gnu.org> ---
Created attachment 52476
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52476&action=edit
minimal patch

This is a minimal untested patch adjusting APIs to allow for the cost hook to
receive a slp_node in addition to a stmt_vec_info and make the x86 backend
use it and successfully disregard the vectorization that's not doing
a CTOR from memory.

Other targets need minimal adjustments as well of course and some of the
cleanups (additional overloads for record/add_stmt_cost for scalar and branch
stmts and two fixes using scalar_stmt rather than vector_stmt kinds for
versioning costs can and will be split out).

Richard - any comments?  Would you object to doing this for GCC 12 (give we
changed the costing API anyway)?


More information about the Gcc-bugs mailing list