GCC-How does the coding style affect the insv pattern recognization?
Adam Nemet
adambnemet@gmail.com
Mon Feb 1 17:50:00 GMT 2010
fanqifei writes:
> 2010/1/18 Adam Nemet <adambnemet@gmail.com>:
> > Sorry for jumping in late. See make_file_assigment in combine.c.
> >
> > The problem usually is that:
> >
> > (set A (ior (and B C1) OTHER))
> >
> > can only be turned into a bit-insertion if A and B happen to be the same
> > pseudos.
> >
> > Adam
> >
> I did found such kind of pattern for some simple C statements in rtl dump.
> Unfortunately, A and B are not same.
> Is it possible and easy to move B to A firstly and replace B with A in the insn?
> Anyway, this is not required if it's impracticable.
It might work. You could experiment with a define_split to do that. Note
however that in terms of combine's notion of profitability, you will need to
have at the end eliminated some instructions. (Also the overall cost of the
the new insns should be lower than the old ones.)
Alternatively you can recognize the above pattern, use a contraint to force
the pseudos to be allocated to the same hard register. If successful you can
generate bit-inseration otherwise you split the pattern into the original
insns after reload.
Adam
More information about the Gcc
mailing list