search for: removefrompar

Displaying 20 results from an estimated 28 matches for "removefrompar".

2013 Aug 20
1
[LLVMdev] Question about removeFromParent
I have Function Function* F; and one of its basic blocks BB I want to insert this BB into a new function without remove it from the original according that BList is the list of the basic blocks of the newFunction BList.insert(BB); but I don't want to call BB->removeFromParent(); and without this method it give me error that BB is already in a container is there another function that get copy without deleting? Thank you in advance -- * Rasha Salah Omar Msc Student at E-JUST Demonestrator at Faculty of Computers and Informatics Benha University*...
2013 Aug 20
1
[LLVMdev] Question about removeFromParent
Hi Rasha, > The problem for cloning that when some change done for the original bb or > the cloned bb it's reflected to the other. This doesn't make sense. Originally you wanted to add the same basic-block to multiple functions, which would have been even worse for separating the two. Cheers. Tim
2013 Jan 21
2
[LLVMdev] Troubleshooting Internal Garbage Collection
...it had to do with how I was removing the pseudo instruction in my overridden expandPostRAPseudo() implementation. // member function's signature bool TheInstrInfo::expandPostRAPseudo(MachineBasicBlock::iterator p_mi) // works bb.erase(p_mi); // produces the assertion / memory leak. p_mi->removeFromParent(); I should have looked more closely at the targets that implemented expandPostRAPseudo() and saw how they got rid of the pseudo instruction. In particular, the successful line was lifted from bool Mips16InstrInfo::expandPostRAPseudo(...). Some targets don't eliminate the pseudo, but rather...
2013 Jan 21
0
[LLVMdev] Troubleshooting Internal Garbage Collection
removeFromParent just unlinks it from the basic block and returns the removed instruction. It does not delete it. On Sun, Jan 20, 2013 at 9:54 PM, David Waggoner <mathonnapkins at gmail.com>wrote: > > Thanks for the suggestion, Duncan. > > I recently figured out that it had to do with how I w...
2011 Feb 26
1
[LLVMdev] Removing Instructions
I try to write a pass that clones a function and then removes some instruction from the clone, the clone is then added to the module (the parent of the source function). I call removeFromParent() on the appropriate instruction and it is actually removed (I see it in module's dump). However I get a failed assertion at Module Verifier which says: --- Instruction referencing instruction not embedded in a basic block! <existing instruction> <removed instruction> --- The pro...
2014 Nov 05
3
[LLVMdev] How to lower the intrinsic function 'llvm.objectsize'?
...lt;> builder(ii->getParent(), ii); Value *op1 = ii->getArgOperand(0); //i8* uint64_t bit_size = op1->getType()->getPointerElementType()->getPrimitiveSizeInBits(); Value *result = ConstantInt::get(ii->getType(), bit_size); ii->replaceAllUsesWith(result); ii->removeFromParent(); delete ii; break; } } } I'm new to LLVM and not sure whether the implementation is correct. Can anybody tell me whether the implementation is correct? Thanks in advance. -- Dingbao Xie -------------- next part -------------- An HTML attachment was scrubbed... URL: <http:/...
2018 Feb 24
2
CallSiteSplitting and musttail calls
...has failed due to my poor understanding of llvm internals. Here is the attempted patch: https://gist.github.com/indutny/240c33522563ebd633613a903479d5e6 I'd greatly appreciate any help with it. Just in case, there're few questions that I'm trying to find answers for: * Why replacing `removeFromParent()` with `eraseFromParent` breaks the code? * How to properly remove predecessors from the resulting Tail block? * How to remove the Tail block itself when we're done? Thank you, Fedor. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/...
2015 Feb 11
2
[LLVMdev] deleting or replacing a MachineInst
...aces the new instruction just before the old instruction in the assembly output. So far so good. Now I have to remove the old instruction. But everything I try crashes LLVM, either immediately or eventually. Various incantations which haven't worked. MBB->remove_instr(OldMI); OldMI->removeFromParent(); MBB.erase(OldMI); I should add that there are flags // %EFLAGS<imp-def> is getting copied automatically // %RDX<imp-use,kill> is not getting copied (when it appears) So, any advice to peephole adding/deleting or just replacing MachineInst's ? I've looked...
2018 Aug 27
3
Replacing a function from one module into another one
..." as the llvm::BasicBlock or llvm::Instruction do, so I figured I would just move the BasicBlocks of the replacing function into the function that was being replaced, and then eliminate the original BasicBlocks. So far I had only one issue while eliminating the original BasicBlocks, I can only removeFromParent but not eraseFromParent, but the first function works fine anyways. For example, the original function is: define i32 @foo2(i32 %a, i32 %b) #0 { entry: %a.addr = alloca i32, align 4 %b.addr = alloca i32, align 4 store i32 %a, i32* %a.addr, align 4 store i32 %b, i32* %b.addr, align 4 An...
2018 Feb 24
0
CallSiteSplitting and musttail calls
...g of > llvm internals. Here is the attempted patch: https://gist.github. > com/indutny/240c33522563ebd633613a903479d5e6 > > I'd greatly appreciate any help with it. > > Just in case, there're few questions that I'm trying to find answers for: > > * Why replacing `removeFromParent()` with `eraseFromParent` breaks the > code? > * How to properly remove predecessors from the resulting Tail block? > * How to remove the Tail block itself when we're done? > > Thank you, > Fedor. > -------------- next part -------------- An HTML attachment was scrubbed....
2013 Jan 14
0
[LLVMdev] Troubleshooting Internal Garbage Collection
Hi David, > Previously, I had been testing with only one routine per test .ll file, but I > thought I'd reached a point where I could test multiple operations at once and > understand the output. The odd part about this is that the likelihood of seeing > the above assertion scales with the number of functions in the .ll file. If I > have one or two functions, I never see it.
2015 Feb 11
2
[LLVMdev] deleting or replacing a MachineInst
...NewMI = BUILD_INS(BT32ri8, EAX, imm); break; // ... } } break; } // NewMI has been inserted before OldMI if (NewMI != NULL) { // MBB->remove_instr(OldMI); // I've tried these (and others) // OldMI->removeFromParent(); // MBB.erase(OldMI); NumX86Peepholes++; } } -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150211/ffb87e4c/attachment.html>
2014 Nov 05
3
[LLVMdev] How to lower the intrinsic function 'llvm.objectsize'?
...Size to for. > In general when looking at type sizes you don't want to use > getPrimitiveSizeInBits, and should use the DataLayout for various reasons. > > > Value *result = ConstantInt::get(ii->getType(), bit_size); > ii->replaceAllUsesWith(result); > ii->removeFromParent(); > delete ii; > > You shouldn't use delete here. You probably want ii->eraseFromParent(). > > > break; > } > } > } > > I'm new to LLVM and not sure whether the implementation is correct. Can > anybody tell me whether the implementation...
2013 Jan 14
2
[LLVMdev] Troubleshooting Internal Garbage Collection
Hello, I've made some fair progress on a target for 6502 family CPUs recently, but I've run into an error I'm not sure how to address. I've ruminated over it for about a week now, trying various things and not having any success. It seems to scale with the number of routines in my .ll file, which I am trying to run through llc. I get the following stack dump from an assertion:
2009 May 08
0
[LLVMdev] Splitting a basic block, replacing it's terminator
On May 8, 2009, at 4:02 PM, Nick Johnson wrote: > I want to insert a conditional branch in the middle of a basic block. > To that end, I am doing these steps: > > (1) Split the basic block: > bb->splitBasicBlock() > > (2) Remove the old terminator: > succ->removePredecessor(bb) > bb->getTerminator()->getParent() Assuming that the new block will still be a
2010 Jul 22
0
[LLVMdev] Assert in llvm-2.7
...etParent()->getParent(); assert(unreachables.find(callerFunc) != unreachables.end()); } func->replaceAllUsesWith(UndefValue::get(func->getType())); //checkValueHandles(func); #ifdef LLVM_VER_2_6 func->eraseFromParent(); #else func->removeFromParent(); #endif } --------------------------------------------------------------------------------------------------------------------------------------------------- We are unable to figure out why we see this. Any pointers would be great. Aparna Graduate Student , ECE University of Maryla...
2016 Oct 26
0
How does one reduce a function CFG to its entry block?
...G to its entry block. I wrote the following code using lib/IR/Function.cpp/Function::dropAllReferences() (from llvm-3.6) as reference:  Function *F; // Suitably initialized. BasicBlock *FEntryBlock = &F->getEntryBlock(); FEntryBlock->getTerminator()->eraseFromParent(); FEntryBlock->removeFromParent(); for (Function::iterator I = F->begin(), E = F->end(); I != E; ++I)    I->dropAllReferences(); while (!F->getBasicBlockList().empty())   F->getBasicBlockList().begin()->eraseFromParent(); FEntryBlock->insertInto(F); // ...subsequent provision of a terminator, etc.    This...
2007 Dec 04
2
[LLVMdev] Memory allocation (or deallocation) model?
On Mon, 2007-12-03 at 18:56 -0800, Chris Lattner wrote: > Other IR objects (like instructions) have very simple ownership. An > instruction is owned by its basic block, a bb is owned by the function, a > function is owned by thet module. If an instruction is initially allocated with its Instruction *insertAtEnd parameter defaulted to null, and then later appended to a BasicBlock,
2009 May 08
2
[LLVMdev] Splitting a basic block, replacing it's terminator
Hi, I want to insert a conditional branch in the middle of a basic block. To that end, I am doing these steps: (1) Split the basic block: bb->splitBasicBlock() (2) Remove the old terminator: succ->removePredecessor(bb) bb->getTerminator()->getParent() (3) Adding a new terminator: BranchInst::Create(ifTrue, ifFalse, cnd, "", bb); That seems to work, but later passes
2018 Feb 27
2
CallSiteSplitting and musttail calls
...re is the attempted patch: https://gist.github.com >> /indutny/240c33522563ebd633613a903479d5e6 >> >> I'd greatly appreciate any help with it. >> >> Just in case, there're few questions that I'm trying to find answers for: >> >> * Why replacing `removeFromParent()` with `eraseFromParent` breaks the >> code? >> * How to properly remove predecessors from the resulting Tail block? >> * How to remove the Tail block itself when we're done? >> >> Thank you, >> Fedor. >> > > > _____________________________...