[llvm-dev] Adding a NOP bitcode instruction
Bruce Hoult via llvm-dev
llvm-dev at lists.llvm.org
Tue Jul 5 16:25:01 PDT 2016
I'm not really sure what a NOP even means in SSA. Sure, you can make the
assembler and disassembler and interpreter do the right thing, but in any
optimisation pass the right thing will be to delete them.
If you don't want them to be deleted then, as they have no inputs and no
outputs, optimisation could well decide to move other instructions up past
a NOP, move it out of loops, etc, until it ends up after the return
If you don't want instructions to be moved past it ... it will have to be
like a memory barrier instruction, except even stricter.
What do you want it to do?
By the way, Apple's B3 optimiser in WebKit (which they wrote to replace
LLVM there) does have a NOP instruction -- and an IDENTITY instruction,
which also is meaningless in SSA. When an optimisation wants to delete an
instruction it turns it into a NOP instead. When an optimisation in LLVM
would do a "replace all uses with", B3 inserts an IDENTITY instruction. A
later pass deletes all NOPs and propagates inputs of IDENTITYs to their
On Wed, Jul 6, 2016 at 10:49 AM, Arno Puder via llvm-dev <
llvm-dev at lists.llvm.org> wrote:
> I'm trying to follow the instructions on how to add a new bitcode
> This is my first foray into the guts of LLVM and I'm not sure I'm doing
> things the right way. I came up with a patch that adds a NOP (no
> operation) that will work with llvm-as, llvm-dis, and lli. It would be
> nice if one of the experts could take a look and give some quick feedback:
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev