[Mono-devel-list] A clarification on the purpose of alias analysis.

Massimiliano Mantione massi at ximian.com
Fri Feb 25 12:39:17 EST 2005

On Thu, 2005-02-24 at 13:21, Massimiliano Mantione wrote:
> So, I repeat the simple question: is case [2] important?
> If yes, could you show me some example of optimization that is
> really important and that is possible only implementing [2]?

Well, I find it a bit silly that I'm replying to myself...

I'm going on implementing [1].

The interface with the rest of the JIT will be conceived to
work easily with "linear" passes on the code, that is, it will
add a minimum overhead if the code is doing the usual:

void work_on_inst (MonoInst *inst) {
	if (mono_burg_arity [inst->opcode] > 0) {
		work_on_inst (inst->inst_i0);
		if (mono_burg_arity [inst->opcode] > 1) {
			work_on_inst (inst->inst_i1);
	// test aliasing issues with inst
	// do what you must do with inst
// MonoBasicBlock *bb;
// MonoInst *inst;
for (inst = bb->code; inst != NULL; inst = inst->next) {
	work_on_inst (inst);

Here the complexity of "test aliasing issues with inst" should
be O[1] to obtain a list of all the locals affected by 'inst',
then the code would be free to use that list as needed.

Other ways of accessing the aliasing info will be slower.
In any case, the general pattern is "give a MonoInst*, get back
a list of affected local variables".

If there are are reasons why this would not be good [enough],
please speak up early!


More information about the Mono-devel-list mailing list