Re: [PATCH] ira: Consider save/restore costs of callee-save registers [PR110071]

2023-09-18 Thread Vladimir Makarov via Gcc-patches
On 9/15/23 10:48, Vladimir Makarov wrote: On 9/14/23 06:45, Surya Kumari Jangala wrote: ira: Consider save/restore costs of callee-save registers [PR110071] In improve_allocation() routine, IRA checks for each allocno if spilling any conflicting allocnos can improve the allocation of this al

Re: [PATCH] ira: Consider save/restore costs of callee-save registers [PR110071]

2023-09-15 Thread Vladimir Makarov via Gcc-patches
On 9/14/23 06:45, Surya Kumari Jangala wrote: ira: Consider save/restore costs of callee-save registers [PR110071] In improve_allocation() routine, IRA checks for each allocno if spilling any conflicting allocnos can improve the allocation of this allocno. This routine computes the cost improv

[pushed] [RA]: Improve cost calculation of pseudos with equivalences

2023-09-14 Thread Vladimir Makarov via Gcc-patches
I've committed the following patch.  The reason for this patch is explained in its commit message. The patch was successfully bootstrapped and tested on x86-64, aarch64, and ppc64le. commit 3c834d85f2ec42c60995c2b678196a06cb744959 Author: Vladimir N. Makarov Date: Thu Sep 14 10:26:48 2023

Re: [PATCH 01/13] [APX EGPR] middle-end: Add insn argument to base_reg_class

2023-09-14 Thread Vladimir Makarov via Gcc-patches
On 9/10/23 00:49, Hongyu Wang wrote: Vladimir Makarov via Gcc-patches 于2023年9月9日周六 01:04写道: On 8/31/23 04:20, Hongyu Wang wrote: @@ -2542,6 +2542,8 @@ the code of the immediately enclosing expression (@code{MEM} for the top level of an address, @code{ADDRESS} for something that occurs

Re: [PATCH 01/13] [APX EGPR] middle-end: Add insn argument to base_reg_class

2023-09-08 Thread Vladimir Makarov via Gcc-patches
On 8/31/23 04:20, Hongyu Wang wrote: @@ -2542,6 +2542,8 @@ the code of the immediately enclosing expression (@code{MEM} for the top level of an address, @code{ADDRESS} for something that occurs in an @code{address_operand}). @var{index_code} is the code of the corresponding index expres

[pushed][PR111225][LRA]: Don't reuse chosen insn alternative with special memory constraint

2023-09-07 Thread Vladimir Makarov via Gcc-patches
The following patch solves https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111225 The patch was successfully bootstrapped and tested on x86-64, aarch64, and ppc64le. commit f7bca44d97ad01b39f9d6e7809df7bf517eeb2fb Author: Vladimir N. Makarov Date: Thu Sep 7 09:59:10 2023 -0400 [LRA]: Don

Re: [PATCH 01/13] [APX EGPR] middle-end: Add insn argument to base_reg_class

2023-09-07 Thread Vladimir Makarov via Gcc-patches
On 9/7/23 02:23, Uros Bizjak wrote: On Wed, Sep 6, 2023 at 9:43 PM Vladimir Makarov wrote: On 9/1/23 05:07, Hongyu Wang wrote: I think the approach proposed by Intel developers is better. In some way we already use such approach when we pass memory mode to get the base reg class. Althou

Re: [PATCH 01/13] [APX EGPR] middle-end: Add insn argument to base_reg_class

2023-09-06 Thread Vladimir Makarov via Gcc-patches
On 9/1/23 05:07, Hongyu Wang wrote: Uros Bizjak via Gcc-patches 于2023年8月31日周四 18:16写道: On Thu, Aug 31, 2023 at 10:20 AM Hongyu Wang wrote: From: Kong Lingling Current reload infrastructure does not support selective base_reg_class for backend insn. Add insn argument to base_reg_class for

Re: [pushed][LRA]: Spill pseudos assigned to fp when fp->sp elimination became impossible

2023-08-17 Thread Vladimir Makarov via Gcc-patches
On 8/17/23 07:19, senthilkumar.selva...@microchip.com wrote: On Wed, 2023-08-16 at 12:13 -0400, Vladimir Makarov wrote: EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe The attached patch fixes recently found wrong insn removal in LRA port for AVR.

[pushed][LRA]: When assigning stack slots to pseudos previously assigned to fp consider other spilled pseudos

2023-08-17 Thread Vladimir Makarov via Gcc-patches
The following patch fixes a problem with allocating the same stack slots to conflicting pseudos.  The problem exists only for AVR LRA port. The patch was successfully bootstrapped and tested on x86-64 and aarch64. commit c024867d1aa9d465e0236fc9d45d8e1d4bb6bd30 Author: Vladimir N. Makarov Date

[pushed][LRA]: Spill pseudos assigned to fp when fp->sp elimination became impossible

2023-08-16 Thread Vladimir Makarov via Gcc-patches
The attached patch fixes recently found wrong insn removal in LRA port for AVR. The patch was successfully tested and bootstrapped on x86-64 and aarch64. commit 748a77558ff37761faa234e19327ad1decaace33 Author: Vladimir N. Makarov Date: Wed Aug 16 09:13:54 2023 -0400 [LRA]: Spill pseudo

[pushed][LRA]: Process output stack pointer reloads before emitting reload insns

2023-08-14 Thread Vladimir Makarov via Gcc-patches
The patch fixes a failure of building aarch64 port with my yesterday patch. The patch was successfully bootstrapped on x86-64 and aarch64. commit c4760c0161f92b92361feba11836e3d066bb330c Author: Vladimir N. Makarov Date: Mon Aug 14 16:06:27 2023 -0400 [LRA]: Process output stack pointer r

Re: [pushed]LRA]: Fix asserts for output stack pointer reloads

2023-08-14 Thread Vladimir Makarov via Gcc-patches
On 8/14/23 14:37, Prathamesh Kulkarni wrote: On Mon, 14 Aug 2023 at 06:39, Vladimir Makarov via Gcc-patches wrote: The following patch fixes useless asserts in my latest patch implementing output stack pointer reloads. Hi Vladimir, It seems that this patch caused the following ICE on

[pushed]LRA]: Fix asserts for output stack pointer reloads

2023-08-13 Thread Vladimir Makarov via Gcc-patches
The following patch fixes useless asserts in my latest patch implementing output stack pointer reloads. commit 18b417fe1a46d37738243267c1f559cd0acc4886 Author: Vladimir N. Makarov Date: Sun Aug 13 20:54:58 2023 -0400 [LRA]: Fix asserts for output stack pointer reloads The patch im

[pushed][LRA]: Implement output stack pointer reloads

2023-08-11 Thread Vladimir Makarov via Gcc-patches
Sorry, I had some problems with email.  Therefore there are email duplication and they were sent to g...@gcc.gnu.org instead of gcc-patches@gcc.gnu.org On 8/9/23 16:54, Vladimir Makarov wrote: On 8/9/23 07:15, senthilkumar.selva...@microchip.com wrote: Hi,    After turning on FP -> SP el

Re: [PATCH] rtl-optimization/110587 - speedup find_hard_regno_for_1

2023-08-08 Thread Vladimir Makarov via Gcc-patches
On 8/7/23 09:18, Richard Biener wrote: On Wed, 2 Aug 2023, Richard Biener wrote: On Mon, 31 Jul 2023, Jeff Law wrote: On 7/31/23 04:54, Richard Biener via Gcc-patches wrote: On Tue, 25 Jul 2023, Richard Biener wrote: The following applies a micro-optimization to find_hard_regno_for_1, r

[pushed][LRA] Check input insn pattern hard regs against early clobber hard regs for live info

2023-08-04 Thread Vladimir Makarov via Gcc-patches
The following patch fixes a problem found by LRA port for avr target.  The problem description is in the commit message. The patch was successfully bootstrapped and tested on x86-64 and aarch64. commit abf953042ace471720c1dc284b5f38e546fc0595 Author: Vladimir N. Makarov Date: Fri Aug 4 08:04:

Re: [PING][PATCH] ira: update allocated_hardreg_p[] in improve_allocation() [PR110254]

2023-08-02 Thread Vladimir Makarov via Gcc-patches
On 8/1/23 01:20, Surya Kumari Jangala wrote: Ping Sorry for delay with the answer. I was on vacation. On 21/07/23 3:43 pm, Surya Kumari Jangala via Gcc-patches wrote: The improve_allocation() routine does not update the allocated_hardreg_p[] array after an allocno is assigned a register. If

Re: [PATCH] rtl-optimization/110587 - remove quadratic regno_in_use_p

2023-08-01 Thread Vladimir Makarov via Gcc-patches
On 7/25/23 09:40, Richard Biener wrote: The following removes the code checking whether a noop copy is between something involved in the return sequence composed of a SET and USE. Instead of checking for this special-case the following makes us only ever remove noop copies between pseudos - wh

[pushed][LRA]: Fix sparc bootstrap after recent patch for fp elimination for avr LRA port

2023-07-21 Thread Vladimir Makarov via Gcc-patches
The following patch fixes sparc solaris bootstrap.  The explanation of the patch is in the commit message. The patch was successfully bootstrap on x86-64, aarch64, and sparc64 solaris. commit d17be8f7f36abe257a7d026dad61e5f8d14bdafc Author: Vladimir N. Makarov Date: Fri Jul 21 20:28:50 202

Re: [pushed][LRA]: Check and update frame to stack pointer elimination after stack slot allocation

2023-07-21 Thread Vladimir Makarov via Gcc-patches
On 7/20/23 16:45, Rainer Orth wrote: Hi Vladimir, The following patch is necessary for porting avr to LRA. The patch was successfully bootstrapped and tested on x86-64, aarch64, and ppc64le. There is still avr poring problem with reloading of subreg of frame pointer.  I'll address it later

[pushed][LRA]: Exclude reloading of frame pointer in subreg for some cases

2023-07-20 Thread Vladimir Makarov via Gcc-patches
The following patch improves code for avr LRA port.  More explanation for the patch can be found in the commit message. The patch was successfully bootstrapped and tested on x86-64, aarch64, and ppc64le. commit 4b8878fbf7b74ea5c3405c9f558df0517036f131 Author: Vladimir N. Makarov Date: Thu Ju

[pushed][LRA]: Check and update frame to stack pointer elimination after stack slot allocation

2023-07-19 Thread Vladimir Makarov via Gcc-patches
The following patch is necessary for porting avr to LRA. The patch was successfully bootstrapped and tested on x86-64, aarch64, and ppc64le. There is still avr poring problem with reloading of subreg of frame pointer.  I'll address it later on this week. commit 2971ff7b1d564ac04b537d907c70e

[pushed][RA][PR109520]: Catch error when there are no enough registers for asm insn

2023-07-13 Thread Vladimir Makarov via Gcc-patches
The following patch solves https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109520 The patch was successfully bootstrapped and tested on x86-64, aarch64, and ppc64le. commit b175b4887f928118af997f6d4d75097a64dcec5d Author: Vladimir N. Makarov Date: Thu Jul 13 10:42:17 2023 -0400 [RA][PR10

Re: [IRA] Skip empty register classes in setup_reg_class_relations

2023-07-13 Thread Vladimir Makarov via Gcc-patches
On 7/12/23 07:05, senthilkumar.selva...@microchip.com wrote: Hi, I've been spending some (spare) time trying to get LRA working for the avr target. Thank you for addressing this problem. The code you changing is very sensitive and was a source of multiple PRs in the past.  But I foun

Re: [pushed][LRA][PR110372]: Refine reload pseudo class

2023-07-12 Thread Vladimir Makarov via Gcc-patches
On 7/12/23 12:22, Richard Sandiford wrote: Vladimir Makarov writes: On 7/12/23 06:07, Richard Sandiford wrote: Vladimir Makarov via Gcc-patches writes: diff --git a/gcc/lra-assigns.cc b/gcc/lra-assigns.cc index 73fbef29912..2f95121df06 100644 --- a/gcc/lra-assigns.cc +++ b/gcc/lra

Re: [pushed][LRA][PR110372]: Refine reload pseudo class

2023-07-12 Thread Vladimir Makarov via Gcc-patches
On 7/12/23 06:07, Richard Sandiford wrote: Vladimir Makarov via Gcc-patches writes: diff --git a/gcc/lra-assigns.cc b/gcc/lra-assigns.cc index 73fbef29912..2f95121df06 100644 --- a/gcc/lra-assigns.cc +++ b/gcc/lra-assigns.cc @@ -1443,10 +1443,11 @@ assign_by_spills (void

[pushed][LRA][PR110372]: Refine reload pseudo class

2023-07-07 Thread Vladimir Makarov via Gcc-patches
The following patch solves https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110372 The patch was successfully bootstrapped and tested on x86-64. commit 1f7e5a7b91862b999aab88ee0319052aaf00f0f1 Author: Vladimir N. Makarov Date: Fri Jul 7 09:53:38 2023 -0400 LRA: Refine reload pseudo class

[pushed] [RA] [PR110215] Ignore conflicts for some pseudos from insns throwing a final exception

2023-06-16 Thread Vladimir Makarov via Gcc-patches
The following patch solves https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110215 The patch was successfully tested and bootstrapped on x86-64, aarch64, and ppc64le. It is difficult to make a stable test for the PR.  So there is not test in the patch. commit 154c69039571c66b3a6d16ecfa9e6ff229

Re: [pushed] [PR109541] RA: Constrain class of pic offset table pseudo to general regs

2023-06-07 Thread Vladimir Makarov via Gcc-patches
On 6/7/23 12:20, Jeff Law wrote: On 6/7/23 09:35, Vladimir Makarov via Gcc-patches wrote: The following patch fixes -ENOPATCH Sorry, here is the patch. commit 08ca31fb27841cb7f3bff7086be6f139136be1a7 Author: Vladimir N. Makarov Date: Wed Jun 7 09:51:54 2023 -0400 RA: Constrain

[pushed] [PR109541] RA: Constrain class of pic offset table pseudo to general regs

2023-06-07 Thread Vladimir Makarov via Gcc-patches
The following patch fixes https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109541 The patch was successfully bootstrapped and tested on x86-64, aarcha64, and ppc64le.

[pushed] LRA: Update insn sp offset if its input reload changes SP

2023-05-30 Thread Vladimir Makarov via Gcc-patches
The following patch fixes an LRA bug triggered by switching H8300 target from reload to LRA.  The description of the problem is in the commit message. The patch was successfully bootstrapped and tested on x86-64, aarch64, and ppc64le. commit 30038a207c10a2783fa2695b62c7c8458ef05e73 Author: V

Re: [PATCH] Only use NO_REGS in cost calculation when !hard_regno_mode_ok for GENERAL_REGS and mode.

2023-05-25 Thread Vladimir Makarov via Gcc-patches
On 5/17/23 02:57, liuhongt wrote: r14-172-g0368d169492017 replaces GENERAL_REGS with NO_REGS in cost calculation when the preferred register class are not known yet. It regressed powerpc PR109610 and PR109858, it looks too aggressive to use NO_REGS when mode can be allocated with GENERAL_REGS.

Re: [PATCH] ira: Don't create copies for earlyclobbered pairs

2023-05-08 Thread Vladimir Makarov via Gcc-patches
On 5/5/23 12:59, Richard Sandiford wrote: This patch follows on from g:9f635bd13fe9e85872e441b6f3618947f989909a ("the previous patch"). To start by quoting that: If an insn requires two operands to be tied, and the input operand dies in the insn, IRA acts as though there were a copy from the

Re: [PATCH 1/2] Use NO_REGS in cost calculation when the preferred register class are not known yet.

2023-04-21 Thread Vladimir Makarov via Gcc-patches
On 4/19/23 20:46, liuhongt via Gcc-patches wrote: 1547 /* If this insn loads a parameter from its stack slot, then it 1548 represents a savings, rather than a cost, if the parameter is 1549 stored in memory. Record this fact. 1550 1551 Similarly if we're loading other constants fr

[pushed] [LRA]: Exclude some hard regs for multi-reg inout reload pseudos used in asm in different mode

2023-04-20 Thread Vladimir Makarov via Gcc-patches
The following patch fixes test failure of 20030222-1.c on moxie port.  But the problem can occur on other targets.  The patch actually implements the old reload approach for the test case. The patch was successfully tested and bootstrapped on x86-64, aarch64, and ppc64le. commit 51703ac3c722

Re: [PATCH] Check hard_regno_mode_ok before setting lowest memory move cost for the mode with different reg classes.

2023-04-05 Thread Vladimir Makarov via Gcc-patches
On 4/4/23 21:29, Jeff Law wrote: On 4/3/23 23:13, liuhongt via Gcc-patches wrote: There's a potential performance issue when backend returns some unreasonable value for the mode which can be never be allocate with reg class. Bootstrapped and regtested on x86_64-pc-linux-gnu{-m32,}. Ok for t

[pushed][PR109052] LRA: Implement commutative operands exchange for combining secondary memory reload and original insn

2023-03-31 Thread Vladimir Makarov via Gcc-patches
This is one more patch for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109052 The patch adds trying commutative operands exchange for recently implemented combining secondary memory reload and original insn: The patch was successfully bootstrapped and tested on x86_64. commit 378d19cfebfa2b

[pushed] [PR109137] LRA: Do not repeat inheritance and live range splitting in case of asm error

2023-03-22 Thread Vladimir Makarov via Gcc-patches
The following patch solves https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109137 The patch was successfully bootstrapped and tested on x86-64. commit 81d762cbec9685c2f2571da21d48f42c42eff33b Author: Vladimir N. Makarov Date: Wed Mar 22 12:33:11 2023 -0400 LRA: Do not repeat inheritance an

[pushed] [PR109052] LRA: Implement combining secondary memory reload and original insn

2023-03-17 Thread Vladimir Makarov via Gcc-patches
The following patch solves https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109052 The patch was successfully bootstrapped and tested on x86-64, i686, aarch64, and ppc64le. commit 57688950b9328cbb4a9c21eb3199f9132b5119d3 Author: Vladimir N. Makarov Date: Fri Mar 17 08:58:58 2023 -0400 LRA:

[pushed] [PR108999] LRA: For clobbered regs use operand mode instead of the biggest mode

2023-03-09 Thread Vladimir Makarov via Gcc-patches
The following patch solves https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108999 The patch was successfully bootstrapped and tested on i686, x86-64, aarch64, and ppc64 be/le. commit 3c75631fc09a22f2513fab80ef502c2a8b0f9121 Author: Vladimir N. Makarov Date: Thu Mar 9 08:41:09 2023 -0500 LR

[pushed][PR90706] IRA: Use minimal cost for hard register movement

2023-03-02 Thread Vladimir Makarov via Gcc-patches
The following patch is for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90706 The patch was successfully bootstrapped and tested on i686, x86-64, aarch64, ppc64le. commit 23661e39df76e07fb4ce1ea015379c7601d947ef Author: Vladimir N. Makarov Date: Thu Mar 2 16:29:05 2023 -0500 IRA: Use

[pushed] [PR108774] RA: Clear reg equiv caller_save_p flag when clearing defined_p flag

2023-02-13 Thread Vladimir Makarov via Gcc-patches
The following patch solves   https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108774 The patch was successfully bootstrapped and tested on i686, x86_64, and aarch64. commit a33e3dcbd15e73603796e30b5eeec11a0c8bacec Author: Vladimir N. Makarov Date: Mon Feb 13 16:05:04 2023 -0500 RA: Clear re

[pushed] [PR108754] RA: Use caller save equivalent memory only for LRA

2023-02-10 Thread Vladimir Makarov via Gcc-patches
The following patch should  solve   https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108754 The patch simply switches off a new optimization for targets using the old reload pass. The patch was successfully bootstrapped on x86-64. commit 7757567358a84c3774cb972350bd7ea299daaa8d Author: Vladimir

[pushed] [PR108500] RA: Use simple LRA for huge functions

2023-02-10 Thread Vladimir Makarov via Gcc-patches
The following patch is for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108500 The patch improves compilation speed.  Compilation time of the biggest test in the PR decreases from 1235s to 709s. The patch was successfully bootstrapped on x86-64. commit 02371cdd755d2b53fb580d3e8209c44e0c45c337

[pushed] [PR103541] RA: Implement reuse of equivalent memory for caller saves optimization (version 2)

2023-02-09 Thread Vladimir Makarov via Gcc-patches
This is another try to solve https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103541 The patch was successfully bootstrapped (--enable-languages=all) and tested on x86, x86-64, aarch64 commit 1ad898d18904ac68432ba9b8ffa2b083d007cc2d Author: Vladimir N. Makarov Date: Thu Feb 9 15:18:48 2023 -0500

Re: [pushed] [PR103541] RA: Implement reuse of equivalent memory for caller saves optimization

2023-02-08 Thread Vladimir Makarov via Gcc-patches
On 2/7/23 22:48, Andrew Pinski wrote: On Tue, Feb 7, 2023 at 6:08 AM Vladimir Makarov via Gcc-patches wrote: The following patch solves https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103541 The patch was successfully bootstrapped and tested on x86-64, aarch64, and ppc64le. What languages

[pushed] [PR103541] RA: Implement reuse of equivalent memory for caller saves optimization

2023-02-07 Thread Vladimir Makarov via Gcc-patches
The following patch solves https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103541 The patch was successfully bootstrapped and tested on x86-64, aarch64, and ppc64le. commit f661c0bb6371f355966a67b5ce71398e80792948 Author: Vladimir N. Makarov Date: Tue Feb 7 08:27:36 2023 -0500 RA: Implemen

[committed] [PR108388] LRA: Always do elimination and only for hard register to check insn constraints

2023-01-24 Thread Vladimir Makarov via Gcc-patches
The following patch solves   https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108388 The patch was successfully bootstrapped and tested on x86-64, aarch64, and ppc64le. commit 265a749f290f7c6adc9a3aaa9c585b498a8a38ea Author: Vladimir N. Makarov Date: Tue Jan 24 16:10:59 2023 -0500 LRA: Alwa

[committed] [PR90706] IRA: Check that reg classes contain a hard reg of given mode in reg move cost calculation

2022-12-15 Thread Vladimir Makarov via Gcc-patches
The following patch solves a spill problem for   https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90706 There are still redundant moves which should be removed to solve PR. I'll continue my work on this in Jan. commit 12abd5a7d13209f79664ea603b3f3517f71b8c4f Author: Vladimir N. Makarov Date:

[committed] [PR106462] LRA: Check hard reg availability of pseudo and its subreg for pseudo reload

2022-12-02 Thread Vladimir Makarov via Gcc-patches
The following patch solves   https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106462 The patch was successfully bootstrapped and tested on x86-64. commit 70596a0fb2a2ec072e1e97e37616e05041dfa4e5 Author: Vladimir N. Makarov Date: Fri Dec 2 08:18:04 2022 -0500 LRA: Check hard reg availability

Re: [RFA] gcc: fix PR rtl-optimization/107482

2022-11-07 Thread Vladimir Makarov via Gcc-patches
On 2022-11-07 04:46, Max Filippov wrote: gcc/ * ira-color.cc (update_costs_from_allocno): Check that allocno is in the consideration_allocno_bitmap before dereferencing ALLOCNO_COLOR_DATA (allocno). --- This fixes the invalid memory access, but I'm not sure if that's suf

Re: [PATCH] IRA: Make sure array is big enough

2022-10-26 Thread Vladimir Makarov via Gcc-patches
On 2022-10-25 06:01, Torbjörn SVENSSON wrote: In commit 081c96621da, the call to resize_reg_info() was moved before the call to remove_scratches() and the latter one can increase the number of regs and that would cause an out of bounds usage on the reg_renumber global array. Without this patch

Re: [PATCH] Add a bit dislike for separate mem alternative when op is REG_P.

2022-05-31 Thread Vladimir Makarov via Gcc-patches
On 2022-05-29 23:05, Hongtao Liu wrote: On Fri, May 27, 2022 at 5:12 AM Vladimir Makarov via Gcc-patches wrote: On 2022-05-24 23:39, liuhongt wrote: Rigt now, mem_cost for separate mem alternative is 1 * frequency which is pretty small and caused the unnecessary SSE spill in the PR, I&#x

Re: [PATCH] Add a bit dislike for separate mem alternative when op is REG_P.

2022-05-26 Thread Vladimir Makarov via Gcc-patches
On 2022-05-24 23:39, liuhongt wrote: Rigt now, mem_cost for separate mem alternative is 1 * frequency which is pretty small and caused the unnecessary SSE spill in the PR, I've tried to rework backend cost model, but RA still not happy with that(regress somewhere else). I think the root cause o

Re: [PATCH] [PR100106] Reject unaligned subregs when strict alignment is required

2022-05-06 Thread Vladimir Makarov via Gcc-patches
On 2022-05-05 02:52, Alexandre Oliva wrote: Regstrapped on x86_64-linux-gnu and ppc64le-linux-gnu, also tested targeting ppc- and ppc64-vx7r2. Ok to install? I am ok with the modified version of the patch.  It looks reasonable for me and I support its commit. But I think I can not approve

Re: [committed] [PR105032] LRA: modify loop condition to find reload insns for hard reg splitting

2022-03-30 Thread Vladimir Makarov via Gcc-patches
On 2022-03-30 15:18, Uros Bizjak wrote: On Wed, Mar 30, 2022 at 7:15 PM Vladimir Makarov via Gcc-patches wrote: The following patch fixes https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105032 The patch was successfully bootstrapped and tested on x86-64. diff --git a/gcc/testsuite/gcc.target

[committed] [PR105032] LRA: modify loop condition to find reload insns for hard reg splitting

2022-03-30 Thread Vladimir Makarov via Gcc-patches
The following patch fixes https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105032 The patch was successfully bootstrapped and tested on x86-64. commit 25de4889c16fec80172a5e2d1825f3ff505d0cc4 Author: Vladimir N. Makarov Date: Wed Mar 30 13:03:44 2022 -0400 [PR105032] LRA: modify loop conditi

[committed] [PR104971] LRA: check live hard regs to remove a dead insn

2022-03-25 Thread Vladimir Makarov via Gcc-patches
The following patch is for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104971 The PR was already fixed by Jakub but his patch did not fix a latent LRA bug mentioned in the PR comments.  The current patch fixes the latent bug. The patch was successfully bootstrapped and tested on x86-64 and a

Re: [PATCH] rtl-optimization/105028 - fix compile-time hog in form_threads_from_copies

2022-03-23 Thread Vladimir Makarov via Gcc-patches
On 2022-03-23 07:49, Richard Biener wrote: form_threads_from_copies processes a sorted array of copies, skipping those with the same thread and conflicting threads and merging the first non-conflicting ones. After that it terminates the loop and gathers the remaining elements of the array, ski

[committed] [PR104961] LRA: split hard reg for reload pseudo with clobber

2022-03-18 Thread Vladimir Makarov via Gcc-patches
The following patch fixes https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104961 The patch was successfully bootstrapped and tested on x86-64. commit 4e2291789a8b31c550271405782356e8aeddcee3 Author: Vladimir N. Makarov Date: Fri Mar 18 14:23:40 2022 -0400 [PR104961] LRA: split hard reg for

Re: [PATCH] lra: Fix up debug_p handling in lra_substitute_pseudo [PR104778]

2022-03-14 Thread Vladimir Makarov via Gcc-patches
On 2022-03-12 14:37, Jakub Jelinek wrote: Hi! The following testcase ICEs on powerpc-linux, because lra_substitute_pseudo substitutes (const_int 1) into a subreg operand. First a subreg of subreg of a reg appears in a debug insn (which surely is invalid outside of debug insns, but in debug in

[committed] [PR103074] LRA: Check new conflicts when splitting hard reg live range

2022-03-10 Thread Vladimir Makarov via Gcc-patches
The following patch solves https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103074 The patch was successfully bootstrapped and tested on x86-64 and aarch64. commit d8e5fff6b74b82c2ac3254be9a1f0fb6b30dbdbf Author: Vladimir N. Makarov Date: Thu Mar 10 16:16:00 2022 -0500 [PR103074] LRA: Check

Re: [PR103302] skip multi-word pre-move clobber during lra

2022-03-02 Thread Vladimir Makarov via Gcc-patches
On 2022-03-02 07:25, Alexandre Oliva wrote: Regstrapped on x86_64-linux-gnu, also tested on various riscv and arm targets (with gcc-11). Ok to install? Yes. Thank you on working this, Alex. for gcc/ChangeLog * lra-constraints.cc (undo_optional_reloads): Recognize and drop

Re: [PATCH] rtl-optimization/104686 - speedup IRA allocno conflict test

2022-03-02 Thread Vladimir Makarov via Gcc-patches
On 2022-03-02 03:58, Richard Biener wrote: In this PR allocnos_conflict_p takes 90% of the compile-time via the calls from update_conflict_hard_regno_costs. This is due to the high number of conflicts recorded in the dense bitvector representation. Fortunately we can take advantage of the bit

[committed] [PR104637] LRA: Split hard regs as many as possible on one subpass

2022-02-28 Thread Vladimir Makarov via Gcc-patches
The following patch fixes https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104637 The patch was successfully bootstrapped and tested on x86-64, aarch64, and ppc64. commit ec1b9ba2d7913fe5e9deacc8e55e7539262f5124 Author: Vladimir N. Makarov Date: Mon Feb 28 16:43:50 2022 -0500 [PR104637] L

Re: [PATCH] rtl-optimization/104686 - speed up conflict iteration

2022-02-25 Thread Vladimir Makarov via Gcc-patches
On 2022-02-25 09:14, Richard Biener wrote: The following replaces /* Skip bits that are zero. */ for (; (word & 1) == 0; word >>= 1) bit_num++; idioms in ira-int.h in the attempt to speedup update_conflict_hard_regno_costs which we're bound on in PR104686. The tric

Re: [pushed] LRA, rs6000, Darwin: Amend lo_sum use for forced constants [PR104117].

2022-02-22 Thread Vladimir Makarov via Gcc-patches
On 2022-02-20 12:34, Iain Sandoe wrote: ^^^ this is mostly for my education - the stuff below is a potential solution to leaving lra-constraints unchanged and fixing the Darwin bug…. I'd be really glad if you do manage to fix this w/o changing LRA. Richard has a legitimate point that my pro

[committed] [PR104447] LRA: Do not split non-alloc hard regs

2022-02-17 Thread Vladimir Makarov via Gcc-patches
The patch solves the following PR: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104447 The patch was successfully bootstrapped and tested on x86-64. commit db69f666a728ce800a840115829f6b64bc3174d2 Author: Vladimir N. Makarov Date: Thu Feb 17 11:31:50 2022 -0500 [PR104447] LRA: Do not sp

Re: [pushed] LRA, rs6000, Darwin: Amend lo_sum use for forced constants [PR104117].

2022-02-14 Thread Vladimir Makarov via Gcc-patches
On 2022-02-14 11:00, Richard Sandiford wrote: Hi Vlad, Vladimir Makarov via Gcc-patches writes: Hi, Richard.  Change LRA is mine and I approved it for Iain's patch. I think there is no need for this code and it is misleading.  If 'mem[low_sum]' does not work, I don&#x

Re: [pushed] LRA, rs6000, Darwin: Amend lo_sum use for forced constants [PR104117].

2022-02-14 Thread Vladimir Makarov via Gcc-patches
On 2022-02-14 04:44, Richard Sandiford via Gcc-patches wrote: Iain Sandoe via Gcc-patches writes: Two issues resulted in this PR, which manifests when we force a constant into memory in LRA (in PIC code on Darwin). The presence of such forced constants is quite dependent on other RTL optimis

[committed] [PR104400] LRA: Modify exclude start hard register calculation for insn alternative

2022-02-11 Thread Vladimir Makarov via Gcc-patches
The following patch solves https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104400 The patch was successfully tested and bootstrapped on x86-64 and aarch64. commit 274a4d29421e73c9b40c1641986c6ed904e20184 Author: Vladimir N. Makarov Date: Fri Feb 11 09:52:14 2022 -0500 [PR104400] LRA: Modify

[pushed] [PR103676] LRA: Calculate and exclude some start hard registers for reload pseudos

2022-01-21 Thread Vladimir Makarov via Gcc-patches
The following patch solves https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103676 The patch was successfully bootstrapped and tested on x86_64, aarch64, and ppc64. commit 85419ac59724b7ce710ebb4acf03dbd747edeea3 Author: Vladimir N. Makarov Date: Fri Jan 21 13:34:32 2022 -0500 [PR103676] LR

Re: [PATCH] ira: Fix old-reload targets [PR103974]

2022-01-12 Thread Vladimir Makarov via Gcc-patches
On 2022-01-12 03:47, Richard Biener wrote: On Tue, Jan 11, 2022 at 7:41 PM Vladimir Makarov via Gcc-patches wrote: On 2022-01-11 12:42, Richard Sandiford wrote: The new IRA heuristics would need more work on old-reload targets, since flattening needs to be able to undo the cost propagation

Re: [PATCH] ira: Fix old-reload targets [PR103974]

2022-01-11 Thread Vladimir Makarov via Gcc-patches
On 2022-01-11 12:42, Richard Sandiford wrote: The new IRA heuristics would need more work on old-reload targets, since flattening needs to be able to undo the cost propagation. It's doable, but hardly seems worth it. Agree. It is not worth to spend your time for work for reload. This patch th

Re: [PATCH 6/6] ira: Handle "soft" conflicts between cap and non-cap allocnos

2022-01-10 Thread Vladimir Makarov via Gcc-patches
On 2022-01-06 09:48, Richard Sandiford wrote: This patch looks for allocno conflicts of the following form: - One allocno (X) is a cap allocno for some non-cap allocno X2. - X2 belongs to some loop L2. - The other allocno (Y) is a non-cap allocno. - Y is an ancestor of some allocno Y2 in L2. -

Re: [PATCH 5/6] ira: Consider modelling caller-save allocations as loop spills

2022-01-10 Thread Vladimir Makarov via Gcc-patches
On 2022-01-06 09:48, Richard Sandiford wrote: If an allocno A in an inner loop L spans a call, a parent allocno AP can choose to handle a call-clobbered/caller-saved hard register R in one of two ways: (1) save R before each call in L and restore R after each call (2) spill R to memory through

Re: [PATCH 4/6] ira: Try to avoid propagating conflicts

2022-01-10 Thread Vladimir Makarov via Gcc-patches
On 2022-01-06 09:47, Richard Sandiford wrote: Suppose that: - an inner loop L contains an allocno A - L clobbers hard register R while A is live - A's parent allocno is AP Previously, propagate_allocno_info would propagate conflict sets up the loop tree, so that the conflict between A and R w

Re: [PATCH 3/6] ira: Add ira_subloop_allocnos_can_differ_p

2022-01-07 Thread Vladimir Makarov via Gcc-patches
On 2022-01-06 09:47, Richard Sandiford wrote: color_pass has two instances of the same code for propagating non-cap assignments from parent loops to subloops. This patch adds a helper function for testing when such propagations are required for correctness and uses it to remove the duplicated

Re: [PATCH 2/6] ira: Add comments and fix move_spill_restore calculation

2022-01-07 Thread Vladimir Makarov via Gcc-patches
On 2022-01-06 09:46, Richard Sandiford wrote: This patch adds comments to describe each use of ira_loop_border_costs. I think this highlights that move_spill_restore was using the wrong cost in one case, which came from tranposing [0] and [1] in the original (pre-ira_loop_border_costs) ira_memo

Re: [PATCH 1/6] ira: Add a ira_loop_border_costs class

2022-01-07 Thread Vladimir Makarov via Gcc-patches
On 2022-01-06 09:46, Richard Sandiford wrote: The final index into (ira_)memory_move_cost is 1 for loads and 0 for stores. Thus the combination: entry_freq * memory_cost[1] + exit_freq * memory_cost[0] is the cost of loading a register on entry to a loop and storing it back on exit from t

Re: [PATCH 0/6] ira: Fix performance regression in exchange2 [PR98782]

2022-01-07 Thread Vladimir Makarov via Gcc-patches
On 2022-01-06 09:45, Richard Sandiford wrote: This series of patches recovers the exchange2 performance lost in the GCC 11 timeframe (at least on aarch64 and Power9 -- thanks Pat for testing the latter). There are 6 patches, split into two groups of 3. The first 3 are just preparatory patches

[committed] [PR99531] Do not scan push insn for ia32 in the test

2021-12-14 Thread Vladimir Makarov via Gcc-patches
This is one more patch for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99531 The following patch fixes the test failure on ia32. commit 4ddeae2b2777aa5136fc2bb21c15b0fcccdafece Author: Vladimir N. Makarov Date: Tue Dec 14 08:57:30 2021 -0500 [PR99531] Do not scan push insn for ia32 in

[committed][PR99531] IRA:Modify pseudo class cost calculation when processing move involving the pseudo and a hard register

2021-12-13 Thread Vladimir Makarov via Gcc-patches
The following patch solves https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99531 The patch was successfully bootstrapped and tested on x86-64, aarch64, and ppc64. After some observation, if all is ok, I will commit the patch into gcc release branches mentioned in the PR. [PR99531] Modify

Re: [PR103437] [committed] IRA: Process multiplication overflow in priority calculation for allocno assignments

2021-12-02 Thread Vladimir Makarov via Gcc-patches
On 2021-12-02 12:21, Vladimir Makarov via Gcc-patches wrote: On 2021-12-02 12:06, Vladimir Makarov wrote: So simple problem and so many details :) This will require that long long is at least twice as large as int everywhere, I thought you wanted to do that only when

Re: [PR103437] [committed] IRA: Process multiplication overflow in priority calculation for allocno assignments

2021-12-02 Thread Vladimir Makarov via Gcc-patches
On 2021-12-02 12:06, Vladimir Makarov wrote: On 2021-12-02 11:13, Jakub Jelinek wrote: On Thu, Dec 02, 2021 at 11:03:46AM -0500, Vladimir Makarov wrote: --- a/gcc/ira-color.c +++ b/gcc/ira-color.c @@ -2797,6 +2797,7 @@ static void   setup_allocno_priorities (ira_allocno_t *consideration_allo

Re: [PR103437] [committed] IRA: Process multiplication overflow in priority calculation for allocno assignments

2021-12-02 Thread Vladimir Makarov via Gcc-patches
On 2021-12-02 11:13, Jakub Jelinek wrote: On Thu, Dec 02, 2021 at 11:03:46AM -0500, Vladimir Makarov wrote: --- a/gcc/ira-color.c +++ b/gcc/ira-color.c @@ -2797,6 +2797,7 @@ static void setup_allocno_priorities (ira_allocno_t *consideration_allocnos, int n) { int i, length, nrefs, prio

Re: [PR103437] [committed] IRA: Process multiplication overflow in priority calculation for allocno assignments

2021-12-02 Thread Vladimir Makarov via Gcc-patches
On 2021-12-02 10:52, Christophe Lyon wrote: On Thu, Dec 2, 2021 at 3:38 PM Vladimir Makarov via Gcc-patches wrote: On 2021-12-02 09:29, Jakub Jelinek wrote: > On Thu, Dec 02, 2021 at 09:23:20AM -0500, Vladimir Makarov wrote: >> On 2021-12-02 09:00, Jakub Jeli

Re: [PR103437] [committed] IRA: Process multiplication overflow in priority calculation for allocno assignments

2021-12-02 Thread Vladimir Makarov via Gcc-patches
On 2021-12-02 09:29, Jakub Jelinek wrote: On Thu, Dec 02, 2021 at 09:23:20AM -0500, Vladimir Makarov wrote: On 2021-12-02 09:00, Jakub Jelinek wrote: On Thu, Dec 02, 2021 at 08:53:31AM -0500, Vladimir Makarov via Gcc-patches wrote: The following patch fixes https://gcc.gnu.org/bugzilla

Re: [PR103437] [committed] IRA: Process multiplication overflow in priority calculation for allocno assignments

2021-12-02 Thread Vladimir Makarov via Gcc-patches
On 2021-12-02 09:00, Jakub Jelinek wrote: On Thu, Dec 02, 2021 at 08:53:31AM -0500, Vladimir Makarov via Gcc-patches wrote: The following patch fixes https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103437 The patch was successfully bootstrapped and tested on x86-64. There is no test as the

[PR103437] [committed] IRA: Process multiplication overflow in priority calculation for allocno assignments

2021-12-02 Thread Vladimir Makarov via Gcc-patches
The following patch fixes https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103437 The patch was successfully bootstrapped and tested on x86-64. There is no test as the bug occurs on GCC built with sanitizing for an existing go test. commit c6cf5ac1522c54b2ced98fc687e973a9ff17ba1e Author: Vladimir

[committed] [PR102842] LRA: Consider all outputs in generation of matching reloads

2021-10-26 Thread Vladimir Makarov via Gcc-patches
The following patch fixes https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102842 As the patch touches a sensitive LRA code, the patch was bootstrapped tested on x86-64, aarch64, and ppc64. I've committed the patch only in master branch.  Later (after some observation), I'll commit it into gcc-1

[committed] LRA: [PR102627] Use at least natural mode during splitting hard reg live range

2021-10-08 Thread Vladimir Makarov via Gcc-patches
The following patch fixes    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102627 The patch was successfully bootstrapped and tested on x86-64. commit fab2d977e69539aad9bef81caff17de48e53aedf (HEAD -> master) Author: Vladimir N. Makarov Date: Fri Oct 8 10:16:09 2021 -0400 [PR102627] Use

[pushed] IRA: Make profitability calculation of RA conflict presentations independent of host compiler type sizes of RA conflict presentations independent of host compiler type sizes [PR102147]

2021-09-24 Thread Vladimir Makarov via Gcc-patches
The following patch solves https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102147 The patch was successfully bootstrapped and tested on x86-64. commit ec4c30b64942e615b4bb4b9761cd3b2635158608 (HEAD -> master) Author: Vladimir N. Makarov Date:   Fri Sep 24 10:06:45 2021 -0400     Make profitabil

Re: [PATCH v4] ira: Support more matching constraint forms with param [PR100328]

2021-07-05 Thread Vladimir Makarov via Gcc-patches
On 2021-07-01 10:11 p.m., Kewen.Lin wrote: Hi Vladimir, on 2021/6/30 下午11:24, Vladimir Makarov wrote: Many thanks for your review! I've updated the patch according to your comments and also polished some comments and document words a bit. Does it look better to you? Sorry for the delay

Re: [RFC/PATCH v3] ira: Support more matching constraint forms with param [PR100328]

2021-06-30 Thread Vladimir Makarov via Gcc-patches
On 2021-06-28 2:26 a.m., Kewen.Lin wrote: Hi! on 2021/6/9 下午1:18, Kewen.Lin via Gcc-patches wrote: Hi, PR100328 has some details about this issue, I am trying to brief it here. In the hottest function LBM_performStreamCollideTRT of SPEC2017 bmk 519.lbm_r, there are many FMA style expression

Re: [RFC/PATCH v3] ira: Support more matching constraint forms with param [PR100328]

2021-06-30 Thread Vladimir Makarov via Gcc-patches
On 2021-06-28 2:26 a.m., Kewen.Lin wrote: Hi! on 2021/6/9 下午1:18, Kewen.Lin via Gcc-patches wrote: Hi, PR100328 has some details about this issue, I am trying to brief it here. In the hottest function LBM_performStreamCollideTRT of SPEC2017 bmk 519.lbm_r, there are many FMA style expression

Re: [backport gcc10, gcc9] Requet to backport PR97969

2021-05-31 Thread Vladimir Makarov via Gcc-patches
On 2021-05-25 5:14 a.m., Przemyslaw Wirkus wrote: Hi, Just a follow up after GCC 11 release. I've backported to gcc-10 branch (without any change to original patches) PR97969 and following PR98722 & PR98777 patches. Commits apply cleanly without changes. Built and regression tested on: * arm-

Re: [PATCH] lra: Avoid cycling on certain subreg reloads [PR96796]

2021-04-23 Thread Vladimir Makarov via Gcc-patches
On 2021-04-23 12:13 p.m., Richard Sandiford wrote: This is a backport of the PR96796 fix to GCC 10 and GCC 9. The original trunk patch was: https://gcc.gnu.org/pipermail/gcc-patches/2020-August/552878.html reviewed here: https://gcc.gnu.org/pipermail/gcc-patches/2020-September/55330

[committed] [PR100066] Check paradoxical subreg when splitting hard reg live range

2021-04-14 Thread Vladimir Makarov via Gcc-patches
The following patch fixes   https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100066 The patch was successfully bootstrapped and tested on x86-64, aarch64, and ppc64. commit f99f64f69db49ce6343d79a39eab28dcc6b91865 Author: Vladimir N. Makarov Date: Wed Apr 14 13:21:40 2021 -0400 [PR100066]

  1   2   >