[LLVMdev] Helping the optimizer along (__assume)

Mike Stump mrs at apple.com
Wed Oct 22 16:24:36 PDT 2008


On Oct 22, 2008, at 3:28 PM, Paul Biggar wrote:
> As part of our PHP compiler (phpcompiler.org), it would be great to be
> able to annotate our generated C code with, for example, (var !=
> NULL), or (var->type == STRING), and have that information passed
> around (esp interprocedurally at link-time) by the LLVM optimizers.

For some odd reason I was thinking this was going to be done with an  
assert (or a special no code generating assert).  Just gen up assert  
(i != 0); and put it in anytime it is true.  The optimizers in the  
fulness of time would the recognize and propagate this information.



More information about the llvm-dev mailing list