another experimental patch for bug 2606

Hey all,

Attached you will find an experimental patch which allows me to play with a derived JIT class. With this patch
I’ve alleviated my concerns with forcing cross module behavior for all users of JIT. However this introduces some
new semantics, and kind of circumvents the EngineBuilder API. More important though, I have not addressed
any concern about using stub functions in eager compilation mode. I don’t yet understand this concern since
these stubs are compile time only, and it seems that the pending function system inherently uses stubs. Anyway
I’m sure my understanding will get fixed soon enough. :slight_smile: The new code is NOT commented.

This patch was NOT attached to 2606. Rather I feel this patch is experimental in nature. As before I tried to use “GMV Mod”
as comments to mark my modifications as long as they did not involve introducing new files. If one is interested and wants
to use this patch, one should use the test cases found in 2606 and modify them in the following ways.

  1. Add: #include “llvm/ExecutionEngine/CrossModuleJIT.h”
  2. Add the call: LLVMSetupForCrossModuleJITUse();
    before using the EngineBuilder API

For example take:

ExecutionEngine* EE = EngineBuilder(M).create();

and turn it into:

LLVMSetupForCrossModuleJITUse();

ExecutionEngine* EE = EngineBuilder(M).create();

I wrote this somewhat fast so caveat emptor.

Garrison

PR2606.experimental.patch (11 KB)

Eek! I'm going to lose track of the threads if you start a new one
every time you update the patch. Consider using
http://codereview.appspot.com/?

FWIW, I don't like the idea of adding a new JIT class to support
linking. I think you can do it without this.

Will do

Garrison

No problem I'll drop this from our discussion as it really is only germane to my
learning path and imagination. :slight_smile: I do at this time still have this concern of
allowing a user (developer) the right to turn this "cross module linkage" off, but
I'm still in the process of understanding your previous comments on this.

Thanks again for the help and time by the way.

Garrison

PS: I'm still studying your last detailed comments to thread:
"2nd attempt for a working patch for bug 2606". I'll keep
that one alive.

No problem I'll drop this from our discussion as it really is only germane to my
learning path and imagination. :slight_smile: I do at this time still have this concern of
allowing a user (developer) the right to turn this "cross module linkage" off, but
I'm still in the process of understanding your previous comments on this.

Well, they can do that with multiple JITs. Do you know of anyone who needs it?

Thanks again for the help and time by the way.

Least I can do after leaving you hanging for a week and a half.

Jeffrey

No problem I'll drop this from our discussion as it really is only germane to my
learning path and imagination. :slight_smile: I do at this time still have this concern of
allowing a user (developer) the right to turn this "cross module linkage" off, but
I'm still in the process of understanding your previous comments on this.

Well, they can do that with multiple JITs. Do you know of anyone who needs it?

No, although I guess the patch does demonstrate what one has to do at this time, if one
needed to inherit from JIT. Beyond that it is only useful to my experiments. I did not know
until your response, if the direction was of interest to LLVM's more immediate goals.

Jeffrey

Garrison