[LLVMdev] code generation removes duplicated instructions

Renato Golin renato.golin at arm.com
Thu Jul 7 01:05:47 PDT 2011


On 7 July 2011 00:02, D S Khudia <daya.khudia at gmail.com> wrote:
> I am trying to add a intrinsic call between the similar two instructions
> which either I'll remove or convert to nopĀ in codegen.

If the two instructions are only similar in your real example, than
you need to make them similar in your test, not identical. Different
offsets, different array...

If them two are identical in the real example as it is in your test,
than you don't need to worry about it, because the back-end will
remove them anyway.


> Does that kind of seem appropriate for the purpose here?

If you're adding the builtin call just to mark the code in some way, I
suggest you using metadata. If that builtin has some function that is
necessary in between two similar instructions, than it looks ok.

Sorry if I'm being vague, I'm not fully getting the original problem...

cheers,
--renato




More information about the llvm-dev mailing list