<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>This seems to be what I am looking for. That was very helpful. Thank you.<div><br></div><div>Erdem<br><br><div><hr id="stopSpelling">From: vlknkls@gmail.com<br>Date: Wed, 16 Sep 2015 16:25:29 +0000<br>Subject: Re: [llvm-dev] How to add NOP?<br>To: erdemderebasoglu@hotmail.com; llvm-dev@lists.llvm.org<br><br><div dir="ltr">Use MachineInstr::memoperands() function to get memory operands then you can get the address space by using MachineMemOperand::getAddrSpace().<div><br></div><div>Volkan<br><br><div class="ecxgmail_quote"><div dir="ltr">On Tue, Sep 15, 2015 at 11:40 PM Erdem Derebažošlu <<a href="mailto:erdemderebasoglu@hotmail.com">erdemderebasoglu@hotmail.com</a>> wrote:<br></div><blockquote class="ecxgmail_quote" style="border-left:1px #ccc solid;padding-left:1ex;">
<div><div dir="ltr">Thanks for the response. How can I find out if an instruction uses a private memory access?<div><br></div><div></div></div></div><div><div dir="ltr"><div>Erdem<br></div></div></div><div><div dir="ltr"><div><div><hr>From: <a href="mailto:vlknkls@gmail.com" target="_blank">vlknkls@gmail.com</a><br>Date: Tue, 15 Sep 2015 14:38:16 +0000<br>Subject: Re: [llvm-dev] How to add NOP?<br>To: <a href="mailto:erdemderebasoglu@hotmail.com" target="_blank">erdemderebasoglu@hotmail.com</a>; <a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a></div></div></div></div><div><div dir="ltr"><div><div><br><br><div style="white-space:pre-wrap;">Hi Erdem,<br><br>I would write a MachineFunction pass. You can check each load instruction to see if it is a private memory access and insert what you want by using BuildMI(...) function.<br><br>Volkan</div><br><div><div dir="ltr">On Tue, Sep 15, 2015 at 4:16 AM Erdem Derebažošlu <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote style="border-left:1px #ccc solid;padding-left:1ex;">
<div><div dir="ltr">I would like to convert a C file that uses OpenMP library to X86 code with a condition: I want to insert a NOP before each instruction that does a private memory access.<div>I have written an optimization pass that inserts an inline assembly call (NOP) but it is applied at IR level, and I cannot determine where to insert it. How can I use LLVM to add NOPs accordingly?</div><div><br></div><div>Thanks.</div> </div></div>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div></div></div></div></div></blockquote></div></div></div></div></div> </div></body>
</html>