<html dir="ltr"><head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="MSHTML 8.00.6001.19088">
<style id="owaTempEditStyle"></style><style title="owaParaStyle"><!--P {
MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
--></style>
</head>
<body ocsi="x">
<div style="FONT-FAMILY: Tahoma; DIRECTION: ltr; COLOR: #000000; FONT-SIZE: x-small">
<div>Hi Jim,</div>
<div> </div>
<div>I apologize that I have not clearly explained.<br>
MCJITMemoryManager does not allocate the memory himself and uses the JITMemoryManager for this. So, it's my mistake add the clearCache to the MCJITMemoryManager.</div>
<div><font face="tahoma"></font> </div>
<div><font face="tahoma"></font> </div>
<div><font face="tahoma">Regards,</font></div>
<div><font face="tahoma">Danil</font></div>
<div><font face="tahoma"></font> </div>
<div dir="ltr"><font color="#000000" size="2" face="Tahoma"></font> </div>
<div style="DIRECTION: ltr" id="divRpF38136">
<hr tabindex="-1">
<font color="#000000" size="2" face="Tahoma"><b>From:</b> Jim Grosbach [grosbach@apple.com]<br>
<b>Sent:</b> Tuesday, May 15, 2012 1:09 PM<br>
<b>To:</b> Danil Malyshev<br>
<b>Cc:</b> llvm-commits@cs.uiuc.edu<br>
<b>Subject:</b> Re: [llvm-commits] [llvm] [Patch] Add RuntimeDyld.invalidateEmittedSectionsCache()<br>
</font><br>
</div>
<div></div>
<div>Hi Danil,
<div><br>
</div>
<div>JITMemoryManager != TrivialMemoryManager. This logic belongs in the client application. The JITMemoryManager runs in the same process as the JIT compiler. The target code may not.</div>
<div><br>
</div>
<div>The bits of JITMemoryManager that currently reference things like this are purely vestiges of the old JIT and are not appropriate for the new MCJIT model where the host is not assumed to be the same as the target.</div>
<div><br>
</div>
<div>-Jim</div>
<div><br>
</div>
<div>
<div>
<div>On May 15, 2012, at 11:50 AM, Danil Malyshev <<a href="mailto:dmalyshev@accesssoftek.com">dmalyshev@accesssoftek.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<blockquote type="cite">
<div>
<div style="FONT-FAMILY: Tahoma; DIRECTION: ltr; FONT-SIZE: x-small">
<div>Hi Jim,</div>
<div><font face="tahoma"></font> </div>
<div><font face="tahoma">I see, it's should be in the JITMemoryManager instead of the RTDyldMemoryManager.</font></div>
<div><font face="tahoma"></font> </div>
<div><font face="tahoma">Please review attached the patch. It's adds LLIMCJITMemoryManager to lli.</font></div>
<div><font face="tahoma">The another way is add the clear cache to the DefaultJITMemoryManager, but attached way is more<span class="Apple-converted-space"> </span><span id="result_box" lang="en" class="short_text"><span class="hps">flexible for MCJIT tasks</span></span>.</font></div>
<div><font face="tahoma"></font> </div>
<div><font face="tahoma"></font><font size="2" face="Tahoma"></font> </div>
<div><font face="tahoma">Regards,</font></div>
<div><font face="tahoma">Danil</font></div>
<div><font face="tahoma"></font> </div>
<div style="DIRECTION: ltr" id="divRpF827210">
<hr tabindex="-1">
<font size="2" face="Tahoma"><b>From:</b><span class="Apple-converted-space"> </span>Jim Grosbach [<a href="mailto:grosbach@apple.com">grosbach@apple.com</a>]<br>
<b>Sent:</b><span class="Apple-converted-space"> </span>Monday, May 14, 2012 9:55 AM<br>
<b>To:</b><span class="Apple-converted-space"> </span>Danil Malyshev<br>
<b>Cc:</b><span class="Apple-converted-space"> </span><a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<b>Subject:</b><span class="Apple-converted-space"> </span>Re: [llvm-commits] [llvm] [Patch] Add RuntimeDyld.invalidateEmittedSectionsCache()<br>
</font><br>
</div>
<div></div>
<div>
<div>Hi Danil,</div>
<div><br>
</div>
<div>I'm not sure what additional information you're looking for. The logic you're wanting to add belongs in the memory manager of the client application, not the MCJIT. For example, in the case of lli, it should be part of the TrivialMemoryManager there.</div>
<div><br>
</div>
<div>Note that the old JIT did this differently, as it assumed it wasn't ever going to deal with a remote target. It could, and did, make lots of assumptions about that. As such, be wary of using its code paths as a guide for how the MCJIT should work.</div>
<div><br>
</div>
<div>-Jim</div>
<div><br>
</div>
<br>
<div>
<div>On May 14, 2012, at 9:49 AM, Danil Malyshev <<a href="mailto:dmalyshev@accesssoftek.com">dmalyshev@accesssoftek.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<blockquote type="cite">
<div style="FONT-FAMILY: Tahoma; DIRECTION: ltr; FONT-SIZE: x-small">
<div>Ping.</div>
<div><font face="tahoma"></font> </div>
<div><font face="tahoma"></font> </div>
<div><font face="tahoma">Regards,</font></div>
<div><font face="tahoma">Danil</font></div>
<div> </div>
<div dir="ltr"><font size="2" face="Tahoma"></font> </div>
<div style="DIRECTION: ltr" id="divRpF115907">
<hr tabindex="-1">
<font size="2" face="Tahoma"><b>From:</b><span class="Apple-converted-space"> </span><a href="mailto:llvm-commits-bounces@cs.uiuc.edu">llvm-commits-bounces@cs.uiuc.edu</a><span class="Apple-converted-space"> </span>[<a href="mailto:llvm-commits-bounces@cs.uiuc.edu">llvm-commits-bounces@cs.uiuc.edu</a>]
On Behalf Of Danil Malyshev [<a href="mailto:dmalyshev@accesssoftek.com">dmalyshev@accesssoftek.com</a>]<br>
<b>Sent:</b><span class="Apple-converted-space"> </span>Tuesday, May 08, 2012 5:50 PM<br>
<b>To:</b><span class="Apple-converted-space"> </span>Jim Grosbach<br>
<b>Cc:</b><span class="Apple-converted-space"> </span><a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<b>Subject:</b><span class="Apple-converted-space"> </span>Re: [llvm-commits] [llvm] [Patch] Add RuntimeDyld.invalidateEmittedSectionsCache()<br>
</font><br>
</div>
<div></div>
<div>
<div style="FONT-FAMILY: Tahoma; DIRECTION: ltr; FONT-SIZE: x-small">
<div>Hi Jim,</div>
<div><font face="tahoma"></font> </div>
<div>Yes, I agree that it's client application job. But the MCJIT hard linked with hosted platform. It loads hosted library, it executes code on the host machine and etc. JIT and MCJIT was hidden from appication by EngineBuilder, their memory managers hidden
too. The JIT does it for own code, I believe the MCJIT should do it too.</div>
<div>The remote JIT will not be based by MCJIT, it's will be something new, with own memory manager inherited from RTDyldMemoryManager and in this case the remote client application will be cares about their cache.<br>
</div>
<div><font face="tahoma"></font> </div>
<div><font face="tahoma">Regards,</font></div>
<div><font face="tahoma">Danil</font></div>
<div dir="ltr"><font size="2" face="Tahoma"></font> </div>
<div style="DIRECTION: ltr" id="divRpF163767">
<hr tabindex="-1">
<font size="2" face="Tahoma"><b>From:</b><span class="Apple-converted-space"> </span>Jim Grosbach [<a href="mailto:grosbach@apple.com">grosbach@apple.com</a>]<br>
<b>Sent:</b><span class="Apple-converted-space"> </span>Tuesday, May 08, 2012 4:24 PM<br>
<b>To:</b><span class="Apple-converted-space"> </span>Danil Malyshev<br>
<b>Cc:</b><span class="Apple-converted-space"> </span><a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<b>Subject:</b><span class="Apple-converted-space"> </span>Re: [llvm-commits] [llvm] [Patch] Add RuntimeDyld.invalidateEmittedSectionsCache()<br>
</font><br>
</div>
<div></div>
<div>Hi Danil,
<div><br>
</div>
<div>This is closer, but not quite. By the client's memory manager, I mean the application. This functionality shouldn't be in the core MC-JIT at all. For example, it belongs in the TrivialMemoryManager in llvm-rtdyld.cpp. That includes keeping the list of
allocations and sections. Consider a remote client. The MemoryBlock map you're creating here will refer to the local copy, not the memory that's actually on the target where it'll be executed. The code that knows how to map between the two is the client's
memory manager, so that's where this logic belongs as well.</div>
<div><br>
</div>
<div>-Jim</div>
<div><br>
<div>
<div>On May 8, 2012, at 4:09 PM, Danil Malyshev <<a href="mailto:dmalyshev@accesssoftek.com">dmalyshev@accesssoftek.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<blockquote type="cite">
<div style="FONT-FAMILY: Tahoma; DIRECTION: ltr; FONT-SIZE: x-small">
<div>
<div>Hi,</div>
<div><font face="tahoma"></font> </div>
<div><font face="tahoma">Please review changed the patch.</font></div>
<div><font face="tahoma">This patch adds finalize() to RTDyldMemoryManager, and implements it for MCJITMemoryManager as invalidate instruction cache.</font></div>
<div><font face="tahoma"></font> </div>
<div> </div>
<div><font face="tahoma">Regards,</font></div>
<div><font face="tahoma">Danil</font></div>
<div><font face="tahoma"></font> </div>
</div>
<div dir="ltr"><font size="2" face="Tahoma"></font> </div>
<div style="DIRECTION: ltr" id="divRpF625534">
<hr tabindex="-1">
<font size="2" face="Tahoma"><b>From:</b><span class="Apple-converted-space"> </span>Jim Grosbach [<a href="mailto:grosbach@apple.com">grosbach@apple.com</a>]<br>
<b>Sent:</b><span class="Apple-converted-space"> </span>Monday, May 07, 2012 4:16 PM<br>
<b>To:</b><span class="Apple-converted-space"> </span>Danil Malyshev<br>
<b>Cc:</b><span class="Apple-converted-space"> </span><a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<b>Subject:</b><span class="Apple-converted-space"> </span>Re: [llvm-commits] [llvm] [Patch] Add RuntimeDyld.invalidateEmittedSectionsCache()<br>
</font><br>
</div>
<div></div>
<div>
<div>Hi Danil,</div>
<div><br>
</div>
That's not the RuntimeDyld's job. That functionality belongs in elsewhere, probably in the client's memory manager implementation where it's hooked into copying the compiled code into the target's address space. For a hosted platform, something similar just
w/o the copying.
<div><br>
</div>
<div>-Jim</div>
<div><br>
<div>
<div>
<div>On May 7, 2012, at 2:09 PM, Danil Malyshev <<a href="mailto:dmalyshev@accesssoftek.com">dmalyshev@accesssoftek.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<blockquote type="cite">
<div style="FONT-FAMILY: Tahoma; DIRECTION: ltr; FONT-SIZE: x-small">
<div style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px">Hi everyone,</div>
<p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px"> </p>
<div style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px">Please review attached the patch.</div>
<div style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px">This patch adds invalidateEmmittedSectionsCache() to the RuntimeDyld and uses it in the MCJIT after resolve relocations.<br>
The MCJIT works unstable on the ARM platforms without it.<br>
This patch haven't any tests because I want to commit the common ExecutionEngine/MCJIT tests after attached the patch will be committed. These tests will cover it.<br>
</div>
<div></div>
<div dir="ltr"><font size="2" face="Tahoma">Regards,</font></div>
<div dir="ltr"><font face="tahoma">Danil</font></div>
</div>
<span><RuntimeDyld_invalidateEmittedSectionsCache-01.patch></span>_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</div>
<span><RTDyldMemoryManager_finalize-01.patch></span></blockquote>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
<span><LLIMCJITMemoryManager.patch></span></div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</body>
</html>