[Bug tree-optimization/107090] [aarch64] sequence logic should be combined with mul and umulh
"cvs-commit at gcc dot gnu.org via Gcc-bugs" <[email protected]>
| Newsgroups | gmane.comp.gcc.bugs |
|---|---|
| Message-ID | <[email protected]/bugzilla/> |
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107090 --- Comment #24 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Philipp Tomsich <[email protected]>: https://gcc.gnu.org/g:006150ddc40844105eb99bc6514267314715f6dc commit r17-3441-g006150ddc40844105eb99bc6514267314715f6dc Author: Konstantinos Eleftheriou <[email protected]> Date: Wed Jul 8 02:43:36 2026 -0700 forwprop: Add long-multiply low-plus variant Extend the long-multiply fold to a LOW_PART variant recovering the lower 2N bits as xl*yl + (cross_sum << N) cross_sum = xh*yl + xl*yh This form is also the low half of a two-carry long-multiply, where an unsigned overflow compare against one of the PLUS operands feeds the matching high-part fold. Folding here would destroy (cross_sum << N) while the compare still needs it, so the fold is deferred while any GT/LT/GE/LE use shares an operand with the PLUS; once the high-part fold has consumed the compare, the next forwprop instance folds the rest. PR tree-optimization/107090 gcc/ChangeLog: * tree-ssa-forwprop.cc (long_mul_check_low_plus_defer): New helper, defers the fold when any GT/LT/GE/LE use shares an operand with the PLUS; gates the LOW_PART PLUS_EXPR row added to long_mul_table. gcc/testsuite/ChangeLog: * gcc.dg/tree-ssa/long-mul-two-carry.c: Add a forwprop4 LOW fold expectation for full_mul_two_carry, deferred from forwprop3 by long_mul_check_low_plus_defer. * gcc.dg/tree-ssa/long-mul-low-plus.c: New test.