Byte permutation optimization
Andi Kleen
andi@firstfloor.org
Sun Jul 13 16:56:00 GMT 2008
Nils Pipenbrinck <n.pipenbrinck@cubic.org> writes:
> Since the codebase is huge I have the feeling that I have overlooked
> something. Does some kind of infrastructure to detect patterns within
> a SSA tree already exists somewhere else?
FWIW some time ago I wanted to do some other arithmetic optimization
on expressions and didn't find a nice generic "misc transformation
pass" or an generic pattern matcher. Probably one would need to be added.
> Where would be the best
> place in gcc to add an automatic byteswap detection?
GCC has multiple ILs: higher level gimpel and low level RTL. The high
level is usually architecture neutral (with only some exceptions), so
you would either need to do the optimization in a way that it benefits
all targets, or parametrize it somehow based on the backend.
Low level RTL is machine specific, but you need to care
about a lot more things and have to test on different targets
because the input varies.
-Andi
More information about the Gcc
mailing list