[LLVMdev] Missed devirtualization opportunities

Duncan Sands baldrick at free.fr
Wed Oct 13 00:41:49 PDT 2010


Hi Nick,

> I have no idea how to make use of llvm.invariant to help
> devirtualization. If no use or other use case for them can be found,
> maybe they should be removed.

the dragonegg plugin uses llvm.invariant to help the code generators
optimize the code it produces for builtin_init_trampoline.  It writes
some values into memory which is then constant forever after.  Because
pointers to this memory are passed into all kinds of functions, the
optimizers don't understand that the values are constant without help,
thus the use of llvm.invariant.  It doesn't work very well, but it is
still better than not doing it at all.

Ciao,

Duncan.



More information about the llvm-dev mailing list