[CST-2] Optimising Compiler
M.Y.W.Y. Becker
mywyb2@cam.ac.uk
Sun, 03 Jun 2001 14:55:30 +0100
--On 03 June 2001 14:26 +0100 Raymond Chan <rwlc3@cam.ac.uk> wrote:
>> Has Alan Mycroft ever mentioned what/how optimisation can we achieve,
>> once we have done control flow analysis? (Or is it mentioned somewhere
>> in the references?)
>
> I think in the lectures he mentioned how it was useful for optimising
> indirect calls - usually we have to assume an indirect call could call any
> other function - I think control flow analysis helps you to narrow down
> which functions it could call. This gives you a simpler call graph, which
> is good because... err... I'm not sure... someone finish my answer please!
This is particularly useful if the set of flow values turns out to be a
singleton: an indirect call can be substituted by a direct call which is
more efficient.
Mo