Related articles |
---|
Method Level optimizations. cef@geodesic.com (Charles Fiterman) (1995-01-23) |
Re: Method Level optimizations. hbaker@netcom.com (1995-01-27) |
Re: Method Level optimizations. monnier@di.epfl.ch (Stefan Monnier) (1995-01-31) |
Newsgroups: | comp.compilers |
From: | Stefan Monnier <monnier@di.epfl.ch> |
Originator: | monnier@didec4.epfl.ch |
Keywords: | OOP, optimize |
Organization: | Ecole Polytechnique Federale de Lausanne |
References: | 95-01-044 |
Date: | Tue, 31 Jan 1995 18:58:08 GMT |
Charles Fiterman <cef@geodesic.com> wrote:
] Consider the advantages of optimizing away A *= unity; Where
It's probably possible to already do this kind of optimisation:
There might be some problems in the specific case you provide, but
imagine a language with multimethods And the above code rewritten into
A = A * unity
If unity is a subtype of matrix and if you only have one
multiplication defined with unity as the second parameter, then the
method call is known statically and can be inlined and optimised away.
(since the corresponding code would be very simple like:
method * ( <matrix> A , <unity> B) = A)
In general subtying can be a good help for optimisation if the method
call isn't too expensive, which is the case if the types are
statically known, allowing the method lookup to be done at
compile-time !
Stefan
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.