Displaying 20 results from an estimated 6000 matches similar to: "[LLVMdev] EE, JIT, MCJIT class structure"
2013 Oct 18
0
[LLVMdev] EE, JIT, MCJIT class structure
Yes, we've been planning to separate the execution engines for a while now, and we've made some small steps (such as breaking out the RTDyldMemoryManager interface) in preparation for doing so. There are some serious entanglements, not least of which there are MCJIT clients (LLDB, for instance) which are using memory managers derived from the JITMemoryManager. Eventually (and soon)
2013 Oct 22
2
[LLVMdev] An enhancement for MCJIT::getFunctionAddress
I don’t follow. Why are we looking at the module at all? That query should work even (especially) after the Module is deleted. We should be able to have a local symbol table that’s a DenseMap or something similar to resolve from names to target addresses. That map would be updated as part of the compilation when the object’s symbol table gets read.
-Jim
On Oct 21, 2013, at 4:55 PM, Kaylor,
2013 Oct 22
2
[LLVMdev] Size limitations in MCJIT / ELF Dynamic Linker/ ELF codegen?
OS is Windows 7 64 bit OS, compiler is 32 bit Visual C++ 2012 with 32 bit.
The target which is i686-pc-mingw32-elf so I can use the ELF dynamic
loader.
Code model, relocation model and and memory manager are whatever default
for this - did not modify.
The Module comes from clang. The source is 1000 or more lines repeating C++
code in one big function:
A+1;
A*B.t();
where A and B are
2013 Oct 21
2
[LLVMdev] An enhancement for MCJIT::getFunctionAddress
The search is linear? If that’s really true, we should fix that.
On Oct 21, 2013, at 10:14 AM, Kaylor, Andrew <andrew.kaylor at intel.com> wrote:
> I should have read this before sending my previous reply. :-)
>
> I’m not a big fan of default parameters, but some form of what you are suggesting may be useful. See my other comments on this topic in the other reply.
>
>
2013 Oct 22
2
[LLVMdev] Size limitations in MCJIT / ELF Dynamic Linker/ ELF codegen?
I'm running in MCJIT a module generated from one C++ function. Every line
of the source function uses C++ classes and may throw an exception. As long
as there are less than (about) 1000 lines, everything works. With more
lines the compiled code crashes when running it, with no sensible stack
trace.
Is there any kind of hard-coded size limitation in MCJIT / ELF Dynamic
Linker / ELF codegen /
2013 Oct 30
1
[LLVMdev] Using MCJIT in a dynamic REPL environment
The new MCJIT is module-oriented, like a classic compiler+linker (which it
is) while the old JIT is function-oriented.
If I understand correctly, the main problems with the old JIT were the
duplication of the debug information code and EH code (both gone now).
Moreover, if we ignore the lazy evaluation mechanism then the current JIT
is actually quite simple module.
Would it be possible to keep
2013 Oct 22
2
[LLVMdev] Size limitations in MCJIT / ELF Dynamic Linker/ ELF codegen?
Hi,
Thanks for your ideas.
Memory allocation already exceeds 2x64K in the "working" case so it's not
the condition of allocating more than 64K. To be sure I had modified
SectionMemoryManager::allocateSection to allocate four time the required
memory but it did not trigger more crashes.I debugged through the
allocation code including the Win32 code and it seems to work well. I have
2013 Oct 19
2
[LLVMdev] An enhancement for MCJIT::getFunctionAddress
In MCJIT, the old JIT functions are deprecated in favor
of getFunctionAddress.
Code like:
llvm::Function *F = M->getFunction(FuncName);
void *FN = EE->getPointerToFunction(F);
should be rewritten as
uint64_t FN = EE->getFunctionAddress(FuncName);
While functionally identical, in case the correct module is known the new
version will be much slower, linear with the number of added
2013 Oct 23
2
[LLVMdev] Size limitations in MCJIT / ELF Dynamic Linker/ ELF codegen?
If it's a Windows-only thing the correct tests would be:
if (NumBytes >= 4096 && STI.isOSWindows()) {
and
if (Subtarget->isTargetWindows())
where
bool isOSWindows() const { return TargetTriple.isOSWindows(); }
Yaron
2013/10/23 Andrew MacPherson <andrew.macp at gmail.com>
> Glad that helped! As I understand it __chkstk is always required on
> Windows
2013 Oct 23
3
[LLVMdev] Size limitations in MCJIT / ELF Dynamic Linker/ ELF codegen?
YES, this is the problem!
The program work ok, even a 5x larger version works well.
Clearly the _chkstk calls must be emitted with ELF target on Windows as
well - why not?
I'd like to make a patch and fix this right.
I experimented with both changes and practically only the
lib/Target/X86/X86ISelLowering.cpp fixes the problem. The other change
lib/Target/X86/X86FrameLowering.cpp was not
2013 Oct 22
2
[LLVMdev] Size limitations in MCJIT / ELF Dynamic Linker/ ELF codegen?
Yes, this is correct code address accessing bad data address.
However, there is no other relocation before .text or near it. I'll send
you the full debug printout, maybe you'll note something.
The problem could be result of something else entirely else than the linker
such as some library initialization code that by chance worked with smaller
code but fails now.
I need to debug and see
2013 Oct 22
1
[LLVMdev] SmallPtrSet patch for MCJIT
Hi Andy,
I added the runStaticConstructorsDestructors and FindFunctionNamed
functions. This also required making them virtual in EE.h.
I'm not sure about FindFunctionNamed:
In addition to searching finalized modules, should it search Added and
Loaded modules?
If it finds a Function in these, should it compile and finalize it before
returning the Function* ?
I modified the implementation
2013 Oct 22
0
[LLVMdev] An enhancement for MCJIT::getFunctionAddress
Hi Jim,
Clearly searching for name should not be linear in modules but with a map
of some kind.
After compilation to IR each module has a StringMap symbol table.
After compiling to MC and loading the object file, the dynamic linker has
a StringMap symbol table for all loaded modules.
In the usual use case you'll load module(s) into MCJIT and then compile /
link them and all is well, no
2013 Oct 23
0
[LLVMdev] Size limitations in MCJIT / ELF Dynamic Linker/ ELF codegen?
This is the right fix if Cygwin wants calls to __chkstk. Otherwise you'll
want TargetTriple.isOSMSVCRT().
On Wed, Oct 23, 2013 at 2:50 AM, Yaron Keren <yaron.keren at gmail.com> wrote:
> If it's a Windows-only thing the correct tests would be:
>
> if (NumBytes >= 4096 && STI.isOSWindows()) {
>
> and
>
> if (Subtarget->isTargetWindows())
>
2013 Oct 30
2
[LLVMdev] Using MCJIT in a dynamic REPL environment
Hi,
I'm trying to transition from the JIT to MCJIT. The requirements are fast
response time and dynamic unloading/replacement of modified functions. Lazy
evaluation is *not* required: I expect all functions to be present at
runtime or else an error is fine.
With the JIT it's quite simple to unload and replace functions due to the
stubs (JMP instructions) that redirect the actual function
2013 Oct 22
2
[LLVMdev] SmallPtrSet patch for MCJIT
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
2013 Oct 23
0
[LLVMdev] Size limitations in MCJIT / ELF Dynamic Linker/ ELF codegen?
Glad that helped! As I understand it __chkstk is always required on Windows
regardless of output type, I had meant to file a bug about this but had
apparently forgotten to do so. I think the check needs to be that the
target is Windows and ignore the output type, Linux and OSX don't use this.
Cheers,
Andrew
On Wed, Oct 23, 2013 at 11:32 AM, Yaron Keren <yaron.keren at gmail.com>
2013 Oct 15
2
[LLVMdev] A weird, reproducable problem with MCJIT
Correct or no I don't know, but this change will affect all x86-64 targets
including Linux and Windows as getMaxStubSize() is called from the ELF
linker as well as the Mach-O linker.
2013/10/15 Christian Schafmeister <chris.schaf at verizon.net>
>
> With the help of iain at codesourcery.com and andrew.kaylor at intel.com we
> tracked the problem down to a bad relocation that
2013 Oct 22
0
[LLVMdev] Size limitations in MCJIT / ELF Dynamic Linker/ ELF codegen?
So it looks like 0x0A3600D1 is a good code address and there's no problem executing the code there, but 0x00BC7680 is a bad data address. Is that correct?
If so, this is almost certainly a relocation problem. You just need to find a relocation that writes an entry (probably a relative offset) at 0x0A3600D1+the size of the instruction at that address.
BTW, what I said before about not being
2013 Oct 23
0
[LLVMdev] Size limitations in MCJIT / ELF Dynamic Linker/ ELF codegen?
Hi Yaron,
If you're outputting ELF on Windows this sounds like an issue we ran into
where __chkstk calls weren't being output in the assembly due to an
explicit check for COFF output. Once stack allocations in a given function
exceeded some amount we'd get exactly this kind of crash in the function
initialization.
If you take a look for isTargetCOFF() in