ifcvt.c (noce_try_store_flag_mask): Check rtx cost.
ChangeLog: 2014-11-03 Zhenqiang Chen <zhenqiang.chen@arm.com> * ifcvt.c (noce_try_store_flag_mask): Check rtx cost. testsuite/ChangeLog: 2014-11-03 Zhenqiang Chen <zhenqiang.chen@arm.com> * gcc.target/arm/ifcvt-size-check.c: New test. From-SVN: r217029
This commit is contained in:
parent
ed60a04bbb
commit
b5a4533b36
@ -1,3 +1,7 @@
|
||||
2014-11-03 Zhenqiang Chen <zhenqiang.chen@arm.com>
|
||||
|
||||
* ifcvt.c (noce_try_store_flag_mask): Check rtx cost.
|
||||
|
||||
2014-11-03 Andrew Pinski <apinski@cavium.com>
|
||||
|
||||
* config/mips/mips-cpus.def (octeon3): New cpu.
|
||||
|
11
gcc/ifcvt.c
11
gcc/ifcvt.c
@ -1394,6 +1394,9 @@ noce_try_store_flag_mask (struct noce_if_info *if_info)
|
||||
|
||||
if (target)
|
||||
{
|
||||
int old_cost, new_cost, insn_cost;
|
||||
int speed_p;
|
||||
|
||||
if (target != if_info->x)
|
||||
noce_emit_move_insn (if_info->x, target);
|
||||
|
||||
@ -1401,6 +1404,14 @@ noce_try_store_flag_mask (struct noce_if_info *if_info)
|
||||
if (!seq)
|
||||
return FALSE;
|
||||
|
||||
speed_p = optimize_bb_for_speed_p (BLOCK_FOR_INSN (if_info->insn_a));
|
||||
insn_cost = insn_rtx_cost (PATTERN (if_info->insn_a), speed_p);
|
||||
old_cost = COSTS_N_INSNS (if_info->branch_cost) + insn_cost;
|
||||
new_cost = seq_cost (seq, speed_p);
|
||||
|
||||
if (new_cost > old_cost)
|
||||
return FALSE;
|
||||
|
||||
emit_insn_before_setloc (seq, if_info->jump,
|
||||
INSN_LOCATION (if_info->insn_a));
|
||||
return TRUE;
|
||||
|
@ -1,3 +1,7 @@
|
||||
2014-11-03 Zhenqiang Chen <zhenqiang.chen@arm.com>
|
||||
|
||||
* gcc.target/arm/ifcvt-size-check.c: New test.
|
||||
|
||||
2014-11-03 Naveen H.S <Naveen.Hurugalawadi@caviumnetworks.com>
|
||||
|
||||
* gcc.target/mips/octeon3-pipe-1.c: New test.
|
||||
|
13
gcc/testsuite/gcc.target/arm/ifcvt-size-check.c
Normal file
13
gcc/testsuite/gcc.target/arm/ifcvt-size-check.c
Normal file
@ -0,0 +1,13 @@
|
||||
/* { dg-do assemble } */
|
||||
/* { dg-options "-mthumb -Os " } */
|
||||
/* { dg-require-effective-target arm_thumb1_ok } */
|
||||
|
||||
int
|
||||
test (unsigned char iov_len, int count, int i)
|
||||
{
|
||||
unsigned char bytes = 0;
|
||||
if ((unsigned char) ((char) 127 - bytes) < iov_len)
|
||||
return 22;
|
||||
return 0;
|
||||
}
|
||||
/* { dg-final { object-size text <= 12 } } */
|
Loading…
Reference in New Issue
Block a user