Re: [PATCH v2 2/2] combine: Try harder to form zero_extends [PR106594]

2023-03-31 Thread Richard Sandiford via Gcc-patches
Segher Boessenkool writes: > On Fri, Mar 31, 2023 at 03:06:41PM +0100, Richard Sandiford wrote: >> This is an alternative presentation of the change that we discussed >> a few weeks ago, and that you already tested: >> >> https://gcc.gnu.org/pipermail/gcc-patches/2023-March/613486.html >> >> T

Re: [PATCH v2 2/2] combine: Try harder to form zero_extends [PR106594]

2023-03-31 Thread Segher Boessenkool
On Fri, Mar 31, 2023 at 03:06:41PM +0100, Richard Sandiford wrote: > Segher Boessenkool writes: > > On Thu, Mar 09, 2023 at 12:10:51PM +, Richard Sandiford wrote: > >> (and:DI (subreg:DI (reg:SI r115) 0) > >> (const_int 63)) > > > > This is more expensive already?! An "and" usuall

Re: [PATCH v2 2/2] combine: Try harder to form zero_extends [PR106594]

2023-03-31 Thread Richard Sandiford via Gcc-patches
Segher Boessenkool writes: > On Thu, Mar 09, 2023 at 12:10:51PM +, Richard Sandiford wrote: >> g:c23a9c87cc62bd177fd0d4db6ad34b34e1b9a31f uses nonzero_bits >> information to convert sign_extends into zero_extends. >> That change is semantically correct in itself, but for the >> testcase in the

Re: [PATCH v2 2/2] combine: Try harder to form zero_extends [PR106594]

2023-03-31 Thread Segher Boessenkool
On Thu, Mar 09, 2023 at 12:10:51PM +, Richard Sandiford wrote: > g:c23a9c87cc62bd177fd0d4db6ad34b34e1b9a31f uses nonzero_bits > information to convert sign_extends into zero_extends. > That change is semantically correct in itself, but for the > testcase in the PR, it leads to a series of unfor

[PATCH v2 2/2] combine: Try harder to form zero_extends [PR106594]

2023-03-09 Thread Richard Sandiford via Gcc-patches
g:c23a9c87cc62bd177fd0d4db6ad34b34e1b9a31f uses nonzero_bits information to convert sign_extends into zero_extends. That change is semantically correct in itself, but for the testcase in the PR, it leads to a series of unfortunate events, as described below. We try to combine: Trying 24 -> 25: