On Mon, 16 Jun 2008 12:56:39 +0200
Nicolai Hähnle <[EMAIL PROTECTED]> wrote:

> Hi everybody,

Hi.

> I want a compiler infrastructure that can do more than one pass over
> the program that is to be compiled. I also want to be able to do
> passes that are more complex than a linear walk through instructions
> while looking at only one instruction at a time. For example, I'm
> thinking of:
> - a very simple algorithm for dead code elimination that walks
> through the program *backwards*
> - an algorithm to merge MUL and ADD into MAD

I once wrote an algo that had the ability to remove all write masks and
swizzles of all instructions that do not contribute to the results.
Simply dropping instructions with no write mask implements dead code
elimination.
Following that, instructions can be divided into two groups:
-instructions that have fixed output and thus determine which
components of temporary registers must be fixed
-instructions where all result components correspond to same
calculation(mad, xpd, ...)

By properly combining these two you'd get optimal temporary register
usage. IIRC, the problem I did not solve was how to rearrange
instructions of two or more distinct calculations that join up later in
the program so that you'd use minimal amount of temporary
registers.


-- 
Aapo Tahkola

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Mesa3d-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to