Displaying 20 results from an estimated 48 matches for "clonemodul".
Did you mean:
clonemodule
2006 May 16
1
[LLVMdev] CloneModule ValueMap
After cloning a Module with CloneModule, there doesn't seem to be any
easy way to convert a Value pointing into the old Module to a Value
pointing into the new one.
The CloneModule implementation already has to keep such a mapping
internally, so I've written a patch that exposes it as a second inout
parameter to CloneModule(),...
2016 Jan 26
2
Handling of metadata in llvm::CloneModule
Sorry if this has been discussed already...
I am trying to understand whether there is an underlying reason why llvm::CloneModule takes argument function ShouldCloneDefinition to discriminate on objects being cloned, but blindly copies all named metadata...?
In my case this results in debug nodes that are creating uses/relocations for global objects that were _not_ copied per ShouldCloneDefinition...
Before I jump head on...
2011 Aug 13
1
[LLVMdev] patch: CloneModule resets GlobalVariable address space
Hi,
I found the following bug in llvm::CloneModule (svn, head revision).
When copying over global variables the address space is reset to
default. The patch changes that behavior by using the other
GlobalVariable constructor that explicitely includes that information.
Regards,
Simon
-------------- next part --------------
A non-text attachment wa...
2018 Mar 27
2
IRMover asserts "mapping to a source type" when repeatedly linking - usage or LLVM bug?
....
>
> When exactly does "mapping to a source type" fire?
> - When cloning?
> - When linking the clone into another module?
> If the latter, which module did you link the cloned "a" into?
It fires when linking the clone. I'm trying to:
1) IRMover(main1).move(CloneModule(a), list-of-globals1)
2) IRMover(main1).move(CloneModule(b), list-of-globals2)
3) IRMover(main2).move(CloneModule(a), list-of-globals1)
4) IRMover(main2).move(CloneModule(b), list-of-globals2)
The assert fires in 3). The reason is that an opaque type in a (which is
the same as the type in CloneMo...
2010 Jul 20
3
[LLVMdev] gold and debug information
...the error.
>>
>> The error only happens if the CFLAGS has -g in it.
>
> Can you reduce the testcase a bit? It would be a lot easier to
> reproduce with the ld invocation and the .o files given to it.
This (Unknown constant! in bitcode writer when -g is used) is a known
bug in CloneModule, because it is not cloning MDNodes appropriately.
So bug point is likely to run into this while reducing test case.
I do not know whether gold is cloning module at -O4 or not.
-
Devang
2018 Mar 26
0
IRMover asserts "mapping to a source type" when repeatedly linking - usage or LLVM bug?
...rent code uses a single LLVMContext & Orc to generate the
> code. That largely workes well. But inlining presents a bit of a
> problem.
>
> (end of setup)
>
> I've tried two approaches to inlining:
>
> In the first I'm, lazily, caching the source modules, and CloneModule()
> them before handing them to IRMover to inline necessary function into
> the target module. That works well in release builds, but occasionally
> triggers an assert in debug mode ("mapping to a source type"). More on
> the assert later.
>
> The second approach is t...
2018 Mar 23
2
IRMover asserts "mapping to a source type" when repeatedly linking - usage or LLVM bug?
...code
pre-generated using clang.
The current code uses a single LLVMContext & Orc to generate the
code. That largely workes well. But inlining presents a bit of a
problem.
(end of setup)
I've tried two approaches to inlining:
In the first I'm, lazily, caching the source modules, and CloneModule()
them before handing them to IRMover to inline necessary function into
the target module. That works well in release builds, but occasionally
triggers an assert in debug mode ("mapping to a source type"). More on
the assert later.
The second approach is to *not* cache modules but re-r...
2011 Jul 15
2
[LLVMdev] Makefile Question
I thought it would, but it seems to be missing the CloneModule symbol (which
isn't called from anywhere in the LLVM codebase).
On Fri, Jul 15, 2011 at 7:43 AM, John Criswell <criswell at illinois.edu>wrote:
> On 7/14/11 7:36 PM, Gregory Malecha wrote:
>
> Hello,
>
> I have a question about how to set up a Makefile that generate a ....
2018 Mar 27
0
IRMover asserts "mapping to a source type" when repeatedly linking - usage or LLVM bug?
...quot;mapping to a source type" fire?
>> - When cloning?
>> - When linking the clone into another module?
>> If the latter, which module did you link the cloned "a" into?
>
> It fires when linking the clone. I'm trying to:
>
> 1) IRMover(main1).move(CloneModule(a), list-of-globals1)
> 2) IRMover(main1).move(CloneModule(b), list-of-globals2)
> 3) IRMover(main2).move(CloneModule(a), list-of-globals1)
> 4) IRMover(main2).move(CloneModule(b), list-of-globals2)
(Ah... now I'm following your example.)
> The assert fires in 3). The reason is t...
2010 Jul 22
2
[LLVMdev] gold and debug information
On Wed, Jul 21, 2010 at 9:50 AM, Jeffrey Yasskin <jyasskin at google.com> wrote:
>> This (Unknown constant! in bitcode writer when -g is used) is a known
>> bug in CloneModule, because it is not cloning MDNodes appropriately.
>
> What's the link to the bug report? Are you fixing it?
PR 7689. Fixed in r109117.
-
Devang
2011 Jul 15
0
[LLVMdev] Makefile Question
Hi Gregory,
I had a similar problem a while back, see:
http://lists.cs.uiuc.edu/pipermail/llvmdev/2010-June/032508.html for
my solution to this problem.
Basically I ended up linking in the *.o files needed to get exactly
what I needed (in your case, the file defining CloneModule and
whatever else you need), without pulling in too much (causing
duplicate symbol issues with opt).
Hopefully this helps, and good luck!
~Will
On Fri, Jul 15, 2011 at 10:56 AM, Gregory Malecha
<gmalecha at eecs.harvard.edu> wrote:
> I thought it would, but it seems to be missing the C...
2018 Sep 06
2
Replacing a function from one module into another one
...on *fOld,
llvm::Function *fNew) {
llvm::Function::arg_iterator DestI = fOld->arg_begin();
for (llvm::Function::const_arg_iterator J = fNew->arg_begin(); J !=
fNew->arg_end();
++J) {
DestI->setName(J->getName());
VMap[&*J] = &*DestI++;
}
}
The same as in *CloneModule*, then I have this code:
llvm::Function *fNew = nMod->getFunction(nFName);
llvm::Function *fOld = oMod->getFunction(oFName);
fOld->dropAllReferences();
fOld->deleteBody();
llvm::ValueToValueMapTy VMap;
populateVMap(VMap, fOld, fNew);
bool ModuleArg = true;
llvm::SmallVector<llvm:...
2010 Jul 21
0
[LLVMdev] gold and debug information
...gt; The error only happens if the CFLAGS has -g in it.
>>
>> Can you reduce the testcase a bit? It would be a lot easier to
>> reproduce with the ld invocation and the .o files given to it.
>
> This (Unknown constant! in bitcode writer when -g is used) is a known
> bug in CloneModule, because it is not cloning MDNodes appropriately.
What's the link to the bug report? Are you fixing it?
> So bug point is likely to run into this while reducing test case.
>
> I do not know whether gold is cloning module at -O4 or not.
> -
> Devang
> _______________________...
2010 Jul 22
0
[LLVMdev] gold and debug information
On Thu, Jul 22, 2010 at 11:35 AM, Devang Patel <devang.patel at gmail.com>wrote:
> On Wed, Jul 21, 2010 at 9:50 AM, Jeffrey Yasskin <jyasskin at google.com>
> wrote:
> >> This (Unknown constant! in bitcode writer when -g is used) is a known
> >> bug in CloneModule, because it is not cloning MDNodes appropriately.
> >
> > What's the link to the bug report? Are you fixing it?
>
> PR 7689. Fixed in r109117.
>
I still run into the same error with this. Can someone else also try this
patch?
Thanks,
Guoliang
-------------- next part ---...
2010 Jul 22
1
[LLVMdev] gold and debug information
...l 22, 2010 at 11:35 AM, Devang Patel <devang.patel at gmail.com>wrote:
>
>> On Wed, Jul 21, 2010 at 9:50 AM, Jeffrey Yasskin <jyasskin at google.com>
>> wrote:
>> >> This (Unknown constant! in bitcode writer when -g is used) is a known
>> >> bug in CloneModule, because it is not cloning MDNodes appropriately.
>> >
>> > What's the link to the bug report? Are you fixing it?
>>
>> PR 7689. Fixed in r109117.
>>
>
> I still run into the same error with this. Can someone else also try this
> patch?
>
Saw Ra...
2018 Sep 06
2
Replacing a function from one module into another one
...t;arg_begin();
>> for (llvm::Function::const_arg_iterator J = fNew->arg_begin(); J !=
>> fNew->arg_end();
>> ++J) {
>> DestI->setName(J->getName());
>> VMap[&*J] = &*DestI++;
>> }
>> }
>>
>> The same as in *CloneModule*, then I have this code:
>>
>> llvm::Function *fNew = nMod->getFunction(nFName);
>> llvm::Function *fOld = oMod->getFunction(oFName);
>>
>> fOld->dropAllReferences();
>> fOld->deleteBody();
>>
>> llvm::ValueToValueMapTy VMap;
>> pop...
2010 Nov 09
0
[LLVMdev] Calling PassManager on previously JITed Modules
...would appear to answer my question. Could someone confirm for me
if it's definitely unsafe to attempt to optimise/JIT any Modules while
a different thread is currently executing a JITed function which has
been generated from them? Or am I just missing something here?
I've tried using llvm::CloneModule() to copy the Module and then work
on that instead to JIT a new function, but it seems that doesn't
always work, or even the cloning process itself causes an assertion to
be raised.
Thanks in advance for any replies,
Stephen
On 8 November 2010 21:22, Stephen Kyle <stephenckyle at googlema...
2008 Jul 11
0
[LLVMdev] Cloning Functions
...e the ValueMaps from the Module clone and all the pristine function
ValueMaps so that if V->V' in the Module map and V->V'' in the pristine
function map, make V''->V' in the Module map.
4. Fix up arguments to the pristine functions _a_la_ what is done in
CloneModule.
5. Delete the function bodies of all functions in the cloned Module (these are
the optimized bodies) by calling deleteBody on them.
6. Call CloneFunctionInto to clone the pristine functions into the cloned
Module.
7. Fix up linkages (set function linkages in the Module to what they are...
2013 Nov 05
1
[LLVMdev] Thread-safe cloning
...e you are interested, here is the algorithm I'm using to copy a
Module to a same (or different) LLVMContext:
if (&context == &other.myContext)
{
// If the context is shared, we can use cloning
ValueToValueMapTy map;
myModule = CloneModule(other.myModule, map);
}
else
{
// Otherwise, round trip the module to a stream and then back
// into the new context. This approach allows for duplication
// and optimization to proceed in parallel for different
// mod...
2010 Nov 08
3
[LLVMdev] Calling PassManager on previously JITed Modules
Hi,
Has anyone had any success with running different PassManagers on
llvm::Modules they've already JITed and are executing?
In detail:
1) getting the IR, in form of an llvm::Module
2) calling PassManager->run() on the module
3) calling getFunction() and getPointerToFunction() to JIT the module
4) executing the JITed code using the function pointer received in step 3
and then what I