4 ms·
Something similar is "partial evaluation", and LLVM (for example) supports it via a component called LLPE [1,2]. One of its main drawbacks is it falls under th
by ttd 10y ago
Something similar is "partial evaluation", and LLVM (for example) supports it via a component called LLPE [1,2].
One of its main drawbacks is it falls under the category of interprocedural optimization (as opposed to intraprocedural) which can quickly balloon into a practically intractable problem for large programs.
Also, it's just difficult to imagine it working in many non-cherry-picked examples. You have to prove that a given parameter is constant over all callsites to a function, which can be difficult e.g. in the presence of indirect/virtual function calls.
[1] http://www.llpe.org/ http://www.llpe.org/
[2] http://llvm.org/devmtg/2015-04/slides/LLPE.pdf http://llvm.org/devmtg/2015-04/slides/LLPE.pdf