[LLVMdev] Adding a new instruction?

Garrison Venn gvenn.cfe.dev at gmail.com
Sat Jan 2 10:16:38 PST 2010

Sorry, forgot to post to list.

For 2.7 I'm wondering if you could use custom metadata attached to the first instruction of a "special" block? You could register a unique kind (not sure how to guarantee uniqueness), and attach a metadata node via the context to the first instruction with this kind. Your pass would look for this. I have never tried this, so I don't know if predecessor passes that your pass would depend on would affect this metadata; if different threads with their own context would see metadata attached via a specific context; and what the resultant performance effect would be.

Just a thought


On Jan 2, 2010, at 10:52, Yannis Mantzouratos wrote:

> Hi,
> We 're working on an llvm interpreter. We perform some static analysis
> to detect some blocks with a specific property, and we need the
> interpreter to be able to recognise these blocks fast in time it
> reaches them. We thought of adding a new instruction in the LLVM
> instruction set and put it in the beginning of such blocks, so that
> the interpreter would be instantly alerted that the current block is
> 'special'. Is there an easier/quicker way to do this?
> Cheers,
> yannis
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

More information about the llvm-dev mailing list