Displaying 20 results from an estimated 4000 matches similar to: "[LLVMdev] Some MCJIT benchmark numbers"
2013 Nov 19
0
[LLVMdev] Some MCJIT benchmark numbers
The pass manager is re-created in emitObject on every call.
Andy, is that needed or can we create the PM in MCJIT constructor and keep
it around?
Yaron
2013/11/19 Kevin Modzelewski <kmod at dropbox.com>
> So I finally took the plunge and switched to MCJIT (wasn't too bad, as
> long as you remember to call InitializeNativeTargetDisassembler if you want
> disassembly...),
2017 Jul 14
5
SectionMemoryManager::finalizeMemory ... read only data become executable?
Hi,
I am studying the llvm code and I noticed something that looks like a bug. If
it is intentional for some reason, it is not obvious why.
In lib/ExecutionEngine/SectionMemoryManager.cpp in
SectionMemoryManager::finalizeMemory method:
// Make code memory executable.
ec = applyMemoryGroupPermissions(CodeMem,
sys::Memory::MF_READ | sys::Memory::MF_EXEC);
...
//
2013 Sep 22
2
[LLVMdev] Bad permissions for mapped region
Hi List,
I'm trying to upgrade our llvm-c based compiler from JIT to MCJIT.
While trying to do so I encountered several problems. Looks like C
API does not have proper functions to intialize LLVM with MCJIT.
I ended up wrapping the following functions in my own init routine.
LLVMInitializeX86TargetInfo();
LLVMInitializeX86Target();
LLVMInitializeX86TargetMC();
LLVMInitializeX86AsmPrinter();
2013 Sep 22
0
[LLVMdev] Bad permissions for mapped region
I managed to make it work by cloning code from lli and making my own cpp
wrapper.
2013/9/22 Konstantin Olkhovskiy <lupus at oxnull.net>
> Hi List,
>
> I'm trying to upgrade our llvm-c based compiler from JIT to MCJIT.
> While trying to do so I encountered several problems. Looks like C
> API does not have proper functions to intialize LLVM with MCJIT.
> I ended up
2015 Nov 23
2
COFF::IMAGE_REL_AMD64_REL32 relocation overflow when compiling for x86_64
Some time ago I posted here regarding a relocation overflow on Windows
(among other things), but the issue disappeared and so the thread got left.
I've started this new thread because a) I didn't want to necro the old one
and b) it felt like its own.
I've now encountered the issue again and am noting down all the information
I can get about it whilst it's happening.
The issues is
2015 Jan 12
2
[LLVMdev] MCJIT handling of linkonce_odr
Hi,
I'm finally moving cling to MCJIT - and MCJIT is wonderful! So far I
only ran into this issue:
$ cat linkonceodr.cxx
extern "C" int printf(const char*,...);
template <class T> struct StaticStuff {
static T s_data;
};
template <class T> T StaticStuff<T>::s_data = 42;
int compareAddr(int* mcjit);
#ifdef BUILD_SHARED
int compareAddr(int* mcjit) {
if (mcjit
2015 Jan 13
2
[LLVMdev] MCJIT handling of linkonce_odr
Hi Keno,
The part that scares me a bit is
> and then adjust the other methods to not
> bail out two quickly when encountering a weak symbol.
I would very much appreciate if you could implement this; I don't have
enough knowledge of the MCJIT nor llvm CodeGen internals... I will
happily try it out and provide you with feedback, though! :-)
Thank you *so* much for your fast reaction!
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 Feb 16
2
[LLVMdev] MCJIT and Lazy Compilation
Hey Andy,
Yep I've tested some non-trivial examples with loads of dependencies,
both code and data, global, local and external symbol resolution etc..
Actually this was truly a piece of cake, nothing to do, the memory manager
is working really nicely so far as I can tell. Relocations to sections are
all working
as expected (aside from previously mentioned ARM issue which is probably
just
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 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?
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 Mar 09
0
[LLVMdev] MCJIT and Lazy Compilation
Hi Andy/Albert,
Sorry for the slow reply, my day job caught up with me.
Two bits of progress. (a) MCJIT is working nicely for non-trivial
examples in Extempore on x86 and ARM, and (b) the page
permissions are now RO again. For your amusement a *very*
cheesy video of Extempore running on-the-fly with MCJIT on an
ARM Pandaboard. Viewer discretion is advised!
https://vimeo.com/60407237
Here is the
2013 Oct 22
0
[LLVMdev] Size limitations in MCJIT / ELF Dynamic Linker/ ELF codegen?
I would guess that it's crashing somewhere in the generated code. On Windows we don't have a way to get call stacks to the generated code (though if you want to try it on Linux, that should work). You can probably look at the address where the crash is occurring and verify that it is in the generated code.
There are a couple of things I would look for.
First, I'd take a look at the
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
2015 Nov 23
3
COFF::IMAGE_REL_AMD64_REL32 relocation overflow when compiling for x86_64
Thanks Andy, helpful as always!
1 is a possibility, but not ideal for us.
Could you elaborate a little on 3? I don't really know what a jump stub is,
but am guessing it's a kind of "alternative symbol" which would just act as
a middle man to invoke the "real" symbol in the static library.
If that's the case, I can think of a way to implement it for specific
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
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
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 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())
>