Re: [PATCH 2/2v2] [ira] avoid resetting ira_reg_equiv for function invariants

2025-09-18 Thread Vladimir Makarov
On 9/15/25 12:51 PM, Alexandre Oliva wrote: An aarch64 toolchain built with --enable-default-pie fails gcc.target/aarch64/sme/nonlocal_goto_[123].c because the register allocator ends up resetting equivalences, so it concludes it needs to preserve a rematerializable function invariant across a

Re: [RFA] Fix latent LRA bug

2025-09-12 Thread Vladimir Makarov
On 9/12/25 1:01 PM, Jeff Law wrote: Shreya's work to add the addptr pattern on the RISC-V port exposed a latent bug in LRA. We lazily allocate/reallocate the ira_reg_equiv structure and when we do (re)allocation we'll over-allocate and zero-fill so that we don't have to actually allocate an

Re: [PATCH] ira: Remove the issue code in improve_allocation. [PR117838]

2025-08-29 Thread Vladimir Makarov
On 8/22/25 3:25 AM, yes wrote: From: "Cui, Lili" Hi, This patch aims to remove issue code in improve_allocation that was causing expensive allocno overflows. Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? Yes, you can commit it into the trunk with minor change (see Chang

Re: [PATCH] ira: Remove the issue code in improve_allocation. [PR117838]

2025-08-29 Thread Vladimir Makarov
On 8/29/25 1:45 AM, Cui, Lili wrote: Gentle ping for this patch. I am evaluating the patch on SPEC2017.  When I finish this, I most probably give an approval. Thank you.

[pushed]PR121007, LRA]: Fall back to reload of whole inner address in PR case and constrain iteration number of address reloads

2025-07-11 Thread Vladimir Makarov
The following patch solves https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121007 The patch was successfully bootstrapped and tested on amd64, arm64, ppc64le. commit 06c41504bd4a23c3f5848793fda503c30fe51353 Author: Vladimir N. Makarov Date: Fri Jul 11 11:27:54 2025 -0400 [PR121007, LRA]: F

Re: [PATCH 2/2] lra: Reallow reloading user hard registers if the insn is not asm [PR 120983]

2025-07-11 Thread Vladimir Makarov
On 7/8/25 9:43 PM, Xi Ruoyao wrote: The PR 87600 fix has disallowed reloading user hard registers to resolve earlyclobber-induced conflict. However before reload, recog completely ignores the constraints of insns, so the RTL passes may produce insns where some user hard registers violate an ea

Re: [RFC] [lra] catch all to-sp eliminations [PR120424]

2025-06-26 Thread Vladimir Makarov
On 6/26/25 1:51 AM, Alexandre Oliva wrote: On Jun 25, 2025, Vladimir Makarov wrote: This patch is ok for me.  I am a big fan of asserts. They helped to catch so many bugs on early stages. Thank you, Alex. for gcc/ChangeLog PR rtl-optimization/120424 * lra

Re: [PATCH] [lra] reorder operations in lra_update_fp2sp_elimination [PR120424]

2025-06-26 Thread Vladimir Makarov
On 6/23/25 12:00 AM, Alexandre Oliva wrote: And here's a followup to clean up the mess I made in lra_update_fp2sp_elimination, without any functional changes. The various recent additions to lra_update_fp2sp_elimination rendered it somewhat confusing, with intermixed groups of statements pert

Re: [PATCH] [lra] apply elimination offsets to MEM in autoinc address [PR120424]

2025-06-26 Thread Vladimir Makarov
On 6/23/25 12:01 AM, Alexandre Oliva wrote: When attempting to bootstrap arm-linux-gnueabihf with {BOOT_C,T}FLAGS='-g -O2 -fnon-call-exceptions -fstack-clash-protection', gmp fails to build in stage2: gen-fac's mpz_and gets miscompiled. A pseudo is initialized before a loop and used in a PRE_I

Re: [PATCH] [lra] rework deactivation of fp2sp elimination [PR120424]

2025-06-26 Thread Vladimir Makarov
On 6/22/25 11:59 PM, Alexandre Oliva wrote: On Jun 13, 2025, Vladimir Makarov wrote: * lra-eliminations.cc (lra_update_fp2sp_elimination): Inactivate the unused fp2sp elimination right away. Alas, this seems to cause trouble on arm-linux-gnueabihf bootstraps. This is OK. In many cases It

Re: [PATCH] [genoutput] mark scratch outputs as eliminable [PR120424]

2025-06-26 Thread Vladimir Makarov
On 6/22/25 11:54 PM, Alexandre Oliva wrote: Regstrapped on x86_64-linux-gnu, bootstrapped on arm-linux-gnueabihf (arm and thumb modes), also tested with gcc-14 on arm-vx7r2 and arm-linux-gnueabihf. Ok to install? It is OK for me.  Thank you, Alex for gcc/ChangeLog PR rtl-optimiza

Re: [RFC] [lra] catch all to-sp eliminations [PR120424]

2025-06-25 Thread Vladimir Makarov
On 6/23/25 12:06 AM, Alexandre Oliva wrote: Alex, thanks for investigation of corner cases of register elimination. An x86_64-linux-gnu native with ix86_frame_pointer_required modified to return true for nonzero frames, to exercize lra_update_fp2sp_elimination, reveals in stage1 testing that

Re: [PATCH v4 1/4] Hard register constraints

2025-06-20 Thread Vladimir Makarov
On 5/20/25 3:22 AM, Stefan Schulze Frielinghaus wrote: Implement hard register constraints of the form {regname} where regname must be a valid register name for the target. Such constraints may be used in asm statements as a replacement for register asm and in machine descriptions. --- gcc/c

Re: [PATCH] [lra] recompute ranges upon disabling fp2sp elimination [PR120424]

2025-06-19 Thread Vladimir Makarov
On 6/19/25 7:43 AM, Alexandre Oliva wrote: If the frame size grows to nonzero, arm_frame_pointer_required may flip to true under -fstack-clash-protection -fnon-call-exceptions, and that may disable the fp2sp elimination part-way through lra. If pseudos had got assigned to the frame pointer reg

Re: [PATCH] [lra] force reg update after spilling to memory [PR120424]

2025-06-13 Thread Vladimir Makarov
On 6/6/25 3:21 AM, Alexandre Oliva wrote: On Jun 6, 2025, Alexandre Oliva wrote: Now, since lra_update_fp2sp_elimination checks that !elimination_fp2sp_occured_p, we *could* disable the fp2sp elimination, if it's selected, right away, so that it is not applied after we've disabled it, and t

Re: [PATCH] [lra] force reg update after spilling to memory [PR120424]

2025-05-27 Thread Vladimir Makarov
On 5/24/25 11:06 PM, Alexandre Oliva wrote: In the added C++ testcase, a stack slot at a negative sp offset is used to hold a value across a call. There are a couple of causes that directly lead to this outcome: - the -fstack-clash-protection and -fnon-call-exception options, that cause arm_f

Re: [PATCH,LRA] Do inheritance transformations for any optimization [PR118591]

2025-04-25 Thread Vladimir Makarov
On 4/19/25 3:29 PM, Denis Chertykov wrote: Bugfix for PR118591 This bug occurs only with '-Os' option. The function 'inherit_reload_reg ()' have a wrong condition: static bool inherit_reload_reg (bool def_p, int

Re: [PATCH] LRA: Backport PR115568 and PR119689 to release branches

2025-04-11 Thread Vladimir Makarov
On 4/11/25 2:29 AM, Uros Bizjak wrote: Hello! I would like to backport PR115568 and PR119689 to release branches. Author: Richard Biener Date: Wed Apr 9 14:36:19 2025 +0200 rtl-optimization/119689 - compare-debug failure with LRA The previous change to fix LRA rematerialization b

Re: [PATCH] rtl-optimization/119689 - compare-debug failure with LRA

2025-04-09 Thread Vladimir Makarov
On 4/9/25 8:40 AM, Richard Biener wrote: The previous change to fix LRA rematerialization broke compare-debug for i586 bootstrap. Fixed by using prev_nonnote_nondebug_insn instead of prev_nonnote_insn. Bootstrapped on i586-linux where the miscompare is gone with this patch. Bootstrap and reg

Re: [gcc-14 PATCH] Reuse scratch registers generated by LRA

2025-03-28 Thread Vladimir Makarov
On 3/27/25 7:49 AM, Xi Ruoyao wrote: I'm proposing the backport to fix an ICE building gegl on powerpc64le: https://gcc.gnu.org/PR119340. Bootstrapped and regtested on powerpc64le-linux-gnu, OK for releases/gcc-14? OK for me.  Thank you for working on PR119340. gcc/lra-constraints.cc

Re: [PATCH] lra, v2: emit caller-save register spills before call insn [PR116028]

2025-03-25 Thread Vladimir Makarov
On 3/21/25 9:00 AM, Jakub Jelinek wrote: Hi! Here is an updated version of Surya's PR116028 fix from August, which got reverted because it caused bootstrap failures on aarch64, later on bootstrap comparison errors there as well and problems on other targets as well. The changes compared to the

[pushed][PR119270][IRA]: Ignore equiv init insns for cost calculation for invariants only

2025-03-19 Thread Vladimir Makarov
The following patch fixes https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119270 The patch was successfully bootstrapped and tested on x86_64 and aarch64. commit 6c443e128802bd93158a3db7c4edf5fc1fc76c8d Author: Vladimir N. Makarov Date: Wed Mar 19 16:06:41 2025 -0400 [PR119270][IRA]: Ignor

Re: [PATCH] lra: Handle SUBREG in lra_rtx_hash [PR119307]

2025-03-18 Thread Vladimir Makarov
On 3/18/25 4:38 AM, Jakub Jelinek wrote: Hi! The following testcase ICEs starting with r15-3213 in decompose_normal_address and starting with r15-3288 ICEs in lra_rtx_hash, which since r8-5466 can't handle SUBREG (previously SUBREG was "ei" and lra_rtx_hash can handle that through val += lra_r

[pushed][PR119285][IRA]: Use an additional way of reg equiv invariant substitution correctness

2025-03-17 Thread Vladimir Makarov
The following patch fixes https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119285 The patch was successfully bootstrapped and tested on x86_64 and aarch64. I've checked the patch for SPEC2017 lbm_s on Zen4 and i5-13600k and don't see performance or code size change anymore. I also checked whole

[pushed][PR114991][IRA]: Improve reg equiv invariant calculation

2025-03-10 Thread Vladimir Makarov
The following patch solves performance issue mentioned in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114991 The patch was successfully bootstrapped and tested on x86_64, aarch64, ppc64le. commit e355fe414aa3aaf215c7dd9dd789ce217a1b458c Author: Vladimir N. Makarov Date: Mon Mar 10 16:26:5

[pushed][PR118940][LRA]: Add a test

2025-02-27 Thread Vladimir Makarov
The following patch adds a test for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118940 The PR is actually solved by a patch I submitted this week for another PR. commit 3071eb2848a2e748cfd67e8c897890ce06c69d06 Author: Vladimir N. Makarov Date: Thu Feb 27 13:39:04 2025 -0500 [PR118940][

[pushed][PR116336][LRA]: Add a test

2025-02-27 Thread Vladimir Makarov
This is a test taken from https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116336 The PR is actually solved a few weeks ago. commit e59dd301aea9c8d5a5d04e808c87d591a26e85bb Author: Vladimir N. Makarov Date: Thu Feb 27 13:05:44 2025 -0500 [PR116336][LRA]: Add a test Patch for PR11

[pushed]PR119021][LRA]: Fix rtl correctness check failure in LRA.

2025-02-26 Thread Vladimir Makarov
The following patch solves https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119021 The patch was successfully tested and bootstrapped on x86-64. commit 7ce3a8e872d945d537a7e7ba1bd3f45b1cf9a6d2 Author: Vladimir N. Makarov Date: Wed Feb 26 11:28:08 2025 -0500 [PR119021][LRA]: Fix rtl correctn

[pushed][PR115458][LRA]: Run split sub-pass more times

2025-02-25 Thread Vladimir Makarov
The following patch fixes https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115458 The patch was successfully bootstrapped and tested on x86-64, ppc64le, aarch64. commit 2341f675edadd6370147d2bc55ca7761a7ecfaa1 Author: Vladimir N. Makarov Date: Tue Feb 25 15:01:15 2025 -0500 [PR115458][LRA

Re: [PATCH v2] ira: Add a target hook for callee-saved register cost scale

2025-02-14 Thread Vladimir Makarov
On 2/14/25 12:27 PM, Peter Bergner wrote: On 2/14/25 10:43 AM, Vladimir Makarov wrote: The patch is very well described and it is OK for me to commit it into the trunk. Thank you for working on this issue, Richard. If we have some new failures on targets I believe the hook has enough

Re: [PATCH v2] ira: Add a target hook for callee-saved register cost scale

2025-02-14 Thread Vladimir Makarov
On 2/13/25 11:08 AM, Richard Sandiford wrote: From 46ad583e65a1c5a27e2203a7571bba6eb0766bc6 Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Fri, 7 Feb 2025 15:40:21 + Subject: [PATCH] ira: Add new hooks for callee-save vs spills [PR117477] To: gcc-patches@gcc.gnu.org Following on

Re: [PATCH v2] ira: Add a target hook for callee-saved register cost scale

2025-02-11 Thread Vladimir Makarov
On 2/7/25 12:18 PM, Richard Sandiford wrote: FWIW, here's a very rough initial version of the kind of thing I was thinking about. Hopefully the hook documentation describes the approach. It's deliberately (overly?) flexible. I've included an aarch64 version that (a) models the fact that the

Re: [PATCH v2] ira: Add a target hook for callee-saved register cost scale

2025-02-07 Thread Vladimir Makarov
On 2/6/25 5:35 PM, Jan Hubicka wrote: Register 3 (first caller saved) has cost 11000. This comes from: add_cost = ((ira_memory_move_cost[mode][rclass][0] + ira_memory_move_cost[mode][rclass][1]) * saved_nregs / hard_regno_nregs (

Re: [PATCH v2] ira: Add a target hook for callee-saved register cost scale

2025-02-06 Thread Vladimir Makarov
On 2/6/25 4:54 PM, Richard Sandiford wrote: Vladimir Makarov writes: This is a complicated problem resulted in many tries to fix it in some general way. In general I am agree with Surya's approach to scale cost of reg saves/restores somehow.  But the general approach, although solved

Re: [PATCH v2] ira: Add a target hook for callee-saved register cost scale

2025-02-06 Thread Vladimir Makarov
On 2/3/25 1:20 AM, H.J. Lu wrote: commit 3b9b8d6cfdf59337f4b7ce10ce92a98044b2657b Author: Surya Kumari Jangala Date: Tue Jun 25 08:37:49 2024 -0500 ira: Scale save/restore costs of callee save registers with block frequency scales the cost of saving/restoring a callee-save hard regist

Re: [PATCH] lra: initialize allocated_hard_reg_p[] for hard regs referenced in RTL [PR118533]

2025-02-06 Thread Vladimir Makarov
On 1/28/25 1:11 PM, Surya Kumari Jangala wrote: Hi, The following patch has been bootstrapped and regtested on powerpc64le-linux, aarch64-linux and x86_64-linux. This patch is a proposed fix for PR118533. Request you to please review the patch. Regards Surya lra: initialize allocated_hard_re

[pushed][PR115568][LRA]: Use more strict output reload check in rematerialization

2025-02-05 Thread Vladimir Makarov
The following patch fixes https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115568 The patch was successfully bootstrapped and tested on x86-64. commit 98545441308c2ae4d535f14b108ad6551fd927d5 Author: Vladimir N. Makarov Date: Wed Feb 5 14:23:23 2025 -0500 [PR115568][LRA]: Use more strict ou

[pushed][PR116234][LRA]: Check debug insn when looking at one insn pseudo occurrence

2025-01-31 Thread Vladimir Makarov
The following patch solves https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116234 The patch was successfully bootstrapped and tested on x86_64, aarch64, ppc64le. commit decc6c0d4d909ce510b6533c48d70d0b353f909a Author: Vladimir N. Makarov Date: Fri Jan 31 09:39:45 2025 -0500 [PR116234][LR

[pushed][PR118663][LRA]: Change secondary memory mode only if there are regs holding the changed mode

2025-01-28 Thread Vladimir Makarov
The patch in the attachment solves https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118663 The patch was successfully bootstrapped and tested on ppc64le, x86_64, aarch64. commit 01339d29b7663d85eea6145eac2b1ad1da428c11 Author: Vladimir N. Makarov Date: Tue Jan 28 08:37:33 2025 -0500 [PR11

[pushed][PR118497][IRA]: Fix calculation of cost of assigning callee-saved hard reg

2025-01-24 Thread Vladimir Makarov
The following patch fixes https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118497 The patch was successfully bootstrapped and tested on x86_64, aarch64, ppc64le. The patch changes cost calculation and in many cases it results in new testsuite failures on different targets.   But I hope it will n

[pushed][PR118560][LRA]: Fix typo in checking secondary memory mode for the reg class

2025-01-20 Thread Vladimir Makarov
The patch fixes https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118560 Successfully tested and bootstrapped on x86-64,aarch64,ppc64le. commit 07f62ed9a7b09951f83855e19d41641b098190b1 Author: Vladimir N. Makarov Date: Mon Jan 20 17:08:50 2025 -0500 [PR118560][LRA]: Fix typo in checking secon

Re: [PATCH,LRA] Restrict the reuse of spill slots [PR117868]

2025-01-20 Thread Vladimir Makarov
On 1/18/25 1:19 AM, Denis Chertykov wrote: Vladimir Makarov writes: I'd prefer something like the patch in the attachment. It is simpler and even removing more LRA code than adding one. But most important, it generates smaller reserved stack space as QI and TI pseudos will share the

Re: [pushed]PR118067][LRA]: Check secondary memory mode for the reg class

2025-01-20 Thread Vladimir Makarov
On 1/19/25 2:28 PM, Uros Bizjak wrote: On Fri, Jan 17, 2025 at 10:01 PM Vladimir Makarov wrote: This is one more patch to solve https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118067 with different -mcpu used. The patch was successfully bootstrapped and tested on x86-64, aarch64, and

Re: [PATCH,LRA] Restrict the reuse of spill slots [PR117868]

2025-01-17 Thread Vladimir Makarov
On 1/11/25 1:15 PM, Denis Chertykov wrote: The fix for PR117868. In brief: this is an LRA bug derived from reuse spilling slots after frame pointer spilling. The slot was created for QImode (1 byte) and it was reused after spilling of the frame pointer for TImode register (16 bytes long) and

[pushed]PR118067][LRA]: Check secondary memory mode for the reg class

2025-01-17 Thread Vladimir Makarov
This is one more patch to solve https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118067 with different -mcpu used. The patch was successfully bootstrapped and tested on x86-64, aarch64, and ppc64le. commit 9f009e8865cda01310c52f7ec8bdaa3c557a2745 Author: Vladimir N. Makarov Date: Fri Jan 17 1

[pushed]PR118067][LRA]: Use the right mode to evaluate secondary memory reload

2025-01-16 Thread Vladimir Makarov
The following patch solves https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118067 The patch was successfully tested and bootstrapped on x86_64, aarch64, and ppc64le. commit d9835825b3d7193b3d6669174f4386be2cb1 Author: Vladimir N. Makarov Date: Thu Jan 16 12:17:31 2025 -0500 [PR118067

[pushed][PR118017][LRA]: Fix test for i686

2025-01-10 Thread Vladimir Makarov
The commit message contains an explanation. commit 94d8de53388793f4d5fc0d0aa00fef32ca4aa870 Author: Vladimir N. Makarov Date: Fri Jan 10 10:36:24 2025 -0500 [PR118017][LRA]: Fix test for i686 My previous patch for PR118017 contains a test which fails on i686. The patch fixes this

[pushed][PR118017][LRA]: Don't inherit reg of non-uniform reg class

2025-01-09 Thread Vladimir Makarov
The patch in the attachment solves https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118017 The patch was successfully bootstrapped and tested on x86-64 and aarch64. commit 6ffaed8d8713874b7c4ee112249ed8a91ff9 Author: Vladimir N. Makarov Date: Thu Jan 9 16:22:02 2025 -0500 [PR118017][LRA

[pushed][PR117248][LRA]: Fix calculation of conflict hard regs of pseudo

2024-12-18 Thread Vladimir Makarov
The following patch is for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117248 The first patch variant resulted in PR117999 (new libgo test failures). The patch was successfully bootstrapped and tested on x86-64. The patch was also checked for libgo on arm for PR11799. commit 936058ce9ed159b4

[pushed]revert "[PR117248][LRA]: Rewriting reg notes update and fix calculation of conflict hard regs of pseudo."

2024-12-18 Thread Vladimir Makarov
The patch reverses a fix for PR117248 because it adds new failures in libgo test on arm (PR117999). I'll fix PR117248 with another patch soon which will not result in PR117999. commit 1a28ff1c01c290d50fb4ebd6e6a49482195cab9c Author: Vladimir N. Makarov Date: Wed Dec 18 13:28:43 2024 -0500

[pushed][PR116778][LRA]: Check pseudos assigned to FP after rematerialization to build live ranges

2024-12-11 Thread Vladimir Makarov
The following patch is a better solution for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116778 The patch was successfully tested and bootstrapped on x86-64, aarch64, ppc64le. commit fca0ab08cd936464b152e9b45356f625eba27575 Author: Vladimir N. Makarov Date: Wed Dec 11 15:36:21 2024 -0500

[pushed][PR117946][LRA]: When assigning hard reg use biggest mode to check ira_prohibited_class_mode_regs

2024-12-10 Thread Vladimir Makarov
The following patch fixes https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117946 The patch was successfully tested and bootstrapped on x86_64, ppc64le, aarch64. commit 6fc3da8fa2af1d4ee154ea803636eabde358b553 Author: Vladimir N. Makarov Date: Tue Dec 10 12:50:27 2024 -0500 [PR117946][LRA

[pushed][PR117248][LRA]: Rewriting reg notes update and fix calculation of conflict hard regs of pseudo.

2024-12-06 Thread Vladimir Makarov
The following patch solves https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117248 I tested the patch extensively on x86-64, aarch64, ppc64le as the patch contains big changes in live analysis and reg notes update.  I hope it will not result in new PRs. commit 75e7d1600f47859df40b2ac0feff5a71e0d

Re: [patch,lra] PR116778 we need a full live range info after rematerialization

2024-12-06 Thread Vladimir Makarov
The proposed patch can be a fix and you can commit it.  The only request is not to close PR for now. LRA rematerialization sub-pass rematerializes insn containing only pseudos assigned to hard regs and should not change live-range of spilling pseudos.  So  sentence "Rematerialization sometimes

Re: [pushed][PR117770][LRA]: Check hard regs corresponding insn operands for hard reg clobbers

2024-11-29 Thread Vladimir Makarov
Sorry, I forgot to add the patch itself.  Here it is. On 11/29/24 15:01, Vladimir Makarov wrote: The following patch solves https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117770 The patch was successfully tested and bootstrapped on x864_64, aarch64, ppc64le. commit

[pushed][PR117770][LRA]: Check hard regs corresponding insn operands for hard reg clobbers

2024-11-29 Thread Vladimir Makarov
The following patch solves https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117770 The patch was successfully tested and bootstrapped on x864_64, aarch64, ppc64le.

Re: Backport two LRA patches to gcc-14 branch

2024-11-27 Thread Vladimir Makarov
On 11/27/24 04:05, Uros Bizjak wrote: Hello! I'd like to backport two LRA patches to gcc-14 branch: 1. [PR114942][LRA]: Don't reuse input reload reg of inout early clobber operand https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=9585317f0715699197b1313bbf939c6ea3c1ace6 2. [PR117105][LRA]: Use

[pushed][PR117105][LRA]: Use unique value reload pseudo for early clobber operand

2024-11-25 Thread Vladimir Makarov
The following patch solves https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117105 The patch was successfully tested and bootstrapped on x86-64, ppc64le, aarch64. commit 4b09e2c67ef593db171b0755b46378964421782b Author: Vladimir N. Makarov Date: Mon Nov 25 16:09:00 2024 -0500 [PR117105][LRA]

[pushed][PR116587][LRA]: Fix last chance reload pseudo allocation

2024-11-20 Thread Vladimir Makarov
The following patch fixes https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116587 The patch was successfully tested and bootstrapped on x86-64, ppc64le, aarch64. commit 56fc6a6d9edc9f9170285ef31c7f312608fad88c Author: Vladimir N. Makarov Date: Wed Nov 20 14:25:41 2024 -0500 [PR116587][LRA

Re: [patch,lra] PR117191 remove unnecessary CLOBBER insns after LRA

2024-11-14 Thread Vladimir Makarov
On 11/13/24 14:10, Denis Chertykov wrote: The fix for PR117191 Wrong code appears after dse2 pass because it removes necessary insns. (ie insn 554 - store to frame spill slot) This happened because LRA pass doesn't cleanup the code exactly like reload does. The reload1.c has a special pass f

Re: [PATCH][LRA][PR116550] Reuse scratch registers generated by LRA

2024-10-16 Thread Vladimir Makarov
On 10/10/24 14:32, Denis Chertykov wrote: The patch is very simple. On x86_64, it bootstraps+regtests fine. Ok for trunk? Sorry for the delay with the answer. I missed your patch and pinging it was the right thing to do. Thanks for the detail explanation of the problem which makes me easy

Re: [PATCH] lra: Don't apply eliminations to allocated registers [PR116321]

2024-08-22 Thread Vladimir Makarov
On 8/22/24 04:44, Richard Sandiford wrote: The sequence of events in this PR is that: - the function has many addresses in which only a single hard base register is acceptable. Let's call the hard register H. - IRA allocates that register to one of the pseudo base registers. Let's call

Re: [PATCH/RFC] LRA: Don't emit move for substituted CONSTATNT_P operand [PR116170]

2024-08-12 Thread Vladimir Makarov
On 8/11/24 21:50, Kewen.Lin wrote: diff --git a/gcc/lra-constraints.cc b/gcc/lra-constraints.cc index 92b343fa99a..f355c6c6168 100644 --- a/gcc/lra-constraints.cc +++ b/gcc/lra-constraints.cc @@ -4742,7 +4742,9 @@ curr_insn_transform (bool check_only_p) } *loc = new_reg

Re: [PATCH] lra: emit caller-save register spills before call insn [PR116028]

2024-08-09 Thread Vladimir Makarov
On 8/9/24 17:00, Peter Bergner wrote: On 8/9/24 12:02 PM, Vladimir Makarov wrote: I believe your should reverse the original patch and all the patches you submitted to fix the issues with the original patch. I agree this commit should be reverted and Kyrill has pushed that already, so

Re: [PATCH/RFC] LRA: Don't emit move for substituted CONSTATNT_P operand [PR116170]

2024-08-09 Thread Vladimir Makarov
On 8/9/24 05:49, Kewen.Lin wrote: Hi, Commit r15-2084 exposes one ICE in LRA. Firstly, before r15-2084 KFmode has 126 bit precision while V1TImode has 128 bit precision, so the subreg (subreg:V1TI (reg:KF 131) 0) is paradoxical_subreg_p, which stops some passes from doing some optimization.

Re: [PATCH] lra: emit caller-save register spills before call insn [PR116028]

2024-08-09 Thread Vladimir Makarov
On 8/9/24 08:58, Surya Kumari Jangala wrote: I am looking into this failure. Sorry for delay with this email.  I was on vacation. I believe your should reverse the original patch and all the patches you submitted to fix the issues with the original patch. This is a standard procedure in s

Re: [PATCH] Improve optimizer to avoid stack spill across pure function call

2024-07-15 Thread Vladimir Makarov
On 6/14/24 07:10, user202...@protonmail.com wrote: This patch was inspired from PR 110137. It reduces the amount of stack spilling by ensuring that more values are constant across a pure function call. It does not add any new flag; rather, it makes the optimizer generate more optimal code.

Re: [PATCH] ira: Fix go_through_subreg offset calculation [PR115281]

2024-05-30 Thread Vladimir Makarov
On 5/30/24 03:59, Richard Sandiford wrote: Tested on aarch64-linux-gnu & x86_64-linux-gnu. OK to install? Yes.  Thank you, Richard. gcc/ PR rtl-optimization/115281 * ira-conflicts.cc (go_through_subreg): Use the natural size of the inner mode rather than the outer m

[pushed][PR115013][LRA]: Modify register starvation recognition

2024-05-13 Thread Vladimir Makarov
The following patch fixes https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115013 Successfully tested and bootstrapped on x86-64. commit 44430ef3d8ba75692efff5f6969d5610134566d3 Author: Vladimir N. Makarov Date: Mon May 13 10:12:11 2024 -0400 [PR115013][LRA]: Modify register starvation recog

[pushed][PR114942][LRA]: Don't reuse input reload reg of inout early clobber operand

2024-05-10 Thread Vladimir Makarov
The following patch solves https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114942 The patch was successfully bootstrapped and tested on x86-64, ppc64le, aarch64. commit 9585317f0715699197b1313bbf939c6ea3c1ace6 Author: Vladimir N. Makarov Date: Fri May 10 09:15:50 2024 -0400 [PR114942][LRA]

Re: [pushed][PR114810][LRA]: Recognize alternatives with lack of available registers for insn and demote them.

2024-05-09 Thread Vladimir Makarov
On 5/8/24 23:25, Li, Pan2 wrote: Hi Vladimir, Looks this patch results in some ICE in the rvv.exp of RISC-V backend, feel free to ping me if more information is needed for reproducing. = Summary of gcc testsuite = | # of unexpected case / # of unique unexpected case |gcc |

[pushed][PR114810][LRA]: Recognize alternatives with lack of available registers for insn and demote them.

2024-05-08 Thread Vladimir Makarov
The following patch is a fix for PR114810 from LRA side. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114810 The patch was successfully bootstrapped and tested on x86_64, aarch64, ppc64le. commit dc859c1fcb6f3ad95022fb078c040907ef361e4c Author: Vladimir N. Makarov Date: Wed May 8 10:39:04

Re: [PATCH 4/4] lra: Apply DF_LIVE_SUBREG data

2024-05-08 Thread Vladimir Makarov
On 5/7/24 23:01, Lehua Ding wrote: Hi Vladimir, I'll send V3 patchs based on these comments. Note that these four patches only support subreg liveness tracking and apply to IRA and LRA pass. Therefore, no performance changes are expected before we support subreg coalesce. There will be new

Re: [PATCH 4/4] lra: Apply DF_LIVE_SUBREG data

2024-05-01 Thread Vladimir Makarov
On 2/3/24 05:50, Lehua Ding wrote: This patch apply the DF_LIVE_SUBREG to LRA pass. More changes were made to the LRA than the IRA since the LRA will modify the DF data directly. The main big changes are centered on the lra-lives.cc file. gcc/ChangeLog: * lra-coalesce.cc (update_live_i

Re: [PATCH 3/4] ira: Apply DF_LIVE_SUBREG data

2024-05-01 Thread Vladimir Makarov
On 2/3/24 05:50, Lehua Ding wrote: This patch simple replace df_get_live_in to df_get_subreg_live_in and replace df_get_live_out to df_get_subreg_live_out. gcc/ChangeLog: * ira-build.cc (create_bb_allocnos): Switch to DF_LIVE_SUBREG df data. (create_loop_allocnos): Ditto.

Fwd: [PATCH V2 0/4] Add DF_LIVE_SUBREG data and apply to IRA and LRA

2024-05-01 Thread Vladimir Makarov
I am resending this message as the previous one had one wrong response email address "gcc-pat...@gcc.gnu.org" Forwarded Message Subject: Re: [PATCH V2 0/4] Add DF_LIVE_SUBREG data and apply to IRA and LRA Date: Wed, 1 May 2024 08:35:27 -0400 From: Vladimir M

Re: [PATCH] regalloc: Ignore '^' in early costing [PR114766]

2024-04-30 Thread Vladimir Makarov
On 4/29/24 08:59, Wilco Dijkstra wrote: According to documentation, '^' should only have an effect during reload. However ira-costs.cc treats it in the same way as '?' during early costing. As a result using '^' can accidentally disable valid alternatives and cause significant regressions (see

[pushed][PR114415][scheduler]: Fixing wrong code generation

2024-04-04 Thread Vladimir Makarov
The following patch fixes https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114415 The patch was successfully tested and bootstrapped on x86_64, ppc64le, aarch64. commit fe305ca39930afc301cdd1f1143d540d1bfa2a48 Author: Vladimir N. Makarov Date: Thu Apr 4 16:04:04 2024 -0400 [PR114415][sche

[pushed][PR99829][LRA]: Fixing LRA ICE on arm

2024-03-19 Thread Vladimir Makarov
The following patch fixes https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99829 The patch was successfully bootstrapped and tested on x86-64, ppc64le, and aarch64. commit 9c91f8a88b2db50c8faf70786d3cef27b39ac9fc Author: Vladimir N. Makarov Date: Tue Mar 19 16:57:11 2024 -0400 [PR99829][L

[pushed][PR113790][LRA]: Fixing LRA ICE on riscv64

2024-03-08 Thread Vladimir Makarov
The following patch fixes https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113790 The patch was successfully bootstrapped and tested on x86-64,ppc64le, and aarch64. commit cebbaa2a84586a7345837f74a53b7a0263bf29ee Author: Vladimir N. Makarov Date: Fri Mar 8 14:48:33 2024 -0500 [PR113790][L

Re: [PATCH 0/4] Add DF_LIVE_SUBREG data and apply to IRA and LRA

2024-02-06 Thread Vladimir Makarov
On 2/5/24 11:10, Jeff Law wrote: On 2/5/24 00:01, Lehua Ding wrote: For SPEC INT 2017, when using upstream GCC (whitout these patches), I get a coredump when training the peak case, so no data yet. The cause of the core dump still needs to be investigated. Typo, SPEC INT 2017 -> SPEC FP

[pushed][PR113526][LRA]: Fixing asm-flag-1.c failure on ARM

2024-01-25 Thread Vladimir Makarov
The following patch fixes https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113526 The patch was successfully bootstrapped and tested on x86-64, ppc64le, and aarch64. commit 5c617df410602d0e51d61c84d1ae7e9b3f51efa4 Author: Vladimir N. Makarov Date: Thu Jan 25 14:41:17 2024 -0500 [PR113526]

Re: [PATCH v3 1/8] sched-deps.cc (find_modifiable_mems): Avoid exponential behavior

2024-01-15 Thread Vladimir Makarov
On 1/15/24 07:56, Maxim Kuvyrkov wrote: Hi Vladimir, Hi Jeff, Richard and Alexander have reviewed this patch and [I assume] have no further comments.  OK to merge? I trust Richard and Alexander therefore I did not do additional review of the patches and have no any comment.  Richard's or

[pushed][PR113354][LRA]: Fixing LRA failure on building MIPS GCC

2024-01-15 Thread Vladimir Makarov
The following patch fixes https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113354 The patch was tested on building MIPS target. The patch was successfully tested and bootstrapped on x86-64, ppc64le, aarch64. commit 5f662bce28618ea5417f68a17d5c2d34b052ecb2 Author: Vladimir N. Makarov Date: Mon

[pushed][PR112918][LRA]: Fixing IRA ICE on m68k

2024-01-11 Thread Vladimir Makarov
The following patch fixes https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112918 The patch was successfully bootstrapped and tested on x86_64, aarch64, ppc64le commit 902a5931a1fbb04c65b48ca8b0f3827f6ff3b43e Author: Vladimir N. Makarov Date: Thu Jan 11 08:46:26 2024 -0500 [PR112918][LRA]:

[pushed][PR112918][LRA]: Fixing IRA ICE on m68k

2023-12-18 Thread Vladimir Makarov
The following patch fixes https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112918 The patch was successfully bootstrapped and tested on x86-64, aarch64, and ppc64. The patch affects a sensitive part of LRA.  So I will monitor that the commit does not create serious failures on other targets. If

Re: [PATCH 1/2] emit-rtl, lra: Move lra's emit_inc to emit-rtl.cc

2023-12-14 Thread Vladimir Makarov
On 12/13/23 16:00, Alex Coplan wrote: Hi, In PR112906 we ICE because we try to use force_reg to reload an auto-increment address, but force_reg can't do this. With the aim of fixing the PR by supporting reloading arbitrary addresses in pre-RA splitters, this patch generalizes lra-constraints.

[pushed][PR112875][LRA]: Fix an assert in lra elimination code

2023-12-08 Thread Vladimir Makarov
The following patch fixes https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112875 The patch was successfully tested and bootstrapped on x86-64 and ppc64le. commit 48cb51827c9eb991b92014a3f59d31eb237ce03f Author: Vladimir N. Makarov Date: Fri Dec 8 15:37:42 2023 -0500 [PR112875][LRA]: Fix an

Re: [PATCH] v2: Add IntegerRange for -param=min-nondebug-insn-uid= and fix vector growing in LRA and vec [PR112411]

2023-12-08 Thread Vladimir Makarov
On 12/7/23 03:39, Jakub Jelinek wrote: On Thu, Dec 07, 2023 at 09:36:22AM +0100, Jakub Jelinek wrote: So, one way to fix the LRA issue would be just to use lra_insn_recog_data_len = index * 3U / 2; if (lra_insn_recog_data_len <= index) lra_insn_recog_data_len = index + 1; basically

Re: [PATCH] lra: Updates of biggest mode for hard regs [PR112278]

2023-12-04 Thread Vladimir Makarov
On 12/3/23 05:13, Richard Sandiford wrote: [Gah. In my head I'd sent this a few weeks ago, but it turns out that I hadn't even got to the stage of writing the changlog...] LRA keeps track of the biggest mode for both hard registers and pseudos. The updates assume that the modes are ordered

[pushed][PR112445][LRA]: Fix "unable to find a register to spill" error

2023-12-01 Thread Vladimir Makarov
The following patch fixes https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112445 The patch was successfully bootstrapped and tested on x86-64, aarch64, ppc64le. commit 1390bf52c17a71834a1766c0222e4f8a74efb162 Author: Vladimir N. Makarov Date: Fri Dec 1 11:46:37 2023 -0500 [PR112445][LRA]:

Re: [PATCH v3 2/8] Unify implementations of print_hard_reg_set()

2023-11-22 Thread Vladimir Makarov
On 11/22/23 06:14, Maxim Kuvyrkov wrote: We currently have 3 implementations of print_hard_reg_set() (all with the same name!) in ira-color.cc, ira-conflicts.cc, and sel-sched-dump.cc. This patch generalizes implementation in ira-color.cc, and uses it in all other places. The declaration is a

[pushed] [PR112610] [IRA]: Fix using undefined dump file in IRA code during insn scheduling

2023-11-22 Thread Vladimir Makarov
The following patch fixes https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112610 The patch was successfully tested and bootstrapped on x86-64. commit 95f61de95bbcc2e4fb7020e27698140abea23788 Author: Vladimir N. Makarov Date: Wed Nov 22 09:01:02 2023 -0500 [IRA]: Fix using undefined dump fi

Re: [PATCH V3 4/7] ira: Support subreg copy

2023-11-17 Thread Vladimir Makarov
On 11/16/23 21:06, Lehua Ding wrote: Hi Vladimir, Thank you so much for your review. Based on your comments, I feel like there are a lot of issues, especially the long compile time issue. So I'm going to reorganize and refactor the patches so that as many of them as possible can be reviewed

Re: [PATCH V3 5/7] ira: Add all nregs >= 2 pseudos to tracke subreg list

2023-11-16 Thread Vladimir Makarov
On 11/12/23 07:08, Lehua Ding wrote: This patch relax the subreg track capability to all subreg registers. The patch is ok for me when general issues I mentioned in my first email and the issue given below are fixed. gcc/ChangeLog: * ira-build.cc (get_reg_unit_size): New. (ha

Re: [PATCH V3 4/7] ira: Support subreg copy

2023-11-16 Thread Vladimir Makarov
On 11/12/23 07:08, Lehua Ding wrote: This patch changes the previous way of creating a copy between allocnos to objects. gcc/ChangeLog: * ira-build.cc (find_allocno_copy): Removed. (find_object): New. (ira_create_copy): Adjust. (add_allocno_copy_to_list): Adju

Re: [PATCH V3 3/7] ira: Support subreg live range track

2023-11-14 Thread Vladimir Makarov
On 11/12/23 07:08, Lehua Ding wrote: gcc/ChangeLog: * hard-reg-set.h (struct HARD_REG_SET): New shift operator. * ira-build.cc (ira_create_object): Adjust. (find_object): New. (find_object_anyway): New. (ira_create_allocno): Adjust. (get_range):

Re: [PATCH V3 2/7] ira: Switch to live_subreg data

2023-11-14 Thread Vladimir Makarov
On 11/12/23 07:08, Lehua Ding wrote: This patch switch the use of live_reg data to live_subreg data. gcc/ChangeLog: * ira-build.cc (create_bb_allocnos): Switch. Switch to what? Although from the patch itself someone can figure it out, you should write it in the changelog entry.

Re: [PATCH V3 1/7] df: Add DF_LIVE_SUBREG problem

2023-11-14 Thread Vladimir Makarov
On 11/14/23 12:18, Vladimir Makarov wrote: On 11/14/23 03:38, Lehua Ding wrote: This is perfectly fine, the code inside the live_subreg problem has a branch that goes through similar logic to live_reg if it finds no subreg inside the program. Then when the optimization level is less

Re: [PATCH V3 1/7] df: Add DF_LIVE_SUBREG problem

2023-11-14 Thread Vladimir Makarov
On 11/14/23 03:38, Lehua Ding wrote: This is perfectly fine, the code inside the live_subreg problem has a branch that goes through similar logic to live_reg if it finds no subreg inside the program. Then when the optimization level is less than 2, it doesn't track the subreg. By the way,

  1   2   3   4   5   6   7   8   9   10   >