Displaying 20 results from an estimated 30 matches for "updateglobalmapping".
2013 Apr 04
0
[LLVMdev] ExecutionEngine::updateGlobalMapping
Hello,
I am using updateGlobalMapping to inform the JIT engine the address of some C helpers. Due to the nature of the analysis pass, there can be several calls to updateGlobalMapping with the same GlobalValue key and the same (or sometimes different) address.
My problem is when the reverse mapping is enabled, the following fragment:...
2012 May 23
0
[LLVMdev] lli unable to resolve symbol _ZNKSt3__16locale9use_facetERNS0_2idE in bitcode
..._dso_handle if it's
declared in the module.
You could module tools/lli/lli.cpp to add a global:
char *dummy_dso_handle = 0;
and tie it to __dso_handle via.
if (GlobalVariable *DSO = Mod->getGlobalVariable("__dso_handle"))
if (!DSO->hasInitializer())
EE->updateGlobalMapping(DSO, &dummy_dso_handle);
somewhere in main(), say after disabling lazy compilation. Entirely
untested though; we might need to give dummy_dso_handle a real value.
Nick
> tia
>
> On 5/21/2012 2:46 PM, Ashok Nalkund wrote:
>> On 5/21/2012 11:15 AM, Nick Lewycky wrote:
>>&...
2012 Dec 05
0
[LLVMdev] how to get and modify a global variable inside a module
...ant 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
done before JITting any function which uses the GlobalValue. Otherwise
you have to call recompileAndRelinkFunction for each function that uses
the GlobalValue.
Cheers,
Clemens
2012 Dec 10
2
[LLVMdev] how to get and modify a local variable's value through executionEngine?
hello guys,
recently, i successfully get and modify global variable by execution engine.
the functions i used are listed here:
int m=1;
EE->updateGlobalMapping(p->M->getGlobalVariable("x",true),&m);
EE->recompileAndRelinkFunction(EntryFn);
x is the global variable in the module.
but how to modify the local variable in the module?
--
View this message in context: http://llvm.1065342.n5.nabble.com/how-to-get-and-modify-a-local-var...
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
2004 Dec 14
0
[LLVMdev] misc. patches
...clearAllGlobalMappings - Clear all global mappings and start over again
> + /// use in dynamic compilation scenarios when you want to move globals
> + void clearAllGlobalMappings() {
> + GlobalAddressMap.clear();
> + GlobalAddressReverseMap.clear();
> + }
> +
> /// updateGlobalMapping - Replace an existing mapping for GV with a new
> /// address. This updates both maps as required.
> void updateGlobalMapping(const GlobalValue *GV, void *Addr) {
>
> ______________________________________________________________________
> ____________________________________...
2004 Dec 13
6
[LLVMdev] misc. patches
Hi,
here are some minor patches that for various reasons I've not submitted
yet - I'm just trying to clear my list of differences before christmas...
First of all the clear.patch file contains a patch that enables the JIT
to drop all global mappings. I need this because when I have N threads I
compile N different versions of my functions using different memory
areas for global
2012 May 23
1
[LLVMdev] lli unable to resolve symbol _ZNKSt3__16locale9use_facetERNS0_2idE in bitcode
...gt;
> You could module tools/lli/lli.cpp to add a global:
>
> char *dummy_dso_handle = 0;
>
> and tie it to __dso_handle via.
>
> if (GlobalVariable *DSO = Mod->getGlobalVariable("__dso_handle"))
> if (!DSO->hasInitializer())
> EE->updateGlobalMapping(DSO,&dummy_dso_handle);
>
> somewhere in main(), say after disabling lazy compilation. Entirely
> untested though; we might need to give dummy_dso_handle a real value.
this is already done in JIT.cpp, search for HAVE___DSO_HANDLE. Probably
the interpreter and MCJIT just need to get t...
2012 May 22
5
[LLVMdev] lli unable to resolve symbol _ZNKSt3__16locale9use_facetERNS0_2idE in bitcode
Resending :(. Any pointers?
tia
On 5/21/2012 2:46 PM, Ashok Nalkund wrote:
> On 5/21/2012 11:15 AM, Nick Lewycky wrote:
>> Ashok Nalkund wrote:
>>> Resending, any pointers? I demangled the symbol and it turns out to be:
>>> std::__1::locale::use_facet(std::__1::locale::id&) const
>>
>> My guess is that you've got a .bc file produced on a mac using
2009 Jul 03
0
[LLVMdev] Question about memory allocation in JIT
... if (MR.isGlobalValue()) {
> + void* ResultPtr = TheJIT->getPointerToGlobalIfAvailable(MR.getGlobalValue());
> + if (BufferBegin <= ResultPtr && ResultPtr < BufferEnd) {
> + TheJIT->updateGlobalMapping(MR.getGlobalValue(), 0);
> + }
> + }
> + }
> + retryWithMoreMemory(F);
> + ConstPoolAddresses.clear();
> + return true;
> } else {
> // Now that we've succeeded in emitting the function, reset...
2012 Dec 10
0
[LLVMdev] how to get and modify a local variable's value through executionEngine?
Dong Chen <jameschennerd at gmail.com> writes:
> hello guys,
> recently, i successfully get and modify global variable by execution engine.
> the functions i used are listed here:
> int m=1;
> EE->updateGlobalMapping(p->M->getGlobalVariable("x",true),&m);
> EE->recompileAndRelinkFunction(EntryFn);
> x is the global variable in the module.
> but how to modify the local variable in the module?
A local variable does not exists until the function that defines it is
executed, so pre...
2013 Oct 24
0
[LLVMdev] LLVM use chains
>> You probably want replaceAllUsesWith.
>
> I am sorry I don't understand. Are you suggesting calling replaceAllUses of
> the .str1? What I really want to do is to 'erase' the function. By erasing
> I'd expect the uses of .str1 to 0 (because in the example I have it is used
> only by f()) and I see they are not.
To remove something, the normal idiom is
2013 Oct 24
2
[LLVMdev] LLVM use chains
On 10/24/13 2:13 AM, Rafael Espíndola wrote:
> On 23 October 2013 22:41, Vassil Vassilev <vvasilev at cern.ch> wrote:
>> Hi,
>> I have:
>> ...
>> @.str1 = private unnamed_addr constant [21 x i8] c"Now f is a
>> function\0A\00", align 1
>> ; Function Attrs: ssp uwtable
>> define i32 @_Z1fv() #2 {
>> entry:
>> %call =
2011 Jul 27
0
[LLVMdev] Lack of use of LLVMContextImpl::NamedStructTypes
On Jul 26, 2011, at 4:03 AM, Garrison Venn wrote:
>> Hi Garrison,
>>
>> Do the other two threads answer the question here?
>>
>> -Chris
>
> Yes I believe the other threads concerning the same issue answer why the system, because
> of the lack of type linkage, is lenient in "unioning" types. What I'm still uncomfortable with is, I
>
2010 Oct 09
0
[LLVMdev] LLVM ERROR: Program used external function 'printd' which could not be resolved!
Hi,
That seems really simple... just changing the function pointer. But how to
do it for the 'printd' function in the Kaleidoscope example?
An example how to do this would be super-great.
Any help will be much appreciated. Thanks!
On Sat, Oct 9, 2010 at 3:55 PM, OvermindDL1 <overminddl1 at gmail.com> wrote:
> 2010/10/9 António Saragga Seabra <antseabra at gmail.com>:
2010 Oct 09
2
[LLVMdev] LLVM ERROR: Program used external function 'printd' which could not be resolved!
2010/10/9 António Saragga Seabra <antseabra at gmail.com>:
> I'm on Windows using MinGW...
>
> 2010/10/9 OvermindDL1 <overminddl1 at gmail.com>
>>
>> 2010/10/5 António Saragga Seabra <antseabra at gmail.com>:
>> > Hi
>> >
>> > Thank you for your help! Followed your suggestion closely and changed
>> > the
>> >
2011 Jul 26
2
[LLVMdev] Lack of use of LLVMContextImpl::NamedStructTypes
Thanks for the response Chris,
On Jul 26, 2011, at 0:44, Chris Lattner wrote:
>
> On Jul 25, 2011, at 10:50 AM, Garrison Venn wrote:
>
>> Several people on this list have reported issues with the linker regarding a
>> named StructType instance with the same name in two different modules
>> being resolved into two StructTypes with different names due to StructType::
2009 Jul 01
3
[LLVMdev] Question about memory allocation in JIT
Hello! Working with LLVM JIT-compiler I found a small bug and I'd like to correct it. Namely, on some tests LLVM fails with message "JIT: Ran out of space for generated machine code!"
This error emerges because the test creates big static array. Global variables are placed into memory block for function, that is first seen using given variable. Besides, during memory allocation
2008 Mar 30
3
[LLVMdev] Being able to know the jitted code-size before emitting
Hi everyone,
vmkit requires to know the size of a jitted method before emitting the
method. This allows to allocate the correct size for the method. The
attached patch creates this functionality when the flag SizedMemoryCode
is on.
In order to implement this functionality, i had to virtualize some
MachineCodeEmitter functions.
Is it OK to commit the patch?
Thanks,
Nicolas
--------------
2008 Apr 01
2
[LLVMdev] Being able to know the jitted code-size before emitting
...tPool());
>> + initJumpTableInfo(F.getJumpTableInfo());
>> +
>> + // About to start emitting the machine code for the function.
>> + emitAlignment(std::max(F.getFunction()->getAlignment(), 8U));
>> +
>> + }
>> +
>> +
>> TheJIT->updateGlobalMapping(F.getFunction(), CurBufferPtr);
>>
>> MBBLocations.clear();
>> @@ -579,12 +614,18 @@
>> DOUT << "Disassembled code:\n"
>> << sys::disassembleBuffer(FnStart, FnEnd-FnStart,
>> (uintptr_t)FnStart);
>> #endif
>> +
&...