Re: [patch] PR rtl-optimization/65220: avoid integer division in stack alignment

2015-03-02 Thread Richard Henderson
On 03/02/2015 10:55 AM, Aldy Hernandez wrote: > >>> Do you actually need the reload completed? Couldn't this be legitimately >>> split >>> before reload (and then parts of it DCE'd as necessary)? >>> >>> Otherwise, the split condition does need "&&" as mentioned by Uros. >> >> Oh, I forgot -- ev

Re: [patch] PR rtl-optimization/65220: avoid integer division in stack alignment

2015-03-02 Thread Aldy Hernandez
Do you actually need the reload completed? Couldn't this be legitimately split before reload (and then parts of it DCE'd as necessary)? Otherwise, the split condition does need "&&" as mentioned by Uros. Oh, I forgot -- even if you can exclude reload_completed, you'd then need to use "&& 1"

Re: [patch] PR rtl-optimization/65220: avoid integer division in stack alignment

2015-03-02 Thread Richard Henderson
On 03/02/2015 09:55 AM, Richard Henderson wrote: > On 02/26/2015 05:46 PM, Aldy Hernandez wrote: >> +;; Optimize division or modulo by constant power of 2, if the constant >> +;; materializes only after expansion. >> +(define_insn_and_split "*udivmod4_pow2" >> + [(set (match_operand:SWI48 0 "regis

Re: [patch] PR rtl-optimization/65220: avoid integer division in stack alignment

2015-03-02 Thread Richard Henderson
On 03/02/2015 10:25 AM, Aldy Hernandez wrote: > On 03/02/2015 09:55 AM, Richard Henderson wrote: >> On 02/26/2015 05:46 PM, Aldy Hernandez wrote: >>> +;; Optimize division or modulo by constant power of 2, if the constant >>> +;; materializes only after expansion. >>> +(define_insn_and_split "*udiv

Re: [patch] PR rtl-optimization/65220: avoid integer division in stack alignment

2015-03-02 Thread Aldy Hernandez
On 03/02/2015 09:55 AM, Richard Henderson wrote: On 02/26/2015 05:46 PM, Aldy Hernandez wrote: +;; Optimize division or modulo by constant power of 2, if the constant +;; materializes only after expansion. +(define_insn_and_split "*udivmod4_pow2" + [(set (match_operand:SWI48 0 "register_operand

Re: [patch] PR rtl-optimization/65220: avoid integer division in stack alignment

2015-03-02 Thread Richard Henderson
On 02/26/2015 05:46 PM, Aldy Hernandez wrote: > +;; Optimize division or modulo by constant power of 2, if the constant > +;; materializes only after expansion. > +(define_insn_and_split "*udivmod4_pow2" > + [(set (match_operand:SWI48 0 "register_operand" "=r") > + (udiv:SWI48 (match_operand:S

Re: [patch] PR rtl-optimization/65220: avoid integer division in stack alignment

2015-02-27 Thread Uros Bizjak
Hello! > This is actually Jakub's patch from the PR, with a few minor tweaks that were > needed to bootstrap > and pass the regression suite. The splitter was using operand 0 without > setting it first. It should've > been operand 2. Also, there was a division by zero that was causing an > inva

[patch] PR rtl-optimization/65220: avoid integer division in stack alignment

2015-02-26 Thread Aldy Hernandez
This is actually Jakub's patch from the PR, with a few minor tweaks that were needed to bootstrap and pass the regression suite. The splitter was using operand 0 without setting it first. It should've been operand 2. Also, there was a division by zero that was causing an invalid insn; fixed