Displaying 20 results from an estimated 58 matches for "getpointertoglobal".
2012 Nov 11
1
[LLVMdev] wrong value with getPointerToGlobal
I'm having some trouble getting access to a global variable with
getPointerToGlobal. The resulting value is not what I am expecting.
My assembly looks something like this:
@gresult = global i32 undef
define i32 @eval_expr() {
entry:
...
store i32 %3, i32* @gresult
ret i32 %3
}
Where "gresult" is created with:
auto global = new llvm::GlobalVariable( *module, in...
2012 Nov 12
2
[LLVMdev] getPointerToGlobal() / MCJIT
Hi all,
are there any plans to correct/implement the "getPointerToGlobal()"
method for accessing global variables that are emitted by MCJIT?
(see for details the unit test of MCJIT)
Best Regards
Armin
2004 May 11
1
[LLVMdev] Follow-up on: Dynamic updates of current executed code
...After that my questions come:
-----------BEGIN Initial problem description---------------
Problem is though, that the Ruby compiler is integrated in the compilation of the program being executed, to be able to parse & compile dynamic code at run-time. Therefore the calls to ExecutionEngine::getPointerToGlobal(F) need to be made in LLVM code. Here is a detailed simplistic example in pseudocode of what we want to do:
First Ruby code is entered at run-time, received as a string, parsed and compiled into the following code:
%--------------
; External function
declare int %printf(sbyte*, ...)
; Custom fun...
2012 Nov 13
0
[LLVMdev] getPointerToGlobal() / MCJIT
As far as I know, no one is working to fix the test case in question. Patches welcome :)
Cheers,
Dan
On 2012-11-13, at 1:29 AM, "Armin Steinhoff" <armin at steinhoff.de> wrote:
>
> Hi all,
>
> are there any plans to correct/implement the "getPointerToGlobal()" method for accessing global variables that are emitted by MCJIT?
> (see for details the unit test of MCJIT)
>
> Best Regards
>
> Armin
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.u...
2012 Nov 12
0
[LLVMdev] getPointerToGlobal() / MCJIT
Hi all,
are there any plans to correct/implement the "getPointerToGlobal()"
method for accessing global variables that are emitted by MCJIT?
(see for details the unit test of MCJIT)
Best Regards
Armin
2014 Mar 21
3
[LLVMdev] lli crashes when running cpp programs
...0x00007fd4c06d7302
8 lli
0x0000000000cf1620
llvm::JIT::runJITOnFunctionUnlocked(llvm::Function*, llvm::MutexGuard
const&) + 66
9 lli
0x0000000000cf1a3a llvm::JIT::getPointerToFunction(llvm::Function*) +
694
10 lli
0x00000000010fb64c llvm::ExecutionEngine::getPointerToGlobal(llvm::GlobalValue
const*) + 70
11 lli
0x0000000000cfa2f0
12 lli
0x0000000000cfaca3
13 lli
0x00000000008c9368
14 lli
0x0000000000d6a9e1
llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 95
15
lli 0x000000000129a53f
llvm::FPPas...
2004 Apr 20
2
[LLVMdev] Dynamic updates of current executed code
Thanks!
Problem is though, that the Ruby compiler is integrated in the compilation of the program being executed, to be able to parse & compile dynamic code at run-time. Therefore the calls to ExecutionEngine::getPointerToGlobal(F) need to be made in LLVM code. Here is a detailed simplistic example in pseudocode of what we want to do:
First Ruby code is entered at run-time, received as a string, parsed and compiled into the following code:
%-----------------------------------------------------
; External function
declare...
2009 Oct 06
0
[LLVMdev] 2.6/trunk Execution Engine question
...ExecutionEngine was trying to JIT a global, and it had never JITted
> any functions! I'll work up a small test case, but I think it's
> relevant since the thing is trying to allocate the globals with the
> functions.
>
That was it! The following small test program crashes in getPointerToGlobal:
#include "llvm/Module.h"
#include "llvm/Function.h"
#include "llvm/InlineAsm.h"
#include "llvm/Support/IRBuilder.h"
#include "llvm/ModuleProvider.h"
#include "llvm/ExecutionEngine/ExecutionEngine.h"
#include "llvm/Support/raw_os_ost...
2009 Oct 06
1
[LLVMdev] 2.6/trunk Execution Engine question
On Tue, Oct 6, 2009 at 5:49 PM, Reid Kleckner <rnk at mit.edu> wrote:
>> Also, the null pointer is coming from a call to JCE->allocateSpace().
>> This is a virtual function; I'm trying to discover what subclass it
>> is.
>
> So, there's JITEmitter::allocateSpace which overrides
> JITCodeEmitter::allocateSpace(), but *most* of the time it just calls
>
2010 Jan 22
2
[LLVMdev] Exception handling question
...n detected!"'
failed.
...
6 lli 0x0000000000d3f5e2
llvm::JIT::runJITOnFunctionUnlocked(llvm::Function*, llvm::MutexGuard const&) + 62
7 lli 0x0000000000d3f9c6 llvm::JIT::getPointerToFunction(llvm::Function*)
+ 686
8 lli 0x0000000000d67c86
llvm::ExecutionEngine::getPointerToGlobal(llvm::GlobalValue const*) + 70
9 lli 0x0000000000d62805
llvm::JITDwarfEmitter::EmitCommonEHFrame(llvm::Function const*) const + 613
10 lli 0x0000000000d60ac3
llvm::JITDwarfEmitter::EmitDwarfTable(llvm::MachineFunction&,
llvm::JITCodeEmitter&, unsigned char*, unsigned char*,...
2009 Oct 06
4
[LLVMdev] 2.6/trunk Execution Engine question
> 6. When ExecutionEngine::create was called with parameter
> "GVsWithCode" set to its default value of true, I got a segfault when
> trying to get a pointer to one of my globals. JIT::getMemoryForGV was
> returning NULL in that case. Explicitly passing false for
> "GVsWithCode" cleared it up.
That's no good. Could you send me a stack trace and explain
2012 Dec 05
0
[LLVMdev] how to get and modify a global variable inside a module
...o know the exact main memory address of the
> Global Varibale's address when ExecutionEngine execut the *.ll code. further
> more, i want to change the address, is it possible?
I assume you want to adjust the value at that address, right?
Then you might want to check the ExecutionEngine::getPointerToGlobal
method. You can just cast the void* to the appropriate pointer type, and
write to it.
If you really want to change the address of the GlobalValue (i.e. the
mapping from GlobalValue to main memory address), you can use the
addGlobalMapping or updateGlobalMapping methods, but this should only be...
2013 Jan 20
1
[LLVMdev] Get the value of a GlobalVariable
Hi,
I am executing a C program using JIT. When the program exits, the control
comes back to my program which initiates the JIT. Now, I want to read
the value(not the LLVM nomenclature) of a global variable (not the LLVM
nomenclature). I am able to get the global variable, using the following
command:
GlobalVariable *my_global = Mod->getNamedGlobal("MY_GLOBAL");
I want to know the
2012 Dec 05
3
[LLVMdev] how to get and modify a global variable inside a module
hi Duncan Sands,
i have tried the functions:
GlobalValue * getNamedValue (StringRef Name) const
GlobalVariable * getGlobalVariable (StringRef Name, bool
AllowInternal=false) const
GlobalVariable * getNamedGlobal (StringRef Name) const
but i think these functions just return the ID or something else (not the
Global Variable's main memory address, i am not sure)
here is the thing. i
2008 Oct 14
2
[LLVMdev] bug in the JIT global variable emitter
...ariables in
the JIT buffer, but it creates a new mem block if it doesn't exist (i.e.
when dumping a global variable out of the scope of a function compilation).
The patch is at:
http://web.ist.utl.pt/nuno.lopes/llvm_jit_global_emitter2.txt
The problem only happens when calling
ExecutionEngine::getPointerToGlobal(someGV) from some non-llvm program. If
the function is called when JITing a function, it works, since it will dump
the global variable to the memory reserved to the function being JITed,
which raises a question: shouldn't it generate the GV to some non-executable
memory block?? My patch doesn...
2008 Sep 25
3
[LLVMdev] Kaleidoscope doesn't work properly
...4889cbb7 in kill () from /lib/libc.so.7
#1 0x4868d146 in raise () from /lib/libthr.so.3
#2 0x4889b76a in abort () from /lib/libc.so.7
#3 0x0831f8a0 in llvm::JIT::getPointerToNamedFunction ()
#4 0x0832177a in llvm::JIT::getPointerToFunction ()
#5 0x083275a2 in (anonymous namespace)::JITEmitter::getPointerToGlobal ()
#6 0x083280e4 in (anonymous namespace)::JITEmitter::finishFunction ()
#7 0x0805f8d0 in (anonymous namespace)::Emitter::runOnMachineFunction ()
#8 0x081deee8 in llvm::MachineFunctionPass::runOnFunction ()
#9 0x08561cd7 in llvm::FPPassManager::runOnFunction ()
#10 0x08562185 in llvm::FunctionP...
2010 Jan 22
0
[LLVMdev] Exception handling question
......
> 6 lli 0x0000000000d3f5e2
> llvm::JIT::runJITOnFunctionUnlocked(llvm::Function*, llvm::MutexGuard
> const&) + 62
> 7 lli 0x0000000000d3f9c6
> llvm::JIT::getPointerToFunction(llvm::Function*) + 686
> 8 lli 0x0000000000d67c86
> llvm::ExecutionEngine::getPointerToGlobal(llvm::GlobalValue const*) + 70
> 9 lli 0x0000000000d62805
> llvm::JITDwarfEmitter::EmitCommonEHFrame(llvm::Function const*) const + 613
> 10 lli 0x0000000000d60ac3
> llvm::JITDwarfEmitter::EmitDwarfTable(llvm::MachineFunction&,
> llvm::JITCodeEmitter&, unsigned c...
2010 Jan 22
2
[LLVMdev] Exception handling question
...0000000000d3f5e2
>> llvm::JIT::runJITOnFunctionUnlocked(llvm::Function*, llvm::MutexGuard
>> const&) + 62
>> 7 lli 0x0000000000d3f9c6
>> llvm::JIT::getPointerToFunction(llvm::Function*) + 686
>> 8 lli 0x0000000000d67c86
>> llvm::ExecutionEngine::getPointerToGlobal(llvm::GlobalValue const*) + 70
>> 9 lli 0x0000000000d62805
>> llvm::JITDwarfEmitter::EmitCommonEHFrame(llvm::Function const*) const + 613
>> 10 lli 0x0000000000d60ac3
>> llvm::JITDwarfEmitter::EmitDwarfTable(llvm::MachineFunction&,
>> llvm::JITCodeEmit...
2008 Oct 13
0
[LLVMdev] bug in the JIT global variable emitter
On Oct 13, 2008, at 2:42 PMPDT, Nuno Lopes wrote:
> Hi,
>
> Today I found a nice bug in the JIT global variable emitter.
> The problem may lead to an assert() failure when doing the following:
> 1) compile some function
> 2) emit a global variable
> 3) compile another function. an assert() may trigger in the JIT memory
> manager
>
> This happens because the JIT
2008 Oct 15
0
[LLVMdev] bug in the JIT global variable emitter
...vm_jit_global_emitter2.txt
Sorry, I am still not able to understand the problem. Is there a bug
in the default memory manager? From your patch it seems like there is
a real bug. What is the assertion that you ran into?
>
>
> The problem only happens when calling
> ExecutionEngine::getPointerToGlobal(someGV) from some non-llvm
> program. If
> the function is called when JITing a function, it works, since it
> will dump
> the global variable to the memory reserved to the function being
> JITed,
> which raises a question: shouldn't it generate the GV to some non-
>...