[LLVMdev] Reverse Optimization?

Reid Spencer reid at x10sys.com
Sat Nov 29 13:40:01 PST 2003


I was sitting around thinking about making web applications, especially
PHP based ones, perform better. While PHP has come a long way since its
initial releases, it could still benefit from LLVM style "whole program"
optimization.  So, I had this radical idea.  What if we built a PHP
front end for LLVM so PHP programs could be LLVMized. What if we also
built a i386 ELF front end so that we could factor in Apache and its
various modules? That is, we build an LLVM front end that reads an
executable or shared object in ELF format for an i386 processor (or
whatever) and produces LLVM bytecode for it?  Then, all of Apache and
PHP and the PHP programs could be optimized into single running
application.

While I think this is cool, I don't think the translation would work.
While it might be technically possible to find an LLVM expression for
each i386 instruction, the result might not be semantically meaningful
and therefore not easily subject to optimization. 

My question is: am I right about reverse engineering for optimization
like this, or could it work?

(The practical  thing to do would be to compile Apache/PHP/modules from
their C/C++ sources using llvmgcc, but that's just not radical enough to
mention :)

Reid.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20031129/7bc36237/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20031129/7bc36237/attachment.sig>


More information about the llvm-dev mailing list