Re: improving combine pass

2011-04-27 Thread Paul Koning
Then the combiner is doing exactly what it is supposed to given the information it has. "clobber x" means "there is no useful data in x". So the combiner can't combine that with the compare, because the first insn doesn't produce a valid CC according to how it is defined. I would write it as

Re: improving combine pass

2011-04-27 Thread cirrus75
Hi Paul, On i386 (and X86_64) RTL for insn X is generated with a "(clobber reg:CC FLAGS_REG)" instead of indicating exactly what is written on flags regs. I don't know if this could be different (as you suggested). Maybe the idea is combine "operation insns" and "test insns" later, but com

Re: improving combine pass

2011-04-27 Thread Paul Koning
On Apr 27, 2011, at 3:15 PM, cirrus75 wrote: > > Hello Ian, > > One example is: > > insn X : "REG_X = " > insn X+1 : "MEM(addr) = REG_X" > insn X+2 : "REGY:CCmode compare(REG_X, const_int 0)" > > generated by C code (already posted by me some weeks ago): > -- > > int a, b, c, d; >

Re: improving combine pass

2011-04-27 Thread cirrus75
Hello Ian, One example is: insn X : "REG_X = " insn X+1 : "MEM(addr) = REG_X" insn X+2 : "REGY:CCmode compare(REG_X, const_int 0)" generated by C code (already posted by me some weeks ago): -- int a, b, c, d; int foo() { a += b; if(a) c = d; } Insns X+2 and X can usua

Re: improving combine pass

2011-04-27 Thread Ian Lance Taylor
cirrus75 writes: > I am trying to improve combine pass (for all backends). One approach is > changing the order of some insns before combine pass starts. The first > problem I have is about the REGNOTES, they need to be rebuilt after changing > insn order. Does anyone know how to do that ?

improving combine pass

2011-04-27 Thread cirrus75
Hi All, I am trying to improve combine pass (for all backends). One approach is changing the order of some insns before combine pass starts. The first problem I have is about the REGNOTES, they need to be rebuilt after changing insn order. Does anyone know how to do that ? Does anyone k