[LLVMdev] Prevent instruction elimination

Devang Patel dpatel at apple.com
Mon Oct 25 09:29:41 PDT 2010


On Oct 25, 2010, at 2:13 AM, Xinfinity wrote:

> 
> Hello,
> 
> Does there exist something like a "dummy" instruction that is not removed by
> the optimizers, even if it seems to be dead code?
> I want to use such instructions to carry metadata information, but they
> should have a minimal impact on the code generation and optimization.

Use of metadata will not prevent optimizer from removing an instruction. Actually, that is the corner stone of LLVM metadata design. 

I am curious, what information you want to carry and until what point ?
-
Devang





More information about the llvm-dev mailing list