search for: clonefunctioninto

Displaying 20 results from an estimated 65 matches for "clonefunctioninto".

2012 May 15
1
[LLVMdev] CloneFunctionInto() overwrites alignment attribute
Hi everybody, I am trying to clone a function body into an existing declaration. That declaration has the same number of parameters but they differ in type and alignment. Fortunately, it does not care about the type. Unfortunately, CloneFunctionInto() copies the attributes from the old function to the new one unconditionally, overwriting the alignment attribute. Also, the Attribute interface does not allow me to change the alignment of a parameter afterwards ("Attempt to change alignment!" assertion). Removing the attribute and s...
2013 May 29
2
[LLVMdev] CloneFunctionInto() Error
Dear All, I need your help urgently I have to copy the CFG of each function using CloneFunction or CloneFunctionInto. After I made the copy function. Print the basic blocks then get this error : While deleting: i32 % Use still stuck around after Def is destroyed: %mul2_ = mul nsw i32 %6, 3 Use still stuck around after Def is destroyed: store i32 3, i32* %x_, align 4 opt: Value.cpp:75: virtual llvm::Value::~Val...
2013 May 29
0
[LLVMdev] CloneFunctionInto() Error
...ng the function in another with new pointer to another address. Please I need answer urgent Thanks On 29 May 2013 10:14, Rasha Omar <rasha.sala7 at gmail.com> wrote: > Dear All, > > I need your help urgently > I have to copy the CFG of each function using CloneFunction or > CloneFunctionInto. > After I made the copy function. Print the basic blocks then get this error > : > > While deleting: i32 % > Use still stuck around after Def is destroyed: %mul2_ = mul nsw i32 %6, 3 > Use still stuck around after Def is destroyed: store i32 3, i32* %x_, > align 4 > opt:...
2013 May 15
2
[LLVMdev] Attributes & CloneFunctionInto
Hi, I am again struggling to find my way around the Attribute classes. What I want to do is clone a function into a declaration where some parameters may have a different alignment. CloneFunctionInto in debug mode hits an assertion which is marked with a FIXME (Attributes.cpp:673). I would be totally fine with any kind of workaround, e.g. removing all attributes from the target declaration, then cloning, and then setting the correct attributes. However, I can't find a way to modify an ex...
2017 Jun 15
3
CloneFunctionInto produces invalid debug info
...> Sergei > > From: llvm-dev [mailto:llvm-dev-bounces at lists.llvm.org] On Behalf Of Keno Fischer via llvm-dev > Sent: Thursday, June 15, 2017 1:25 PM > To: Adrian Prantl <aprantl at apple.com> > Cc: llvm-dev <llvm-dev at lists.llvm.org> > Subject: Re: [llvm-dev] CloneFunctionInto produces invalid debug info > > This all looks very similar to a bug in the cloning stuff I fixed recently, so would be indeed good to know if this is still happening on master. > > On Thu, Jun 15, 2017 at 2:23 PM, Adrian Prantl via llvm-dev <llvm-dev at lists.llvm.org <mailto...
2017 Jun 15
4
CloneFunctionInto produces invalid debug info
...truct/class) and adds a parameter. First, we create a new function with a new function type, which includes the newly added parameter: Function *NF = Function::Create(NewFTy, F.getLinkage(), F.getName() + "Cloned", F.getParent()); and after setting up the ValueToValueMapTy, we use the CloneFunctionInto method to clone the function body CloneFunctionInto(NF, &F, Map, true, Returns, "Cloned"); The code seems to work as intended, but when we try to emit debug symbols (clang -g flag) the pass fails with following message: "All DICompileUnits must be listed in llvm.dbg.cu"...
2013 May 15
0
[LLVMdev] Attributes & CloneFunctionInto
On 5/15/13 10:27 AM, Ralf Karrenberg wrote: > Hi, > > I am again struggling to find my way around the Attribute classes. > What I want to do is clone a function into a declaration where some > parameters may have a different alignment. > CloneFunctionInto in debug mode hits an assertion which is marked with > a FIXME (Attributes.cpp:673). > I would be totally fine with any kind of workaround, e.g. removing all > attributes from the target declaration, then cloning, and then setting > the correct attributes. > However, I can't f...
2013 May 15
1
[LLVMdev] Attributes & CloneFunctionInto
...riswell wrote: > On 5/15/13 10:27 AM, Ralf Karrenberg wrote: >> Hi, >> >> I am again struggling to find my way around the Attribute classes. >> What I want to do is clone a function into a declaration where some >> parameters may have a different alignment. >> CloneFunctionInto in debug mode hits an assertion which is marked with >> a FIXME (Attributes.cpp:673). >> I would be totally fine with any kind of workaround, e.g. removing all >> attributes from the target declaration, then cloning, and then setting >> the correct attributes. >> Howev...
2017 Jun 16
2
CloneFunctionInto produces invalid debug info
...ode, I can try to help diagnose why the CU gets cloned... just send me a patch that applies to trunk and instructions. -- adrian > On Jun 16, 2017, at 1:54 PM, Sergei Larin <slarin at codeaurora.org> wrote: > > Sorry… It takes a pass that was not accepted for upstreaming…. It uses CloneFunctionInto with module level flag on. In the input IR there is a strangely formed (but correct) debug info MD that causes duplication of existing DICompileUnit during cloning, but llvm.dbg.cu is not updated. I got around by a quick cleanup pass that detects the situation and simply adds them in… Something lik...
2014 Oct 02
2
[LLVMdev] Use list preservation when using Instruction::clone
I'm trying to create a clone of a function using Function::Create() and CloneFunctionInto. However, I'm running into an issue. I believe that the instructions in the function clone still have Use edges to values in the original function. This is a problem for my purposes. For example, consider an original function F. I create a new function G belonging to the same module and...
2017 Jun 15
2
CloneFunctionInto produces invalid debug info
...gt; First, we create a new function with a new function type, which includes > the newly added parameter: > > Function *NF = Function::Create(NewFTy, F.getLinkage(), F.getName() + > "Cloned", F.getParent()); > > > and after setting up the ValueToValueMapTy, we use the CloneFunctionInto > method to clone the function body > > CloneFunctionInto(NF, &F, Map, true, Returns, "Cloned"); > > > The code seems to work as intended, but when we try to emit debug symbols > (clang -g flag) the pass fails with following message: > > "All DICompileU...
2017 Jun 19
2
CloneFunctionInto produces invalid debug info
...ned... just send me a patch that applies to trunk and instructions. >> >> -- adrian >> >>> On Jun 16, 2017, at 1:54 PM, Sergei Larin <slarin at codeaurora.org> wrote: >>> >>> Sorry… It takes a pass that was not accepted for upstreaming…. It uses CloneFunctionInto with module level flag on. In the input IR there is a strangely formed (but correct) debug info MD that causes duplication of existing DICompileUnit during cloning, but llvm.dbg.cu is not updated. I got around by a quick cleanup pass that detects the situation and simply adds them in… Something lik...
2013 Jan 16
0
[LLVMdev] CloneFunctionInto/MapValue, problem when VMap changes type
Hello All, I am having a problem with using CloneFunctionInto to clone a function that includes changing the type of a value using the VMap. Specifically, I am using the VMap to change the address space of values that have particular pointer types. The problem seems to be that RemapInstruction successfully changes the operands using the VMap, but the VTy mem...
2016 Jul 15
2
clone function
...ng a > different version of LLVM?). > Also, the API takes a function and returns another one. I’m not sure what > you expect by first declaring another function with its arguments: it won’t > be magically picked as a “destination” for the clone. > Yup sorry, just that I tried to use CloneFunctionInto first which takes both the function to clone and the other. I just read the code this morning and CloneFunction is not doing what I want, it deletes arguments passed though the VMap. I just thought quickly that as there where only 3 arguments it would be easier for someone to explain... The one I...
2017 Jun 20
2
CloneFunctionInto produces invalid debug info
...sage----- > From: aprantl at apple.com [mailto:aprantl at apple.com] > Sent: Monday, June 19, 2017 5:00 PM > To: Sergei Larin <slarin at codeaurora.org> > Cc: llvm-dev <llvm-dev at lists.llvm.org>; Keno Fischer <keno at juliacomputing.com> > Subject: Re: [llvm-dev] CloneFunctionInto produces invalid debug info > > - old Keno > +current Keno >> On Jun 19, 2017, at 2:59 PM, Adrian Prantl <aprantl at apple.com> wrote: >> >> In your example the instructions in the cloned function have debug locations belonging to a different function, and the fun...
2018 Sep 06
2
Replacing a function from one module into another one
...unction *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::ReturnInst*, 8> Returns; llvm::CloneFunctionInto(fOld, fNew, VMap, ModuleArg, Returns); if (fNew->hasPersonalityFn()) fOld->setPersonalityFn(llvm::MapValue(fNew->getPersonalityFn(), VMap)); But after running the code, I still get the error: *Use still stuck around after Def is destroyed* Which means that the instructions moved from...
2018 Sep 06
2
Replacing a function from one module into another one
...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::ReturnInst*, 8> Returns; llvm::CloneFunctionInto(fOld, fNew, VMap, ModuleArg, Returns); if (fNew->hasPersonalityFn()) fOld->setPersonalityFn(llvm::MapValue(fNew->getPersonalityFn(), VMap)); } void replaceFunctions(std::string oldFuncName, std::string newFuncName) { llvm::SMDiagnostic origErr; llvm::LLVMContext origContext;...
2008 Jul 11
0
[LLVMdev] Cloning Functions
...e 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 in the pristine function clones (they were changed to External by deleteBody). 8. Delete all the pristine Function clones, they are now cloned into the clon...
2018 Sep 04
2
Replacing a function from one module into another one
...hat I need is just the attribute of the function in the *i *position. I'm really thankful for the quick responses and for the attention received. Regards, Daniel Moya El lun., 3 de sep. de 2018 a la(s) 18:42, Philip Pfaffe ( philip.pfaffe at gmail.com) escribió: > Hi Daniel, > > CloneFunctionInto wants to tell you about the new ReturnInstructions it > produced, you're expected to pass a vector for this purpose. You're free to > ignore these values, though, but you still have to pass that > vector: SmallVector<ReturnInst*, 8> Returns; > > For the argument remapp...
2008 Jul 09
2
[LLVMdev] Cloning Functions
On Wednesday 09 July 2008 13:24, Devang Patel wrote: > Is it possible to explain intended use of original unoptimized version ? bugpoint. I want to run it on the IR produced by our frontend. This will help us generate new LLVM tests we can send upstream. We've fixed bugs that aren't caught by the upstream tests and it would be nice to capture the problem and make the test