[LLVMdev] SmallPtrSet patch for MCJIT

Yaron Keren yaron.keren at gmail.com
Mon Oct 21 22:56:49 PDT 2013


Hi Andy,

Here is the patch. it incorporates:

1) your latest patch to SVN.
2) mcjit-module-state-optimization.patch.
3) the PtrSet changes.

Other than the OwnedModules implementation there were other differences
between 1) and 2), especially in the Finalize* functions, so please review
that I got the right code.

I got bitten by subtle bugs arising from MCJIT inheriting from EE:
First, MCJIT overridden addModule but not removeModule so the EE version
was called. Second, both MCJIT and EE constructors take ownership of the
module and their destructors try to delete it. Fixed this with a hack in
MCJIT destructor and a FIXME comment, the real fix is simply getting EE out
of the picture. It just interferes.
I know it's in the plans, yet more reasons to do so.

Finally, I don't know if there are good multi-module test cases. I have run
only my one-module use-case (currently - I'm having other-than-MCJIT issues
with multiple modules) with the code and after fixing the above bugs the
code, debugged line by line, appear to work OK.

Yaron
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20131022/d894995e/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mcjit-ptrset.diff
Type: application/octet-stream
Size: 13682 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20131022/d894995e/attachment.obj>


More information about the llvm-dev mailing list