Re: [PATCH] Add new hardreg PRE pass

2024-12-31 Thread Jeff Law
On 12/30/24 5:53 AM, Andrew Carlotti wrote: On Sun, Dec 29, 2024 at 10:54:03AM -0700, Jeff Law wrote: On 12/5/24 8:45 AM, Andrew Carlotti wrote: So at a 30k foot level, one thing to be very leery of is extending the lifetime of any hard register. It's probably not a big deal on aarch, but i

Re: [PATCH] Add new hardreg PRE pass

2024-12-30 Thread Andrew Carlotti
On Sun, Dec 29, 2024 at 10:54:03AM -0700, Jeff Law wrote: > > > On 12/5/24 8:45 AM, Andrew Carlotti wrote: > > > > So at a 30k foot level, one thing to be very leery of is extending the > > > lifetime of any hard register. It's probably not a big deal on aarch, but > > > it can cause all kinds

Re: [PATCH] Add new hardreg PRE pass

2024-12-29 Thread Jeff Law
On 12/5/24 8:45 AM, Andrew Carlotti wrote: So at a 30k foot level, one thing to be very leery of is extending the lifetime of any hard register. It's probably not a big deal on aarch, but it can cause all kinds of headaches on other targets. Essentially you probably need to avoid PRE on a h

Re: [PATCH] Add new hardreg PRE pass

2024-12-05 Thread Andrew Carlotti
On Thu, Dec 05, 2024 at 04:16:22PM +, Andrew Carlotti wrote: > On Sun, Dec 01, 2024 at 03:54:25PM -0700, Jeff Law wrote: > > > > > > On 11/13/24 12:03 PM, Richard Sandiford wrote: > > > Andrew Carlotti writes: > > > > > > > > > > > > I think this is mostly my ignorance of the code, and wou

Re: [PATCH] Add new hardreg PRE pass

2024-12-05 Thread Andrew Carlotti
On Sun, Dec 01, 2024 at 03:54:25PM -0700, Jeff Law wrote: > > > On 11/13/24 12:03 PM, Richard Sandiford wrote: > > Andrew Carlotti writes: > > > > > > > > > I think this is mostly my ignorance of the code, and would be obvious > > > > if I tried it out locally, but: why do we need to do this a

Re: [PATCH] Add new hardreg PRE pass

2024-12-05 Thread Andrew Carlotti
On Mon, Dec 02, 2024 at 08:59:20AM -0700, Jeff Law wrote: > > > On 10/31/24 12:29 PM, Andrew Carlotti wrote: > > This pass is used to optimise assignments to the FPMR register in > > aarch64. I chose to implement this as a middle-end pass because it > > mostly reuses the existing RTL PRE code wi

Re: [PATCH] Add new hardreg PRE pass

2024-12-02 Thread Jeff Law
On 10/31/24 12:29 PM, Andrew Carlotti wrote: This pass is used to optimise assignments to the FPMR register in aarch64. I chose to implement this as a middle-end pass because it mostly reuses the existing RTL PRE code within gcse.cc. Compared to RTL PRE, the key difference in this new pass i

Re: [PATCH] Add new hardreg PRE pass

2024-12-01 Thread Jeff Law
On 11/13/24 12:03 PM, Richard Sandiford wrote: Andrew Carlotti writes: I think this is mostly my ignorance of the code, and would be obvious if I tried it out locally, but: why do we need to do this after computing the kills bitmap? For mode-switching, the kills bitmap is the inverse of

Re: [PATCH] Add new hardreg PRE pass

2024-12-01 Thread Andrew Pinski
On Sun, Dec 1, 2024 at 2:36 PM Jeff Law wrote: > > > > On 11/12/24 3:42 PM, Richard Sandiford wrote: > > >> + > >> +bool > >> +pass_hardreg_pre::gate (function *fun) > >> +{ > >> +#ifdef HARDREG_PRE_REGNOS > >> + return optimize > 0 > >> +&& !fun->calls_setjmp; > > > > Huh. It looks like the

Re: [PATCH] Add new hardreg PRE pass

2024-12-01 Thread Jeff Law
On 11/12/24 3:42 PM, Richard Sandiford wrote: + +bool +pass_hardreg_pre::gate (function *fun) +{ +#ifdef HARDREG_PRE_REGNOS + return optimize > 0 +&& !fun->calls_setjmp; Huh. It looks like these setjmp exclusions go back to 1998. I wouldn't have expected them to be needed now, since

Re: [PATCH] Add new hardreg PRE pass

2024-12-01 Thread Jeff Law
On 11/12/24 3:42 PM, Richard Sandiford wrote: Sorry for the slow review. I think Jeff's much better placed to comment on this than I am, but here's a stab. Mostly it looks really good to me FWIW. Digging out. I'll try to get a good looksie this afternoon/evening. jeff

Re: [PATCH] Add new hardreg PRE pass

2024-11-15 Thread Andrew Carlotti
On Tue, Nov 12, 2024 at 10:42:50PM +, Richard Sandiford wrote: > Sorry for the slow review. I think Jeff's much better placed to comment > on this than I am, but here's a stab. Mostly it looks really good to me > FWIW. > > Andrew Carlotti writes: > > This pass is used to optimise assignment

Re: [PATCH] Add new hardreg PRE pass

2024-11-14 Thread Richard Biener
On Wed, 13 Nov 2024, Richard Sandiford wrote: > Richard Biener writes: > > On Tue, 12 Nov 2024, Richard Sandiford wrote: > > > >> Sorry for the slow review. I think Jeff's much better placed to comment > >> on this than I am, but here's a stab. Mostly it looks really good to me > >> FWIW. > >>

Re: [PATCH] Add new hardreg PRE pass

2024-11-13 Thread Andrew Carlotti
On Wed, Nov 13, 2024 at 07:03:44PM +, Richard Sandiford wrote: > Andrew Carlotti writes: > > On Tue, Nov 12, 2024 at 10:42:50PM +, Richard Sandiford wrote: > >> Sorry for the slow review. I think Jeff's much better placed to comment > >> on this than I am, but here's a stab. Mostly it lo

Re: [PATCH] Add new hardreg PRE pass

2024-11-13 Thread Richard Sandiford
Andrew Carlotti writes: > On Tue, Nov 12, 2024 at 10:42:50PM +, Richard Sandiford wrote: >> Sorry for the slow review. I think Jeff's much better placed to comment >> on this than I am, but here's a stab. Mostly it looks really good to me >> FWIW. >> >> Andrew Carlotti writes: >> > This pa

Re: [PATCH] Add new hardreg PRE pass

2024-11-13 Thread Richard Sandiford
Richard Biener writes: > On Tue, 12 Nov 2024, Richard Sandiford wrote: > >> Sorry for the slow review. I think Jeff's much better placed to comment >> on this than I am, but here's a stab. Mostly it looks really good to me >> FWIW. >> >> Andrew Carlotti writes: >> > This pass is used to optimi

Re: [PATCH] Add new hardreg PRE pass

2024-11-13 Thread Andrew Carlotti
On Tue, Nov 12, 2024 at 10:42:50PM +, Richard Sandiford wrote: > Sorry for the slow review. I think Jeff's much better placed to comment > on this than I am, but here's a stab. Mostly it looks really good to me > FWIW. > > Andrew Carlotti writes: > > This pass is used to optimise assignment

Re: [PATCH] Add new hardreg PRE pass

2024-11-13 Thread Richard Biener
On Tue, 12 Nov 2024, Richard Sandiford wrote: > Sorry for the slow review. I think Jeff's much better placed to comment > on this than I am, but here's a stab. Mostly it looks really good to me > FWIW. > > Andrew Carlotti writes: > > This pass is used to optimise assignments to the FPMR regist

Re: [PATCH] Add new hardreg PRE pass

2024-11-12 Thread Richard Sandiford
Sorry for the slow review. I think Jeff's much better placed to comment on this than I am, but here's a stab. Mostly it looks really good to me FWIW. Andrew Carlotti writes: > This pass is used to optimise assignments to the FPMR register in > aarch64. I chose to implement this as a middle-end