The following rule is good to have:
int i, i, k;
i/j/k ===> i/(j*k)
--
Summary: Missing Simplication for div op
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: middle-end
Seems to be a missing functionality
int a[100];
int g;
void foo(int i)
{
a[i] = i*g;
i++;
a[i] = i*g;
i++;
a[i] = i*g;
}
Both array address computation and RHS mpy operations can be strength reduced.
--
Summary: Straight line strength reduction
P
--- Comment #1 from pinskia at gcc dot gnu dot org 2008-02-23 05:22 ---
*** This bug has been marked as a duplicate of 23286 ***
--
pinskia at gcc dot gnu dot org changed:
What|Removed |Added
--
--- Comment #14 from pinskia at gcc dot gnu dot org 2008-02-23 05:22
---
*** Bug 35303 has been marked as a duplicate of this bug. ***
--
pinskia at gcc dot gnu dot org changed:
What|Removed |Added
-
// Example: the load of structs at return is partially redundant
struct A {
int a;
int b;
int c;
int d;
} ag, ag2,ag3;
struct A foo(int n)
{
if (n)
{
ag2 = ag;
}
return ag;
}
// Gcc generated assembly code:
foo:
.LFB2:
testl %edi, %edi
je .L2
union U {
struct A {
int a;
int b;
}aa;
long long ll;
};
struct B{
union U u1;
union U u2;
} bg;
struct B bg;
struct B bar();
int foo (int n)
{
if (n)
{
bg = bar();
}
return bg.u1.ll + bg.u2.ll;
};
// Two union fields loads are partially redund
--- Comment #1 from pinskia at gcc dot gnu dot org 2008-02-23 05:27 ---
Sometimes doing the strength reduction actually increases the code size. Think
on targets which have auto increments.
*** This bug has been marked as a duplicate of 22586 ***
--
pinskia at gcc dot gnu dot org c
--- Comment #2 from pinskia at gcc dot gnu dot org 2008-02-23 05:27 ---
*** Bug 35308 has been marked as a duplicate of this bug. ***
--
pinskia at gcc dot gnu dot org changed:
What|Removed |Added
---
--- Comment #2 from pinskia at gcc dot gnu dot org 2008-02-23 05:29 ---
I think this is a dup of bug 23455.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35286
--- Comment #1 from pinskia at gcc dot gnu dot org 2008-02-23 05:34 ---
GCSE should take care of this.
--
pinskia at gcc dot gnu dot org changed:
What|Removed |Added
--- Comment #1 from pinskia at gcc dot gnu dot org 2008-02-23 05:39 ---
> should be (at least with -Os)
And normal -O2. This is a dup of bug 25553 for the reasons why this should be
done even at -O2.
*** This bug has been marked as a duplicate of 25553 ***
--
pinskia at gcc dot gn
--- Comment #7 from pinskia at gcc dot gnu dot org 2008-02-23 05:39 ---
*** Bug 35304 has been marked as a duplicate of this bug. ***
--
pinskia at gcc dot gnu dot org changed:
What|Removed |Added
---
--- Comment #2 from pinskia at gcc dot gnu dot org 2008-02-23 05:50 ---
More than just constant prop, see PR 25972 for more info on what else it can be
done with union in the same way.
Actually I think MEM_REF will make it worse and will not help. In fact I still
think MEM_REF is a bad
--- Comment #2 from xinliangli at gmail dot com 2008-02-23 06:55 ---
(In reply to comment #1)
> Sometimes doing the strength reduction actually increases the code size.
> Think
> on targets which have auto increments.
>
> *** This bug has been marked as a duplicate of 22586 ***
>
It
101 - 114 of 114 matches
Mail list logo