similar to: [LLVMdev] CloneBasicBlock doesn't change parent of cloned instructions

Displaying 20 results from an estimated 7000 matches similar to: "[LLVMdev] CloneBasicBlock doesn't change parent of cloned instructions"

2005 Jan 17
0
[LLVMdev] CloneBasicBlock doesn't change parent of cloned instructions
On Mon, 17 Jan 2005, Morten Ofstad wrote: > It seems the CloneBasicBlock function defined in Transforms/Utils/Cloning.h > doesn't change the parent BasicBlock of the contained instructions when it > has cloned them -- Is this a bug or a feature? I'm not sure I understand. This code: Instruction *NewInst = II->clone(); ..
2008 Apr 16
2
[LLVMdev] Problems in removing a cloned instruction.
Hi all, I am trying to write a pass where i am creating a clone of a function (the only difference being, the new function returns void , instead of any value). I am creating a new Function Type with a void return type (rest being the same as original function), and using this i am creating a new function body. Then, i clone the body of the old function into new function, but when ever i
2008 Apr 16
0
[LLVMdev] Problems in removing a cloned instruction.
Hi, I'm gonna try to give some feedback, but I have only been working with LLVM for a few days, so don't take what I'm saying without verifying :-) > BasicBlock *ProgSlicer::CloneBasicBlock(const BasicBlock *BB, > DenseMap<const Value*, Value*> &ValueMap, > const char *NameSuffix, Function *F) { > > BasicBlock
2005 Nov 22
3
[LLVMdev] Cloning BasicBlock
Hi , I am trying to clone a BasicBlock. I want both to co-exist and I have introduced a conditional branch to the original or the cloned BB. I tried mapping the original instruction and the clone as below : Instruction *NewInst = II->clone(); if (II->hasName()) NewInst->setName(II->getName()); NewBB->getInstList().push_back(NewInst); ValueMap[II] =
2005 May 11
3
[LLVMdev] Question About inserting Instruction?
Hi, I am working on a project with LLVM. What I need to do is to generate/insert some dummy/dead basic blocls which never have chance to be executed and put some instructions in those dummy/dead basic blocks. So far, the dummy/dead BB insertion is done. I am trying insert instructions in those dummy/dead BB. Actually, I can insert the legal instructions to dummy/dead BB, however, I really want
2005 Nov 22
0
[LLVMdev] Cloning BasicBlock
On Tue, 2005-11-22 at 09:12 -0800, Sandra Johnson wrote: > Hi , > I am trying to clone a BasicBlock. I want both to co-exist and I have > introduced > a conditional branch to the original or the cloned BB. I have a pass I haven't commited that does just this. Well, it does so to implement Arnold and Ryder style profiling. I can send you a copy of that if you want (I hope to
2005 Nov 23
1
[LLVMdev] Cloning BasicBlock
Hello Andrew , Yes , I have missed the phi node since my paths merge together. I'll try this out. I am implementing a timer based profiling scheme and hope your code will be useful for me. Please send me a copy of your code. Thanks Sandra Andrew Lenharth <andrewl at lenharth.org> wrote: On Tue, 2005-11-22 at 09:12 -0800, Sandra Johnson wrote: > Hi , > I am trying
2013 Jul 25
2
[LLVMdev] Error for AllocaInst and Instruction
Hi, For the following code const Type * Int32Type = IntegerType::getInt32Ty(getGlobalContext()); AllocaInst* newInst = new AllocaInst(Int32Type, 0, "flag", Bb); Bb->getInstList().push_back(newInst); It gives me the error " error: no matching constructor for initialization of 'llvm::AllocaInst' AllocaInst* newInst = new
2013 Jul 30
2
[LLVMdev] Instruction insertion By Module Pass
Hi, I need to insert new instruction into every basic block like x=1 or while loop I tried this code, but it doesn't work Type * Int32Type = IntegerType::getInt32Ty(getGlobalContext()); AllocaInst* newInst = new AllocaInst(Int32Type,"flag", Bb); Bb->getInstList().push_back(newInst); the error: void llvm::SymbolTableListTraits<llvm::Instruction,
2016 May 05
2
No remapping of clone instruction in CloneBasicBlock
Hi, Found CloneBasicBlock utility only does the cloning without any remapping. Consider below example: Input block: sw.epilog: ; preds = %sw.bb20, %sw.bb15, %sw.bb10, %sw.bb6, %sw.bb2, %sw.bb, %while.body, %if.end29 %no_final.1 = phi i32 [ %no_final.055, %while.body ], [ 1, %if.end29 ], [ %no_final.055, %sw.bb20 ], [ %no_final.055, %sw.bb15 ], [
2013 Jul 30
0
[LLVMdev] Instruction insertion By Module Pass
On 7/30/13 7:44 AM, Rasha Omar wrote: > Hi, > I need to insert new instruction into every basic block like x=1 > or while loop > I tried this code, but it doesn't work > > Type * Int32Type = IntegerType::getInt32Ty(getGlobalContext()); > AllocaInst* newInst = new AllocaInst(Int32Type,"flag", Bb); > Bb->getInstList().push_back(newInst); The problem is
2013 Mar 05
5
[LLVMdev] LLVM load instruction query
HI, I am creating a pass that will pass loaded value by load instruction to an external function. I don't know how to do it.Please Help.
2013 Jul 31
1
[LLVMdev] Instruction insertion By Module Pass
Thank you for your help I tried Instruction* p=&( Bb->front()); Type * Int32Type = IntegerType::getInt32Ty(getGlobalContext()); AllocaInst* newInst = new AllocaInst(Int32Type,"flag", p); that works well but I need to store the value of the variable too. What's the method that could be used to store specific value?? On 30 July 2013 16:01, John Criswell
2012 Jun 21
3
[LLVMdev] Cloning block for newbie
Hello everybody. I'm quite new to LLVM and I'm encontering problems with cloning basic blocks. My two basic blocks are in the same function and it doesn't really matter how the cloned one behave for the moment. Of course, to do so, I used the cloning.h 's method "CloneBasicBlock" but I have the "Instruction does not dominate all uses!" error. I know what it
2012 Jun 21
0
[LLVMdev] Cloning block for newbie
Please reply-all so that the thread is kept on llvmdev. The LLVM Programmer's Manual has examples of how to iterate over many common structures, such as instructions in a basic block[1]. Other than that, you can check the source code or doxygen[2]. Basically, you loop over the instructions as detailed in the programmer's manual[1], and loop over the operands using User's
2011 Apr 17
4
[LLVMdev] Regarding BasicBlock Cloning
The clone llvm:CloneBasicBlock copies the phi function in the replicated basic block from the original basic block. I don't want the copy of phi in relplicated block. For now I am creating .bc file with -O0 option so that it doesn't generate phi function in first place. Is this a good approach or there are some other function available for it. Tarun On Sun, Apr 17, 2011 at 5:22 AM, Eli
2008 Sep 02
0
[LLVMdev] CloneBasicBlock and Unnamed Temporaries
Hi, I was trying to use CloneBasicBlock() (in Cloning.h) to clone basic blocks in one of my transform passes. For example, when I have a basic block like: bb1: ; preds = %bb load i32* %i, align 4 ; <i32>:11 [#uses=2] load i32* %n_addr, align 4 ; <i32>:12 [#uses=2] icmp slt i32 %11, %12 ; <i1>:13 [#uses=2] cloning it gives something like: bb1_clone: ; preds = %entry
2011 Apr 17
0
[LLVMdev] Regarding BasicBlock Cloning
On 4/16/11 7:01 PM, tarun agrawal wrote: > The clone llvm:CloneBasicBlock copies the phi function in the > replicated basic block from the original basic block. After you clone the basic block, you can probably replace the phi instruction with another value of your choice. If you're adding variables, you'll probably want to create them as allocas and use loads and stores to
2011 May 03
2
[LLVMdev] BasicBlock Cloning
Hi I have clone a basic block using CloneBasicBlock function but it does not clone the predecessor with it. I am not able to figure out, how to set the predecessor of the cloned basic block. Tarun -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110504/74cdc609/attachment.html>
2011 May 09
2
[LLVMdev] <badref> showed up when duplicating a list of dependent instructions
I collected a sequence of LLVM instructions, want to make a copy of each and insert them into a PREVIOUS location inside the same function (all globals and locals are properly declared before the PREVIOUS location). Here is the list of instructions I want to duplicate and insert: 0 %90 = load i32* @strstart, align 4 1 %91 = add i32 %90, 2 2 %88 = load i32* @ins_h, align 4 3 %92 =