Re: [Patch, i386] Avoid LCP stalls (issue5975045)

2012-04-05 Thread Teresa Johnson
Thanks, I will do both and update the comment as suggested by David, retest and then commit. Teresa On Thu, Apr 5, 2012 at 12:41 AM, Uros Bizjak wrote: > Hello! > >> New patch to avoid LCP stalls based on feedback from earlier patch. I >> modified >> H.J.'s old patch to perform the peephole2 to

Re: [Patch, i386] Avoid LCP stalls (issue5975045)

2012-04-05 Thread Uros Bizjak
Hello! > New patch to avoid LCP stalls based on feedback from earlier patch. I modified > H.J.'s old patch to perform the peephole2 to split immediate moves to HImode > memory. This is now enabled for Core2, Corei7 and Generic. > 2012-04-04 Teresa Johnson > > * config/i386/i386.h (ix86_

Re: [Patch, i386] Avoid LCP stalls (issue5975045)

2012-04-04 Thread Teresa Johnson
On Wed, Apr 4, 2012 at 5:39 PM, H.J. Lu wrote: > On Wed, Apr 4, 2012 at 5:07 PM, Teresa Johnson wrote: >> New patch to avoid LCP stalls based on feedback from earlier patch. I >> modified >> H.J.'s old patch to perform the peephole2 to split immediate moves to HImode >> memory. This is now enabl

Re: [Patch, i386] Avoid LCP stalls (issue5975045)

2012-04-04 Thread H.J. Lu
On Wed, Apr 4, 2012 at 5:07 PM, Teresa Johnson wrote: > New patch to avoid LCP stalls based on feedback from earlier patch. I modified > H.J.'s old patch to perform the peephole2 to split immediate moves to HImode > memory. This is now enabled for Core2, Corei7 and Generic. > > I verified that thi

Re: [Patch, i386] Avoid LCP stalls (issue5975045)

2012-03-30 Thread Jan Hubicka
> Hi Richard, Jan and H.J., > > Thanks for all the quick responses and suggestions. > > I had tested my patch when tuning for an arch without the LCP stalls, > but it didn't hit an issue in reload because it didn't require > rematerialization. Thanks for pointing out this issue. > > Regarding th

Re: [Patch, i386] Avoid LCP stalls (issue5975045)

2012-03-30 Thread Teresa Johnson
Hi Richard, Jan and H.J., Thanks for all the quick responses and suggestions. I had tested my patch when tuning for an arch without the LCP stalls, but it didn't hit an issue in reload because it didn't require rematerialization. Thanks for pointing out this issue. Regarding the penalty, it can

Re: [Patch, i386] Avoid LCP stalls (issue5975045)

2012-03-30 Thread H.J. Lu
On Fri, Mar 30, 2012 at 8:19 AM, Richard Henderson wrote: > On 03/30/2012 11:11 AM, Richard Henderson wrote: >> On 03/30/2012 11:03 AM, Teresa Johnson wrote: >>> +(define_insn "*movhi_imm_internal" >>> +  [(set (match_operand:HI 0 "memory_operand" "=m") >>> +        (match_operand:HI 1 "immediate_

Re: [Patch, i386] Avoid LCP stalls (issue5975045)

2012-03-30 Thread Richard Henderson
On 03/30/2012 11:11 AM, Richard Henderson wrote: > On 03/30/2012 11:03 AM, Teresa Johnson wrote: >> +(define_insn "*movhi_imm_internal" >> + [(set (match_operand:HI 0 "memory_operand" "=m") >> +(match_operand:HI 1 "immediate_operand" "n"))] >> + "!TARGET_LCP_STALL" >> +{ >> + return "mov

Re: [Patch, i386] Avoid LCP stalls (issue5975045)

2012-03-30 Thread Jan Hubicka
> Index: config/i386/i386.md > === > --- config/i386/i386.md (revision 185920) > +++ config/i386/i386.md (working copy) > @@ -2262,9 +2262,19 @@ > ] > (const_string "SI")))]) > > +(define_insn "*movhi_im

Re: [Patch, i386] Avoid LCP stalls (issue5975045)

2012-03-30 Thread Richard Henderson
On 03/30/2012 11:03 AM, Teresa Johnson wrote: > +(define_insn "*movhi_imm_internal" > + [(set (match_operand:HI 0 "memory_operand" "=m") > +(match_operand:HI 1 "immediate_operand" "n"))] > + "!TARGET_LCP_STALL" > +{ > + return "mov{w}\t{%1, %0|%0, %1}"; > +} > + [(set (attr "type") (con

Re: [Patch, i386] Avoid LCP stalls (issue5975045)

2012-03-30 Thread Teresa Johnson
I should add that I have tested performance of this on Core2, Corei7 (Nehalem) and AMD Opteron-based systems. It appears to be performance-neutral on AMD (only minor perturbations, overall a wash). For the test case that provoked the optimization, there were nice improvements on Core2 and Corei7.