[Mono-list] [Off-topic] "if else" or "switch" ?

Mike Welham mike@digitalnova.co.za
Sat, 16 Oct 2004 14:20:42 +0200


> > and if the high-level compiler can perform high-level optimizations it
> > should. (When I say high-level optimizations I mean things like dead-
> code
> > elimination or tail-call optimization.)
> I wouldn't say that the tail-call optimization is high level. You have
> the tail prefix in the IL, and this should be handled by the JIT. 

Indeed. What I meant (and should have said) was that the optimization of
spotting when the calling method frame can be discarded and pre-pending the
.tail IL instruction should be in the compiler, rather than having the JIT
trying to work out whether or not each and every call can be ".tailed".



> > I think there are a wide range of (runtime agnostic) optimizations that
> > belong in .NET compilers, because they're just not feasible to spot and
> > perform at JIT time.
> Everything here is about the definition of high level :)

Very true. I just don't want managed-language compiler writers getting all
lazy with their optimization passes because they've got a JIT to clean up
after them ;-)