On Wed, 16 Feb 2005, Jeff Garzik wrote:
> 
> I also need to make the target runtime-switchable (x86 vs. x86-64 vs. 
> big endian sparc64), if it's not already.

Everything should be run-time-switchable, but of course "everything" right 
now means "32-bit vs 64-bit". None of the generic passes should care about 
anything else.

There's a lack of switchability of default alignments, and that does
differ. The defaults are sane, but not necessarily correct (ie the
alignment of a 64-bit entity might be 32-bit or 64-bit, there's no switch
to select which). See "max_int_alignment" and "max_fp_alignment". Right 
now the default is:

 - 32-bit architectures: 4-byte alignment for 64-bit integers
 - 64-bit architectures: 8-byte alignment for 64-bit integers

and I think there are potentially 32-bit architectures that might want to 
see the 8byte/64-bit alignment, but I don't know.

Byte order is not visibile to the linearized format, since it will not
optimize away loads/stores for partially overlapping regions.

> > The linearized format should pretty much _be_ a high-level IL already in 
> > many ways, and then you have the option of doing CSE or not on it as you 
> > please..
> 
> Since the linearized format is an SSA-like form, that makes a few things 
> in the backend easier.

It's not just SSA-like, it _is_ SSA. Of course, later phases may choose to
break the SSA requirements (and right now you get some of the later passes
by default, like "pseudo death tracking"), but the basic linearizer should
be strictly SSA, and note how CSE is already done.

Ie you really do get CSE and a number of trivial simplifications (like
canonical argument type ordering forcommutative ops, which means that you
know where you'll find constants etc) for free if you use the linearizer.

The biggest problem (and that's not a big one) is if you want to only get
part of the work done - then you need to split up (or conditionalize)  
parts of "linearize_fn()".

The current "./test-linearizer" thing really already comes pretty close to 
what you're talking about. Modulo types, again.

                Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to