https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108757
Jiu Fu Guo changed:
What|Removed |Added
Status|NEW |RESOLVED
Resolution|---
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108757
--- Comment #25 from CVS Commits ---
The master branch has been updated by Jiu Fu Guo :
https://gcc.gnu.org/g:1aceceb1e2d6e86ce183c8cc448750fa03b6f79e
commit r14-3644-g1aceceb1e2d6e86ce183c8cc448750fa03b6f79e
Author: Jiufu Guo
Date: Mon
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108757
--- Comment #24 from Jiu Fu Guo ---
(In reply to Jiu Fu Guo from comment #23)
> /* Simplify ((t + -N*M) / N + M) -> t / N: (t + -C) >> N + (C>>N) ==> t >> N
> */
> (for div (trunc_div exact_div)
div was not used in this matcher, yet. Here
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108757
--- Comment #23 from Jiu Fu Guo ---
/* Simplify ((t + -N*M) / N + M) -> t / N: (t + -C) >> N + (C>>N) ==> t >> N */
(for div (trunc_div exact_div)
(simplify
(plus (rshift (plus @0 INTEGER_CST@1) INTEGER_CST@2) INTEGER_CST@3)
(if
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108757
--- Comment #22 from Jiu Fu Guo ---
(In reply to Andrew Pinski from comment #21)
> (In reply to Jiu Fu Guo from comment #20)
> > Interesting thing:
> > the VR is always VR_VARYING, even for the below simple case:
> >
> > typedef unsigned long
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108757
--- Comment #21 from Andrew Pinski ---
(In reply to Jiu Fu Guo from comment #20)
> Interesting thing:
> the VR is always VR_VARYING, even for the below simple case:
>
> typedef unsigned long INT;
> INT __attribute__ ((noinline)) foo (INT x)
>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108757
Jiu Fu Guo changed:
What|Removed |Added
CC||guojiufu at gcc dot gnu.org
--- Comment
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108757
--- Comment #19 from Andrew Pinski ---
Note in the loop case we know it does not wrap because there is a check
already:
[local count: 118111600]:
if (rows_8(D) > 3)
goto ; [89.00%]
else
goto ; [11.00%]
[local count:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108757
Andrew Pinski changed:
What|Removed |Added
Target|powerpc64le-linux |powerpc64le-linux,
|
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108757
Andrew Pinski changed:
What|Removed |Added
Component|rtl-optimization|tree-optimization
--- Comment #17 from
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108757
--- Comment #13 from Andrew Pinski ---
IIRC this is a doloop issue and has been reported before. Maybe even by myself
while I was working at Sony. I think I tried to fix it too.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108757
--- Comment #12 from Chip Kerchner ---
Here is an example of the original problem
#define EIGEN_ALWAYS_INLINE __attribute__((always_inline)) inline
typedef __vector float Packet4f;
typedef size_t Index;
EIGEN_ALWAYS_INLINE Packet4f
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108757
--- Comment #11 from Chip Kerchner ---
Nevermind, using a similar example that Segher gave, it would failed too.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108757
--- Comment #10 from Chip Kerchner ---
Oops that should be 31 * -2, not 33.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108757
--- Comment #9 from Chip Kerchner ---
Doesn't this work for powers of two (N) and signed values (for A, N and M)?
(59 - (33 * -2)) / -2 + 31 = -62 + 31 = -29
and
59 / -2 = -29
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108757
--- Comment #8 from Segher Boessenkool ---
No, addition and subtraction are well defined for all inputs, for unsigned
integers.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108757
--- Comment #7 from Peter Bergner ---
(In reply to Segher Boessenkool from comment #6)
> No? Take a=59 as counterexample:
>
> (a - (N*M)) / N + M = (59 - 2*30)/30 + 2 = ~0UL/30 + 2
For unsigned integers, isn't having a < N*M UB so we're free
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108757
--- Comment #6 from Segher Boessenkool ---
No? Take a=59 as counterexample:
(a - (N*M)) / N + M = (59 - 2*30)/30 + 2 = ~0UL/30 + 2
but
a / N = 59/30 = 1
Integer division in C is division towards zero, almost no normal algebraic
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108757
--- Comment #5 from Peter Bergner ---
(In reply to Segher Boessenkool from comment #4)
> If N is a power of two optimising this to a/N is valid, but for other values
> of N it is not (division is not the inverse of multiplication in C). It
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108757
Segher Boessenkool changed:
What|Removed |Added
CC||segher at gcc dot gnu.org
---
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108757
--- Comment #3 from anlauf at gcc dot gnu.org ---
(In reply to Andrew Pinski from comment #2)
> I am not sure this can be done in the normal case unless you know the range
> of a to be [64...INF] .
> The wrap around case might be an issue ...
>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108757
--- Comment #2 from Andrew Pinski ---
I am not sure this can be done in the normal case unless you know the range of
a to be [64...INF] .
The wrap around case might be an issue ...
But I am not 100% sure.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108757
Andrew Pinski changed:
What|Removed |Added
Severity|normal |enhancement
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108757
Peter Bergner changed:
What|Removed |Added
Ever confirmed|0 |1
Last reconfirmed|
24 matches
Mail list logo