[Bug middle-end/70879] Missed jump threading opportunity with multiple != conditions

2017-08-19 Thread amacleod at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70879

--- Comment #6 from Andrew Macleod  ---
oops, wasnt meant to actually attach that note to this PR.

[Bug middle-end/70879] Missed jump threading opportunity with multiple != conditions

2017-08-18 Thread amacleod at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70879

--- Comment #5 from Andrew Macleod  ---
On 08/18/2017 06:13 PM, law at redhat dot com wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70879
>
> Jeffrey A. Law  changed:
>
> What|Removed |Added
> 
>   Status|NEW |RESOLVED
>   Resolution|--- |FIXED
>
> --- Comment #4 from Jeffrey A. Law  ---
> This was fixed by RIchi's change for pr71433.
>
Made a bunch of updates this week, and things are in decent shape I think.

so looking at that test case with the code base as of this afternoon, if 
we expand irange to have 3 sub-ranges (which I think long term we will 
may need)

void
foo (int a)
{
   if (a != 5 && a != 10)
 bar ();
   if (a == 10)
 baz ();
}
we get gimple

 [0.00%] [count: INV]:
   _1 = a_6(D) != 5;
   _2 = a_6(D) != 10;
   _3 = _1 & _2;
   if (_3 != 0)
 goto ; [INV] [count: INV]
   else
 goto ; [INV] [count: INV]

[0.00%] [count: INV]:
   bar ();

[0.00%] [count: INV]:
   if (a_6(D) == 10)
 goto ; [INV] [count: INV]
   else
 goto ; [INV] [count: INV]

shows

BB  2:  T: _1   [0x0001, 0x0001] precision = 1
BB  2:  T: _2   [0x0001, 0x0001] precision = 1
BB  2:  T: _3   [0x, 0x] precision = 1
BB  2:  T: a_6(D)   [0x8000, 0x4][0x6, 0x9][0xb, 
0x7fff] precision = 32
BB  2:  F: _1   [0x0, 0x0001] precision = 1
BB  2:  F: _2   [0x0, 0x0001] precision = 1
BB  2:  F: _3   [0x0, 0x0] precision = 1
BB  2:  F: a_6(D)   [0x5, 0x5][0xa, 0xa] precision = 32

BB  4:  T: a_6(D)   [0xa, 0xa] precision = 32
BB  4:  F: a_6(D)   [0x8000, 0x9][0xb, 0x7fff] 
precision = 32


so the true side of bb2 shows the range of a_6 to be everything except 5 
and 10  [0x8000, 0x4][0x6, 0x9][0xb, 0x7fff] precision = 32

and the true side of bb4, leading to the call to baz(), a_6 has to have 
a value of 10.. if you intersect those 2 ranges on that path... voila!!

its a NULL range meaning that call can't happen on that path 
2->3->4->5,  letting you do your thing..

So that is promising...

Andrew

Over the weekend im going to consider options for handling an increase 
of precision in ranges without going full on dynamic.

[Bug middle-end/70879] Missed jump threading opportunity with multiple != conditions

2017-08-18 Thread law at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70879

Jeffrey A. Law  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #4 from Jeffrey A. Law  ---
This was fixed by RIchi's change for pr71433.

[Bug middle-end/70879] Missed jump threading opportunity with multiple != conditions

2016-07-09 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70879

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||missed-optimization
   Severity|normal  |enhancement

[Bug middle-end/70879] Missed jump threading opportunity with multiple != conditions

2016-05-02 Thread law at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70879

--- Comment #3 from Jeffrey A. Law  ---
Which is the problem Andrew has started poking at :-)  One of the paths being
explored is creating those PHIs.

[Bug middle-end/70879] Missed jump threading opportunity with multiple != conditions

2016-05-02 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70879

Richard Biener  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2016-05-02
 Ever confirmed|0   |1

--- Comment #2 from Richard Biener  ---
The issue here is really that we don't insert PHIs for the SSA defs of inserted
asserts so we have to play "tricks" like finding dominating asserts in the
first
place.

[Bug middle-end/70879] Missed jump threading opportunity with multiple != conditions

2016-04-29 Thread law at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70879

Jeffrey A. Law  changed:

   What|Removed |Added

 CC||amacleod at redhat dot com

--- Comment #1 from Jeffrey A. Law  ---
Andrew, thought this might be of interest...  Look at bb3...