<div dir="ltr"><div class="gmail_default" style="font-family:tahoma,sans-serif">My pass runs after optimization passes.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jul 9, 2015 at 1:11 PM, David Chisnall <span dir="ltr"><<a href="mailto:David.Chisnall@cl.cam.ac.uk" target="_blank">David.Chisnall@cl.cam.ac.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
What are you trying to achieve?  Inserting NOPs into LLVM IR is likely to be pointless, as optimisations (in the IR or SelectionDAG) will remove them before machine code generation.  If you want to insert NOPs into the generated machine code, then this will not help you (you could insert inline assembly containing nops into the IR).<br>
<br>
David<br>
<div><div class="h5"><br>
> On 9 Jul 2015, at 09:25, Zahra Marj <<a href="mailto:zahrafatehimarj@gmail.com">zahrafatehimarj@gmail.com</a>> wrote:<br>
><br>
> Hi.<br>
> I need to write a function pass that insert nop instruction in function. Examples of these instructions are: %nop = add i1 0, 0 or %nop = alloca i1, i1 0. This link couldn't help me: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_docs_ProgrammersManual.html-23creating-2Dand-2Dinserting-2Dnew-2Dinstructions&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=Mfk2qtn1LTDThVkh6-oGglNfMADXfJdty4_bhmuhMHA&m=Qp9GWIWeL3Bal7o2P67hp2QbDCZLKBcsuzuT3xzMMUo&s=GZrVdTwGMs5jykSuspIi7GRCIni6kaJDICG65OxeZMc&e=" rel="noreferrer" target="_blank">http://llvm.org/docs/ProgrammersManual.html#creating-and-inserting-new-instructions</a><br>
> I need a clear example about inserting new instruction. Anyone can help me?<br>
> Thanks.<br>
</div></div>> _______________________________________________<br>
> LLVM Developers mailing list<br>
> <a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" rel="noreferrer" target="_blank">http://llvm.cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" rel="noreferrer" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br>
</blockquote></div><br></div>