[llvm-commits] [PATCH] Fix ARM MCJIT icache invalidation

Amara Emerson amara.emerson at gmail.com
Wed Sep 19 07:50:56 PDT 2012


Thanks very much for the comments.

Originally this patch attempted to be as least intrusive as possible.
At the time however I couldn't see a way to inject the call to
invalidate in between compilation and running the code from within
lli. After looking at the remote MCJIT code it became clear.

I've attached a new patch that adds one call to getPointerToFunction()
just before invalidation. All ARM MCJIT tests now pass.

Regards,
Amara


> On 18 September 2012 14:06, Amara Emerson <amara.emerson at arm.com> wrote:
>> Ping. Jim, could you take a look at this? There was a patch for review a
>> while ago which may conflict with this one (refactoring parts of lli and
>> adding MCJIT tests).
>
> Hi Amara,
>
> Are you sure you need to invalidate the instruction cache when
> emitting every object?
>
> I may be wrong, of course, but AFAICT, this is not the semantics right
> now and doesn't strike me as correct (or desirable), though I see why
> it would "work".


Yep, Renato is completely right. icache handling is the responsibility
of the client (in this case, lli), not the MCJIT. Doing it in the JIT
itself is wrong as it assume the memory the MCJIT is manipulating is
the memory that will actually be executed. That's not the model the
MCJIT uses. Consider remote execution, for example, with the code
being cross-compiled on a remote host (this is how the MCJIT is used
by LLDB, for example, so this isn't hypothetical).


-Jim

>
> --
> cheers,
> --renato
>
> http://systemcall.org/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mcjit-cache-invalidation-2.patch
Type: application/octet-stream
Size: 545 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120919/dbd82eb4/attachment.obj>


More information about the llvm-commits mailing list