loop.c (express_from): Try harder to unify (* c N) and (* c M) where N and M are constant and N is an...
* loop.c (express_from): Try harder to unify (* c N) and (* c M) where N and M are constant and N is an integer multiple of M. From-SVN: r28868
This commit is contained in:
parent
37f26d6499
commit
e0485b850c
2 changed files with 29 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
|||
Wed Aug 25 11:13:29 1999 Richard Henderson <rth@cygnus.com>
|
||||
|
||||
* loop.c (express_from): Try harder to unify (* c N) and (* c M)
|
||||
where N and M are constant and N is an integer multiple of M.
|
||||
|
||||
Wed Aug 25 13:55:47 EDT 1999 Andrew MacLeod <amacleod@cygnus.com>
|
||||
|
||||
* sbitmap.h (sbitmap_intersection_of_succs): Add prototype.
|
||||
|
|
24
gcc/loop.c
24
gcc/loop.c
|
@ -6842,6 +6842,30 @@ express_from (g1, g2)
|
|||
}
|
||||
|
||||
add = express_from_1 (g1->add_val, g2->add_val, mult);
|
||||
if (add == NULL_RTX)
|
||||
{
|
||||
/* Failed. If we've got a multiplication factor between G1 and G2,
|
||||
scale G1's addend and try again. */
|
||||
if (INTVAL (mult) > 1)
|
||||
{
|
||||
rtx g1_add_val = g1->add_val;
|
||||
if (GET_CODE (g1_add_val) == MULT
|
||||
&& GET_CODE (XEXP (g1_add_val, 1)) == CONST_INT)
|
||||
{
|
||||
HOST_WIDE_INT m;
|
||||
m = INTVAL (mult) * INTVAL (XEXP (g1_add_val, 1));
|
||||
g1_add_val = gen_rtx_MULT (GET_MODE (g1_add_val),
|
||||
XEXP (g1_add_val, 0), GEN_INT (m));
|
||||
}
|
||||
else
|
||||
{
|
||||
g1_add_val = gen_rtx_MULT (GET_MODE (g1_add_val), g1_add_val,
|
||||
mult);
|
||||
}
|
||||
|
||||
add = express_from_1 (g1_add_val, g2->add_val, const1_rtx);
|
||||
}
|
||||
}
|
||||
if (add == NULL_RTX)
|
||||
return NULL_RTX;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue