replacing the backwards threader and more

2021-06-09 Thread Aldy Hernandez via Gcc
Hi Jeff. Hi folks. What started as a foray into severing the old (forward) threader's dependency on evrp, turned into a rewrite of the backwards threader code. I'd like to discuss the possibility of replacing the current backwards threader with a new one that gets far more threads and can p

Re: replacing the backwards threader and more

2021-06-09 Thread Aldy Hernandez via Gcc
On 6/9/21 2:09 PM, Richard Biener wrote: On Wed, Jun 9, 2021 at 1:50 PM Aldy Hernandez via Gcc wrote: Hi Jeff. Hi folks. What started as a foray into severing the old (forward) threader's dependency on evrp, turned into a rewrite of the backwards threader code. I'd like to d

Re: replacing the backwards threader and more

2021-06-09 Thread Aldy Hernandez via Gcc
On 6/9/21 9:47 PM, Jeff Law wrote: On 6/9/2021 9:34 AM, Aldy Hernandez wrote: On 6/9/21 2:09 PM, Richard Biener wrote: On Wed, Jun 9, 2021 at 1:50 PM Aldy Hernandez via Gcc wrote: Hi Jeff.  Hi folks. What started as a foray into severing the old (forward) threader's dependen

[ranger-tech] How to use ranges within any pass with get_range_query()

2021-06-10 Thread Aldy Hernandez via Gcc
As part of the ranger development we have found that there are various pieces of the infrastructure that can be used independently, and we’d like to document them in the hopes that they are useful to others. We will be contributing short posts documenting parts of the ranger, which we hope can

Re: replacing the backwards threader and more

2021-06-14 Thread Aldy Hernandez via Gcc
On 6/15/21 6:03 AM, Jeff Law wrote: On 6/14/2021 12:40 AM, Richard Biener wrote: I bet it's going to be tougher to remove DOM's threader.  It knows how to do thinks like resolve memory references using temporary equivalences and such.  But I bet it's enough to drop the VRP based threaders

Re: Aldy Hernandez and Andrew MacLeod as VRP maintainers

2021-06-17 Thread Aldy Hernandez via Gcc
On 6/17/21 12:18 AM, Jeff Law wrote: I am pleased to announce that the GCC Steering Committee has appointed Aldy Hernandez and Ian MacLeod as maintainers for the VRP subsystem (EVRP, VRP, Ranger). I don't know who this Ian is, but I'm sure we'll get along splendidly :).

Re: replacing the backwards threader and more

2021-06-21 Thread Aldy Hernandez via Gcc
On 6/9/21 2:09 PM, Richard Biener wrote: On Wed, Jun 9, 2021 at 1:50 PM Aldy Hernandez via Gcc wrote: Hi Jeff. Hi folks. What started as a foray into severing the old (forward) threader's dependency on evrp, turned into a rewrite of the backwards threader code. I'd like to d

Re: replacing the backwards threader and more

2021-06-25 Thread Aldy Hernandez via Gcc
Hi folks. I'm done with benchmarking, testing and cleanups, so I'd like to post my patchset for review. However, before doing so, I'd like to address a handful of meta-issues that may affect how I post these patches. Trapping on differences === Originally I wanted to con

Re: replacing the backwards threader and more

2021-06-27 Thread Aldy Hernandez via Gcc
On 6/25/21 7:19 PM, Martin Sebor wrote: On 6/25/21 10:20 AM, Aldy Hernandez via Gcc wrote: Hi folks. I'm done with benchmarking, testing and cleanups, so I'd like to post my patchset for review.  However, before doing so, I'd like to address a handful of meta-issues that m

Re: replacing the backwards threader and more

2021-06-28 Thread Aldy Hernandez via Gcc
On 6/28/21 10:22 AM, Richard Biener wrote: On Fri, Jun 25, 2021 at 6:20 PM Aldy Hernandez wrote: Hi folks. I'm done with benchmarking, testing and cleanups, so I'd like to post my patchset for review. However, before doing so, I'd like to address a handful of meta-issues

Re: replacing the backwards threader and more

2021-06-28 Thread Aldy Hernandez via Gcc
I had changed my approach to passing -Wno-free-nonheap-object in the Makefile. Can you try disabling the Makefile bit and bootstrapping, cause that was still failing. Thanks. Aldy On Tue, Jun 29, 2021, 00:29 Martin Sebor wrote: > On 6/28/21 12:17 AM, Aldy Hernandez wrote: > > > &

Re: replacing the backwards threader and more

2021-06-29 Thread Aldy Hernandez via Gcc
On 6/30/21 12:16 AM, Martin Sebor wrote: On 6/28/21 6:32 PM, Aldy Hernandez wrote: I had changed my approach to passing -Wno-free-nonheap-object in the Makefile. Can you try disabling the Makefile bit and bootstrapping, cause that was still failing. I see.  I just tested it and my patch

Re: Failures building glibc with mainline GCC

2021-07-30 Thread Aldy Hernandez via Gcc
There's a new jump threader in GCC which is much more aggressive, and may trigger latent problems with other warning passes, especially -Warray-bounds, -Woverflow, and -Wuninitialized. Do your problems go away if you take out commit 2e96b5f14e? I have notes throughout the commit analyzing variant

Re: Hooks fixed to treat trunk the same as master

2021-08-03 Thread Aldy Hernandez via Gcc
On 8/3/21 9:33 AM, Martin Liška wrote: On 8/2/21 7:22 PM, Joseph Myers wrote: Hey. Some time ago, someone added a git symbolic-ref for refs/heads/trunk pointing to refs/heads/master. Great you found out what caused that. We were aware of commits that didn't pass gcc-verify check but for s

More aggressive threading causing loop-interchange-9.c regression

2021-09-07 Thread Aldy Hernandez via Gcc
Hi folks. I have a pending patch for the path solver that pulls in global ranges when available (the stuff in SSA_NAME_RANGE_INFO). In doing so, I have run into a regression I was hoping the loop experts could pontificate on. The regression comes from the simple_reduc_1() function in tree-s

Re: More aggressive threading causing loop-interchange-9.c regression

2021-09-08 Thread Aldy Hernandez via Gcc
First of all. Thanks so much for this incredibly useful explanation. It helps a lot. I'm still trying to wrap my head around this, so please bear with me. On 9/7/21 4:45 PM, Michael Matz wrote: Hello, On Tue, 7 Sep 2021, Aldy Hernandez via Gcc wrote: The regression comes fro

Re: More aggressive threading causing loop-interchange-9.c regression

2021-09-08 Thread Aldy Hernandez via Gcc
dump: Checking profitability of path (backwards): bb:3 (4 insns) bb:9 (0 insns) bb:5 Control statement insns: 2 Overall: 2 insns Registering FSM jump thread: (5, 9) incoming edge; (9, 3) (3, 8) nocopy; (3, 8) Thanks. Aldy commit 1bf3f76a5ff075396b5b9f5f88d6b18649dac2ce Author: Aldy Hern

Re: More aggressive threading causing loop-interchange-9.c regression

2021-09-08 Thread Aldy Hernandez via Gcc
On 9/8/21 3:49 PM, Richard Biener wrote: On Wed, Sep 8, 2021 at 3:25 PM Aldy Hernandez wrote: It would be helpful to have the patch causing the issue to look at the IL. But as Micha said, there needs to be a perfect loop nest for interchange to work. Richard. Absolutely! I'm atta

Re: More aggressive threading causing loop-interchange-9.c regression

2021-09-09 Thread Aldy Hernandez via Gcc
On 9/9/21 8:57 AM, Richard Biener wrote: On Wed, Sep 8, 2021 at 8:13 PM Michael Matz wrote: Hello, [lame answer to self] On Wed, 8 Sep 2021, Michael Matz wrote: The forward threader guards against this by simply disallowing threadings that involve different loops. As I see The thread

Re: More aggressive threading causing loop-interchange-9.c regression

2021-09-09 Thread Aldy Hernandez via Gcc
On 9/8/21 8:13 PM, Michael Matz wrote: Hello, [lame answer to self] On Wed, 8 Sep 2021, Michael Matz wrote: The forward threader guards against this by simply disallowing threadings that involve different loops. As I see The thread in question (5->9->3) is all within the same outer loop

Re: More aggressive threading causing loop-interchange-9.c regression

2021-09-09 Thread Aldy Hernandez via Gcc
On 9/9/21 9:45 AM, Richard Biener wrote: On Thu, Sep 9, 2021 at 9:37 AM Aldy Hernandez wrote: On 9/9/21 8:57 AM, Richard Biener wrote: On Wed, Sep 8, 2021 at 8:13 PM Michael Matz wrote: Hello, [lame answer to self] On Wed, 8 Sep 2021, Michael Matz wrote: The forward threader

Re: More aggressive threading causing loop-interchange-9.c regression

2021-09-09 Thread Aldy Hernandez via Gcc
On 9/9/21 10:58 AM, Richard Biener wrote: On Thu, Sep 9, 2021 at 10:36 AM Aldy Hernandez wrote: On 9/9/21 9:45 AM, Richard Biener wrote: On Thu, Sep 9, 2021 at 9:37 AM Aldy Hernandez wrote: On 9/9/21 8:57 AM, Richard Biener wrote: On Wed, Sep 8, 2021 at 8:13 PM Michael Matz wrote

Re: More aggressive threading causing loop-interchange-9.c regression

2021-09-09 Thread Aldy Hernandez via Gcc
On 9/9/21 12:15 PM, Richard Biener wrote: On Thu, Sep 9, 2021 at 11:21 AM Aldy Hernandez wrote: On 9/9/21 10:58 AM, Richard Biener wrote: I ran some experiments a while back, and my current work on the enhanced solver/threader, can fold virtually everything the DOM/threader gets (even

Re: More aggressive threading causing loop-interchange-9.c regression

2021-09-09 Thread Aldy Hernandez via Gcc
On 9/9/21 2:52 PM, Michael Matz wrote: Hello, On Thu, 9 Sep 2021, Aldy Hernandez wrote: The ldist-22 regression is interesting though: void foo () { int i; : goto ; [INV] : a[i_1] = 0; if (i_1 > 100) goto ; [INV] else goto ; [INV] : b[i_1] =

Re: More aggressive threading causing loop-interchange-9.c regression

2021-09-09 Thread Aldy Hernandez via Gcc
On 9/9/21 4:44 PM, Michael Matz wrote: Hello, On Thu, 9 Sep 2021, Aldy Hernandez wrote: Here there's no simple latch block to start with (the backedge comes directly out of the loop exit block). So my suggested improvement (testing if the latch was empty and only then reject the t

Re: More aggressive threading causing loop-interchange-9.c regression

2021-09-10 Thread Aldy Hernandez via Gcc
e latch becomes polluted with PHI nodes. OK for trunk? Aldy commit e735a2cd01485773635bd66c97af21059992d5a7 (HEAD -> pending/global-ranges) Author: Aldy Hernandez Date: Thu Sep 9 20:30:28 2021 +0200 Disable threading through latches until after loop optimizations. The motivation

Re: More aggressive threading causing loop-interchange-9.c regression

2021-09-10 Thread Aldy Hernandez via Gcc
On 9/10/21 5:43 PM, Jeff Law wrote: On 9/9/2021 3:21 AM, Aldy Hernandez wrote:    /* If this path does not thread through the loop latch, then we are   using the FSM threader to find old style jump threads. This   is good, except the FSM threader does not re-use an existing

Re: More aggressive threading causing loop-interchange-9.c regression

2021-09-10 Thread Aldy Hernandez via Gcc
On 9/10/21 5:51 PM, Jeff Law wrote: On 9/9/2021 4:15 AM, Richard Biener wrote: b) Even though we can seemingly fold everything DOM/threader does, in order to replace it with a backward threader instance we'd have to merge the cost/profitability code scattered throughout the forward thread

Re: More aggressive threading causing loop-interchange-9.c regression

2021-09-10 Thread Aldy Hernandez via Gcc
On 9/10/21 6:21 PM, Jeff Law wrote: On 9/10/2021 10:05 AM, Aldy Hernandez wrote: On 9/10/21 5:43 PM, Jeff Law wrote: On 9/9/2021 3:21 AM, Aldy Hernandez wrote:    /* If this path does not thread through the loop latch, then we are   using the FSM threader to find old style

replacing the VRP threader

2021-09-21 Thread Aldy Hernandez via Gcc
In order to replace VRP, we need an alternative for the jump threader embedded within it. Currently, this threader is a forward threader client that uses ASSERT_EXPRs and the avail/const framework to resolve statements along a path. As I have mentioned in the past weeks, I am proposing a hybr

Re: replacing the VRP threader

2021-09-22 Thread Aldy Hernandez via Gcc
On Tue, Sep 21, 2021 at 12:48 PM Aldy Hernandez wrote: > SUMMARY > === > > The hybrid threader gets 14.5% more jump threads than the legacy code, > but most of these threads are at the expense of other threading passes. > The more it gets, the less DOM and the backward t

Can gcc.dg/torture/pr67828.c be an infinite loop?

2021-09-24 Thread Aldy Hernandez via Gcc
Hi folks. My upcoming threading improvements turn the test below into an infinite runtime loop: int a, b; short c; int main () { int j, d = 1; for (; c >= 0; c++) { BODY: a = d; d = 0; if (b) { xprintf (0); if (j) xprintf (0);

Re: Can gcc.dg/torture/pr67828.c be an infinite loop?

2021-09-24 Thread Aldy Hernandez via Gcc
On 9/24/21 10:08 AM, Richard Biener wrote: On Fri, Sep 24, 2021 at 10:04 AM Aldy Hernandez via Gcc wrote: Hi folks. My upcoming threading improvements turn the test below into an infinite runtime loop: int a, b; short c; int main () { int j, d = 1; for (; c >= 0

Re: Can gcc.dg/torture/pr67828.c be an infinite loop?

2021-09-24 Thread Aldy Hernandez via Gcc
On 9/24/21 11:29 AM, Andrew Pinski wrote: On Fri, Sep 24, 2021 at 1:05 AM Aldy Hernandez via Gcc wrote: Hi folks. My upcoming threading improvements turn the test below into an infinite runtime loop: int a, b; short c; int main () { int j, d = 1; for (; c >= 0; c++) { B

Re: Can gcc.dg/torture/pr67828.c be an infinite loop?

2021-09-24 Thread Aldy Hernandez via Gcc
On 9/24/21 11:38 AM, Andrew Pinski wrote: On Fri, Sep 24, 2021 at 2:35 AM Aldy Hernandez wrote: On 9/24/21 11:29 AM, Andrew Pinski wrote: On Fri, Sep 24, 2021 at 1:05 AM Aldy Hernandez via Gcc wrote: Hi folks. My upcoming threading improvements turn the test below into an infinite

Re: Can gcc.dg/torture/pr67828.c be an infinite loop?

2021-09-24 Thread Aldy Hernandez via Gcc
On 9/24/21 1:37 PM, David Brown wrote: On 24/09/2021 10:03, Aldy Hernandez via Gcc wrote: Hi folks. My upcoming threading improvements turn the test below into an infinite runtime loop: int a, b; short c; int main () {   int j, d = 1;   for (; c >= 0; c++)     { BODY:   a

Re: [TCWG CI] 471.omnetpp slowed down by 8% after gcc: Avoid invalid loop transformations in jump threading registry.

2021-09-27 Thread Aldy Hernandez via Gcc
l sorts of grief. Out of curiosity, does the attached (untested) patch fix the regression? Aldy Regards, -- Maxim Kuvyrkov https://www.linaro.org On 27 Sep 2021, at 02:52, ci_not...@linaro.org wrote: After gcc commit 4a960d548b7d7d942f316c5295f6d849b74214f5 Author: Aldy Hernandez Avo

-Wuninitialized false positives and threading knobs

2021-10-31 Thread Aldy Hernandez via Gcc
After Jeff's explanation of the symbiosis between jump threading and the uninit pass, I'm beginning to see that (almost) every Wuninitialized warning is cause for reflection. It usually hides a missing jump thread. I investigated one such false positive (uninit-pred-7_a.c) and indeed, there's a m

Re: Announcement: gcobol

2022-03-30 Thread Aldy Hernandez via Gcc
I paid for high school and university writing Cobol, so I'm strangely interested in the project. Seems like life has come full circle for me :). Aldy On Mon, Mar 14, 2022 at 9:35 PM James K. Lowden wrote: > > https://git.symas.net:443/cobolworx/gcc-cobol/ > https://github.com/Apress/beg-cobol-f

is_a<> with references

2022-06-01 Thread Aldy Hernandez via Gcc
Hi folks. I rolled our own is_a<> implementation for vrange, because it was trivial. We needed it to work on references, and GCC's is-a.h implementation is pointer-only. However, I now realize it confuses gengtype when adding additional types: template struct vrange_traits { // Default to some

Re: is_a<> with references

2022-06-01 Thread Aldy Hernandez via Gcc
Issue resolved. Typedef no longer needed. Sorry for the noise. Aldy On Wed, Jun 1, 2022 at 4:29 PM Aldy Hernandez wrote: > > Hi folks. > > I rolled our own is_a<> implementation for vrange, because it was > trivial. We needed it to work on references, and GCC's

spaceship_replacement cannot see through simplified set of FP conditionals

2022-07-29 Thread Aldy Hernandez via Gcc
Hi. With my upcoming patch enabling floating point VRP, g++.dg/opt/pr94589-2.C is failing: https://gcc.gnu.org/pipermail/gcc-patches/2022-July/598788.html The problem is that phiopt no longer sees the following snippet, because we have folded away the final conditional as true: bool f5 (double

Re: spaceship_replacement cannot see through simplified set of FP conditionals

2022-07-29 Thread Aldy Hernandez via Gcc
Swt! Would you like me to XFAIL the test or leave it as a failure? Thanks. Aldy On Fri, Jul 29, 2022 at 1:50 PM Jakub Jelinek wrote: > > On Fri, Jul 29, 2022 at 01:40:12PM +0200, Aldy Hernandez wrote: > > With my upcoming patch enabling floating point VRP, > > g++.dg/

are most floating point cases in tree_call_nonnegative_warnv_p() wrong for HONOR_NANS?

2022-11-13 Thread Aldy Hernandez via Gcc
Based on discussions in the last few weeks, aren't most of the cases in tree_call_nonnegative_warnv_p() wrong when honoring NANS? For example: CASE_CFN_ACOS: CASE_CFN_ACOS_FN: CASE_CFN_ACOSH: CASE_CFN_ACOSH_FN: ... ... /* Always true. */ return true; But are we guar

Re: are most floating point cases in tree_call_nonnegative_warnv_p() wrong for HONOR_NANS?

2022-11-13 Thread Aldy Hernandez via Gcc
I suppose most of the calls to tree_expr_nonnegative_p that apply to floats in match.pd and tree-ssa-math-opts.cc are guarded by !HONOR_NANS || tree_expr_nonnegative_p. Still feels kinda delicate... Aldy On Sun, Nov 13, 2022 at 4:56 PM Aldy Hernandez wrote: > > Based on discussions in th

Re: get_range_query vs NULL argument

2023-02-16 Thread Aldy Hernandez via Gcc
On 2/16/23 08:57, Richard Biener wrote: On Wed, Feb 15, 2023 at 11:31 PM Andrew MacLeod via Gcc wrote: On 2/15/23 14:50, Andrew Pinski wrote: Hi, While fixing PR 108354, I came across that ssa_name_has_boolean_range calls get_range_query with cfun as the argument but sometimes while i

Re: Stepping down as gcov maintainer and callgraph reviewer

2023-02-17 Thread Aldy Hernandez via Gcc
Woah. Sad to see you leave! It's always been a pleasure to work with you. Thanks for all the great work, and good luck on your next endeavors. Aldy On Thu, Feb 16, 2023 at 4:55 PM Martin Liška wrote: > > Hello GCC community. > > After spending last decade (including my diploma thesis even mor

Upcoming removal of legacy ranges and conversion to wide_ints.

2023-04-25 Thread Aldy Hernandez via Gcc
After GCC 13 is released we will remove legacy range support from the compiler, and convert irange's to wide_ints. I want to give everyone a heads up, to help understand what's involved and what the end result is. Legacy ranges are basically the value_range type (int_range<1>) where the internal

1.76% performance loss in VRP due to inlining

2024-04-26 Thread Aldy Hernandez via Gcc
Notice there are no uses of prange yet. Thanks. Aldy From ee63833c5f56064ef47c2bb9debd485f77d00171 Mon Sep 17 00:00:00 2001 From: Aldy Hernandez Date: Tue, 19 Mar 2024 18:04:55 +0100 Subject: [PATCH] Move get_bitmask_from_range out of irange class. --- gcc

Re: 1.76% performance loss in VRP due to inlining

2024-04-30 Thread Aldy Hernandez via Gcc
On Tue, Apr 30, 2024 at 9:58 AM Richard Biener wrote: > > On Fri, Apr 26, 2024 at 11:45 AM Aldy Hernandez via Gcc > wrote: > > > > Hi folks! > > > > In implementing prange (pointer ranges), I have found a 1.74% slowdown > > in VRP, even without any cod

Re: 1.76% performance loss in VRP due to inlining

2024-05-03 Thread Aldy Hernandez via Gcc
4 at 11:37 PM Jason Merrill wrote: > > On 4/30/24 12:22, Jakub Jelinek wrote: > > On Tue, Apr 30, 2024 at 03:09:51PM -0400, Jason Merrill via Gcc wrote: > >> On Fri, Apr 26, 2024 at 5:44 AM Aldy Hernandez via Gcc > >> wrote: > >>> > >>> I

[PATCH] Update email in MAINTAINERS file.

2024-09-23 Thread Aldy Hernandez via Gcc
From: Aldy Hernandez ChangeLog: * MAINTAINERS: Update email and add myself to DCO. --- MAINTAINERS | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index cfd96c9f33e..e9fafaf45a7 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -116,7

<    1   2   3