Re: [PATCH, cprop] Check rtx_cost when propagating constant

2014-07-17 Thread Jeff Law
On 06/19/14 03:44, Zhenqiang Chen wrote: ChangeLog: 2014-06-17 Zhenqiang Chen * cprop.c (try_replace_reg): Check cost for constants. diff --git a/gcc/cprop.c b/gcc/cprop.c index aef3ee8..c9cf02a 100644 --- a/gcc/cprop.c +++ b/gcc/cprop.c @@ -733,6 +733,14 @@ try_replace_reg (rtx fr

Re: [PATCH, cprop] Check rtx_cost when propagating constant

2014-06-19 Thread Zhenqiang Chen
On 17 June 2014 17:42, Zhenqiang Chen wrote: > On 17 June 2014 16:15, Richard Biener wrote: >> On Tue, Jun 17, 2014 at 4:11 AM, Zhenqiang Chen >> wrote: >>> Hi, >>> >>> For some large constant, ports like ARM, need one more instructions to >>> operate it. e.g >>> >>> #define MASK 0xfe00ff >>> vo

Re: [PATCH, cprop] Check rtx_cost when propagating constant

2014-06-17 Thread Zhenqiang Chen
On 17 June 2014 16:15, Richard Biener wrote: > On Tue, Jun 17, 2014 at 4:11 AM, Zhenqiang Chen > wrote: >> Hi, >> >> For some large constant, ports like ARM, need one more instructions to >> operate it. e.g >> >> #define MASK 0xfe00ff >> void maskdata (int * data, int len) >> { >>int i = len;

Re: [PATCH, cprop] Check rtx_cost when propagating constant

2014-06-17 Thread Richard Biener
On Tue, Jun 17, 2014 at 4:11 AM, Zhenqiang Chen wrote: > Hi, > > For some large constant, ports like ARM, need one more instructions to > operate it. e.g > > #define MASK 0xfe00ff > void maskdata (int * data, int len) > { >int i = len; >for (; i > 0; i -= 2) > { > data[i] &= MASK

[PATCH, cprop] Check rtx_cost when propagating constant

2014-06-16 Thread Zhenqiang Chen
Hi, For some large constant, ports like ARM, need one more instructions to operate it. e.g #define MASK 0xfe00ff void maskdata (int * data, int len) { int i = len; for (; i > 0; i -= 2) { data[i] &= MASK; data[i + 1] &= MASK; } } Need two instructions for each AND opera