[Bug tree-optimization/92712] [8/9 Regression] Performance regression with assumed values

2020-09-01 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92712

--- Comment #25 from Marc Glisse  ---
(In reply to Feng Xue from comment #24)
> Another point: if B+-C can be folded to an existing gimple value, we might
> deduce B+-C does not overflow?

We can deduce that loading this value that represents B+-C does not overflow at
runtime (since we aren't computing anything, just copying some other value),
but not that the operation B+-C would not overflow if it was actually
evaluated. So it could help a bit sometimes. We still need to ensure that the
multiplication by A does not overflow though.

[Bug tree-optimization/92712] [8/9 Regression] Performance regression with assumed values

2020-09-01 Thread fxue at os dot amperecomputing.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92712

Feng Xue  changed:

   What|Removed |Added

 CC||fxue at os dot 
amperecomputing.com

--- Comment #24 from Feng Xue  ---
If(In reply to Jakub Jelinek from comment #15)
> For
> A*B+A*C -> (B+C)*A
> the problematic cases are
> A==-1 and B > 0 and C==(max-B)+1 (i.e. when B+C overflows to min)
> or A==0 and B < 0 and C or A==0 and B > 0 and C>max-B
> (last two cases cover when B+C overflows)
> For
> A*B-A*C -> (B-C)*A
> the problematic cases are
> A==-1 and B > 0 and C==min+B (i.e. when B-C is min)
> or A==0 and B < -1 and C>B-min
> or A==0 and B >= 0 and C (last two cases cover when B-C overflows)
> Again, we perform the operation right now if A is not 0 and not -1 for
> certain.
> I guess we could handle those cases by using something like
> check_for_binary_op_overflow, except that for the case where A might be -1
> and plusminus equal to MINUS_EXPR we also need to make sure the result of
> B-C is known not to be min.

Another point: if B+-C can be folded to an existing gimple value, we might
deduce B+-C does not overflow?

[Bug tree-optimization/92712] [8/9 Regression] Performance regression with assumed values

2020-03-04 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92712

Jakub Jelinek  changed:

   What|Removed |Added

   Target Milestone|8.4 |8.5

--- Comment #23 from Jakub Jelinek  ---
GCC 8.4.0 has been released, adjusting target milestone.

[Bug tree-optimization/92712] [8/9 Regression] Performance regression with assumed values

2019-12-02 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92712

Jakub Jelinek  changed:

   What|Removed |Added

Summary|[8/9/10 Regression] |[8/9 Regression]
   |Performance regression with |Performance regression with
   |assumed values  |assumed values

--- Comment #22 from Jakub Jelinek  ---
Should be fixed on the trunk.
I don't think we want to backport to release branches though.