mirror of git://gcc.gnu.org/git/gcc.git
tree-ssa-loop-ivopts.c (multiplier_allowed_in_address_p ): Check both [reg+mult*reg] and [mult*reg] to determine if multiplier is allowed.
* tree-ssa-loop-ivopts.c (multiplier_allowed_in_address_p ): Check both [reg+mult*reg] and [mult*reg] to determine if multiplier is allowed. From-SVN: r204031
This commit is contained in:
parent
247dbcf4ab
commit
f258df2d19
|
|
@ -1,3 +1,8 @@
|
||||||
|
2013-10-24 Igor Shevlyakov <igor.shevlyakov@gmail.com>
|
||||||
|
|
||||||
|
* tree-ssa-loop-ivopts.c (multiplier_allowed_in_address_p ): Check both
|
||||||
|
[reg+mult*reg] and [mult*reg] to determine if multiplier is allowed.
|
||||||
|
|
||||||
2013-10-24 Cong Hou <congh@google.com>
|
2013-10-24 Cong Hou <congh@google.com>
|
||||||
|
|
||||||
* convert.c (convert_to_real): Guard those unsafe math function
|
* convert.c (convert_to_real): Guard those unsafe math function
|
||||||
|
|
|
||||||
|
|
@ -3120,16 +3120,19 @@ multiplier_allowed_in_address_p (HOST_WIDE_INT ratio, enum machine_mode mode,
|
||||||
{
|
{
|
||||||
enum machine_mode address_mode = targetm.addr_space.address_mode (as);
|
enum machine_mode address_mode = targetm.addr_space.address_mode (as);
|
||||||
rtx reg1 = gen_raw_REG (address_mode, LAST_VIRTUAL_REGISTER + 1);
|
rtx reg1 = gen_raw_REG (address_mode, LAST_VIRTUAL_REGISTER + 1);
|
||||||
rtx addr;
|
rtx reg2 = gen_raw_REG (address_mode, LAST_VIRTUAL_REGISTER + 2);
|
||||||
|
rtx addr, scaled;
|
||||||
HOST_WIDE_INT i;
|
HOST_WIDE_INT i;
|
||||||
|
|
||||||
valid_mult = sbitmap_alloc (2 * MAX_RATIO + 1);
|
valid_mult = sbitmap_alloc (2 * MAX_RATIO + 1);
|
||||||
bitmap_clear (valid_mult);
|
bitmap_clear (valid_mult);
|
||||||
addr = gen_rtx_fmt_ee (MULT, address_mode, reg1, NULL_RTX);
|
scaled = gen_rtx_fmt_ee (MULT, address_mode, reg1, NULL_RTX);
|
||||||
|
addr = gen_rtx_fmt_ee (PLUS, address_mode, scaled, reg2);
|
||||||
for (i = -MAX_RATIO; i <= MAX_RATIO; i++)
|
for (i = -MAX_RATIO; i <= MAX_RATIO; i++)
|
||||||
{
|
{
|
||||||
XEXP (addr, 1) = gen_int_mode (i, address_mode);
|
XEXP (scaled, 1) = gen_int_mode (i, address_mode);
|
||||||
if (memory_address_addr_space_p (mode, addr, as))
|
if (memory_address_addr_space_p (mode, addr, as)
|
||||||
|
|| memory_address_addr_space_p (mode, scaled, as))
|
||||||
bitmap_set_bit (valid_mult, i + MAX_RATIO);
|
bitmap_set_bit (valid_mult, i + MAX_RATIO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue