This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Byte permutation optimization
- From: Andi Kleen <andi at firstfloor dot org>
- To: Nils Pipenbrinck <n dot pipenbrinck at cubic dot org>
- Cc: gcc at gcc dot gnu dot org
- Date: Sun, 13 Jul 2008 12:29:10 +0200
- Subject: Re: Byte permutation optimization
- References: <48791902.2020805@cubic.org>
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