[llvm-commits] some thoughts on lowering for calling conventions

Rafael EspĂ­ndola rafael.espindola at gmail.com
Tue Oct 12 08:50:40 PDT 2010


> If the optimizers at various levels need more information then we should be able to get that to them in a different way, pre-emptively lowering just makes an explosion of all new optimization problems.

Well, it exposes more problem for it to solve :-)
Don't get me wrong, I *do* like the idea of doing this lowering in a
IL to IL pass. The only exception being when the IL definition itself
can be made simpler by doing it early, but I do think that those would
be the minority of the cases and we can look at them one at a time.

My motivation for splitting the i64 into multiple i32 was producing a
more explicit IL of what the assembly will be doing. This i64 -> i32
splitting or fp to integer register moves are good examples of things
that can be done in a IL pass.

The recent discussion about va_arg got me thinking that this might
also be a good example of a case where some optimizations want the
high level view and then some others want a lower level one. For
example

*) determining if we need or not to spill xmm registers is better done
with the va_arg in place
*) optimizing the pointer computations is better done once it is expanded

If the target specific IL pass is put in between the two it looks like
we can get the both. The only slightly tricky part is how to propagate
the "don't spill xmm" info. Would this be a good use of metadata? It
would obey the property that removing it would keep the code correct
since we would just produce more spills.

> -eric

Cheers,
Rafael



More information about the llvm-commits mailing list