Question about RTL code hoisting

2010-03-25 Thread Jie Zhang
I just found that the current RTL code hoisting cannot optimize REG = ... if (cond) { r0 = REG; } else { r0 = REG; ... } to REG = ... r0 = REG; if (cond) { } else { ... } where REG is a pseudo register and r0 is a physical register. I have

Re: Question about RTL code hoisting

2010-03-25 Thread Bernd Schmidt
On 03/25/2010 04:03 PM, Jie Zhang wrote: I just found that the current RTL code hoisting cannot optimize REG = ... if (cond) { r0 = REG; } else { r0 = REG; ... } to REG = ... r0 = REG; if (cond) { } else { ... }

Re: Question about RTL code hoisting

2010-03-25 Thread Steven Bosscher
On Thu, Mar 25, 2010 at 4:14 PM, Bernd Schmidt ber...@codesourcery.com wrote: On 03/25/2010 04:03 PM, Jie Zhang wrote: I just found that the current RTL code hoisting cannot optimize REG = ... if (cond)   {     r0 = REG;       } else   {     r0 = REG;     ...   } to REG =

Re: Question about RTL code hoisting

2010-03-25 Thread Jeff Law
On 03/25/10 09:14, Bernd Schmidt wrote: On 03/25/2010 04:03 PM, Jie Zhang wrote: I just found that the current RTL code hoisting cannot optimize REG = ... if (cond) { r0 = REG; } else { r0 = REG; ... } to REG = ... r0 = REG; if (cond) {

Re: Question about RTL code hoisting

2010-03-25 Thread Steven Bosscher
On Thu, Mar 25, 2010 at 4:03 PM, Jie Zhang j...@codesourcery.com wrote: I just found that the current RTL code hoisting cannot optimize REG = ... if (cond)  {    r0 = REG;      } else  {    r0 = REG;    ...  } to REG = ... r0 = REG; if (cond)  {      } else  {    

Re: Question about RTL code hoisting

2010-03-25 Thread Jie Zhang
On 03/25/2010 11:22 PM, Jeff Law wrote: On 03/25/10 09:14, Bernd Schmidt wrote: On 03/25/2010 04:03 PM, Jie Zhang wrote: I just found that the current RTL code hoisting cannot optimize REG = ... if (cond) { r0 = REG; } else { r0 = REG; ... } to REG = ... r0 = REG; if (cond) { }

Re: Question about RTL code hoisting

2010-03-25 Thread Jie Zhang
On 03/25/2010 11:24 PM, Steven Bosscher wrote: On Thu, Mar 25, 2010 at 4:03 PM, Jie Zhangj...@codesourcery.com wrote: I just found that the current RTL code hoisting cannot optimize REG = ... if (cond) { r0 = REG; } else { r0 = REG; ... } to REG = ... r0 = REG;

Re: Question about RTL code hoisting

2010-03-25 Thread Jeff Law
On 03/25/10 10:19, Jie Zhang wrote: On 03/25/2010 11:22 PM, Jeff Law wrote: I never bothered to implement hoisting which touched hard regs -- I never thought the cost/benefit analysis made much sense. It's quite a bit more work to implement and code motion of hard regs is much more restricted