Re: hard-reg constraints in md: spill fails from LRA

2025-08-06 Thread Georg-Johann Lay via Gcc
Am 05.08.25 um 15:58 schrieb Stefan Schulze Frielinghaus: On Mon, Aug 04, 2025 at 01:04:36PM +0200, Georg-Johann Lay wrote: Rewriting avr.md so it uses less explicit hard registers, I came across the ICE below. I am using 2 patches as attached: - A tentative fix for LRA https://gcc.gnu.org/PR1

Re: Help with comparison-merging optimization pass

2025-08-06 Thread Jakub Jelinek via Gcc
On Wed, Aug 06, 2025 at 01:32:07PM +, Thomas de Bock wrote: > Apologies if I was unclear or misunderstand, I believe that's exactly what I > am > doing right now. I change the !='s' to =='s' and switch their true with their > false > edge, from there we can simply find the equality edge by fi

Re: Help with comparison-merging optimization pass

2025-08-06 Thread Thomas de Bock via Gcc
> On Wed, Aug 06, 2025 at 12:29:09PM +, Thomas de Bock wrote: > > I've looked at the pattern LLVM recognizes and there is indeed a lot of > > different > > ways we could recognize the chains and generalize the optimization. > > The way I do the pattern recognition now is by changing the condit

Re: Help with comparison-merging optimization pass

2025-08-06 Thread Jakub Jelinek via Gcc
On Wed, Aug 06, 2025 at 12:29:09PM +, Thomas de Bock wrote: > I've looked at the pattern LLVM recognizes and there is indeed a lot of > different > ways we could recognize the chains and generalize the optimization. > The way I do the pattern recognition now is by changing the conditions to ==

Re: Help with comparison-merging optimization pass

2025-08-06 Thread Thomas de Bock via Gcc
> On Wed, Aug 6, 2025 at 9:40 AM Jakub Jelinek wrote: > > On Wed, Aug 06, 2025 at 08:48:55AM +0200, Richard Biener via Gcc wrote: > > > For loops the canonical place to perform such optimization is the loop > > > distribution pass which already recognizes > > > memcpy but also strlen (strcmp is mo

Re: Help with comparison-merging optimization pass

2025-08-06 Thread Richard Biener via Gcc
On Wed, Aug 6, 2025 at 9:40 AM Jakub Jelinek wrote: > > On Wed, Aug 06, 2025 at 08:48:55AM +0200, Richard Biener via Gcc wrote: > > For loops the canonical place to perform such optimization is the loop > > distribution pass which already recognizes > > memcpy but also strlen (strcmp is more like

Re: Help with comparison-merging optimization pass

2025-08-06 Thread Jakub Jelinek via Gcc
On Wed, Aug 06, 2025 at 08:48:55AM +0200, Richard Biener via Gcc wrote: > For loops the canonical place to perform such optimization is the loop > distribution pass which already recognizes > memcpy but also strlen (strcmp is more like strlen). > > For straight-line code there's also a bugreport a