similar to: [LLVMdev] removePredecessor() and update predecessor list

Displaying 20 results from an estimated 600 matches similar to: "[LLVMdev] removePredecessor() and update predecessor list"

2013 Jul 31
1
[LLVMdev] Problem to remove successors
Hi All, I need to remove successors from every basic block to insert new ones I tried this code, but it doesn't work void RemoveSuccessor(TerminatorInst *TI, unsigned SuccNum) { assert(SuccNum < TI->getNumSuccessors() && "Trying to remove a nonexistant successor!"); // If our old successor block contains any PHI nodes, remove the entry in the //
2019 Oct 30
2
How to make ScalarEvolution recompute SCEV values?
Hello all, I’m pretty new to LLVM. I'm writing a pass for loop optimization. I clone and rearrange loops, setting the cloned loop as the original loop’s parent. This can be done multiple times, until there is no more work to do. The trouble is, after the first time I do this, the cloned loop's SCEVs become unknown types when they should be AddRecExpr. If I re-run the whole pass on the
2013 Aug 15
0
[LLVMdev] BranchInst comparison
How could BranchInst be used to insert new branch between two basic blocks to get result like this example: br label %if.else br label %if.then br i1 %cmp1, label %if.then, label %if.else Thanks for your help On 14 August 2013 21:36, Eli Friedman <eli.friedman at gmail.com> wrote: > Your question isn't clear; please restate what specifically isn't working. > > -Eli
2013 Aug 14
0
[LLVMdev] BranchInst comparison
or like this %cmp4 = icmp eq i32 %rem, 0 br i1 %cmp4, label %if.then5, label %if.else7 On 14 August 2013 20:08, Rasha Omar <rasha.sala7 at gmail.com> wrote: > Hi All, > > How could I use BranchInst to implement for example > br label %if.else7 > br label %if.then5 > br i1 %cmp4, label %if.then5, label %if.else7 > > I can use BranchInst for only one
2013 Aug 14
3
[LLVMdev] BranchInst comparison
Your question isn't clear; please restate what specifically isn't working. -Eli On Wed, Aug 14, 2013 at 11:57 AM, Rasha Omar <rasha.sala7 at gmail.com> wrote: > or like this > > %cmp4 = icmp eq i32 %rem, 0 > > br i1 %cmp4, label %if.then5, label %if.else7 > > > On 14 August 2013 20:08, Rasha Omar <rasha.sala7 at gmail.com> wrote: > >> Hi
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
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 Aug 14
2
[LLVMdev] BranchInst comparison
Hi All, How could I use BranchInst to implement for example br label %if.else7 br label %if.then5 br i1 %cmp4, label %if.then5, label %if.else7 I can use BranchInst for only one instruction but how could I compare between two branches Thanks -- * 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
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
2013 Sep 10
1
[LLVMdev] Global Variable Recall
Hi All, I need to call global variable by its name from the following code for(Function::iterator i=F->begin();i!=F->end();++i) { BasicBlock*Bb =&*i; GlobalVariable* GV = new GlobalVariable(type,false, F->getLinkage(),0, "F$"+Bb->getName()); GV->setInitializer(Constant::getNullValue (typ)); GList.push_back(GV); } Could I solve that by
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,
2013 Aug 12
2
[LLVMdev] TerminatorInst and changing successor
Hi, Is changing the successors for each basic blocks means by default that the Terminator Instruction will be changed or this is another problem should be solved? If case 2 please tell me how to change it according to the new successors? Thanks -- * Rasha Salah Omar Msc Student at E-JUST Demonestrator at Faculty of Computers and Informatics Benha University* * e-mail:
2013 Sep 08
2
[LLVMdev] "Instruction does not dominate all uses"
BB: %4= load i32* @"FB" %5 = icmp ne i32 %4, 0 br i1 %5, label %BB1, label %BB2 The error after $clang -pthread MyNew.ll -o MyNew Instruction does not dominate all uses! Could you help for this ? -- * Rasha Salah Omar Msc Student at E-JUST Demonestrator at Faculty of Computers and Informatics Benha University* * e-mail: rasha.omar at ejust.edu.eg*
2013 Aug 22
2
[LLVMdev] Crash in CreateShl() method
Hi All, AllocaInst * AI = builder.CreateAlloca(type, 0, BBName); StoreInst* ST= builderTF.CreateStore(ConstantInt::get(type,1),AI); Value * Vresult = (Value*)ST; Vresult = builderWait.CreateShl(Vresult, 1); I need to make one bit shift left to the variable stored in the second step I've got crash in this step opt: /home/xx/llvm2/llvm/include/llvm/Support/Casting.h:237: typename
2013 Sep 08
1
[LLVMdev] "Instruction does not dominate all uses"
Hi Tim, Instruction does not dominate all uses! %5 = icmp ne i32 %4, 0 br i1 %5, label %BB1, label %BB2 Broken module found, compilation aborted! On 8 September 2013 11:58, Tim Northover <t.p.northover at gmail.com> wrote: > Hi Rasha, > > > Instruction does not dominate all uses! > > There should be two instructions printed after that message. The first > defines
2013 Aug 16
2
[LLVMdev] CreateOr no matching member error
For the following code: Type * type = IntegerType::getInt32Ty(getGlobalContext()); IRBuilder<> builder(BB); std::set<Value *> Vset; Value * Vresult=0; for(std::set<Value*>::iterator Vit=Vset.begin();Vit!=Vset.end();Vit++) { Vresult=builder.CreateOr(Vit, Vresult, "WaitOr"); } Vset is inserted in previous loop by 0 or 1 The error
2013 Aug 22
2
[LLVMdev] SwitchInst problem
Hi All, Value* V; Value* V2; BasicBlock * BB; unsigned j; ///number of cases .... //insert V , V2, j and BB SwitchInst* sw= builder.CreateSwitch(V, BB, j); ConstantInt * CI= dyn_cast<ConstantInt>(V2); sw-> addCase( CI , BB); At last step there is Program received signal SIGSEGV, Segmentation fault. What is wrong in the code? Thanks in advance -- * Rasha Salah Omar
2013 Sep 01
1
[LLVMdev] LLVM ERROR: Program used external function 'foo' which could not be resolved!
Hi All, Hope this question finds you I typed this command lli Main.ll Mod.ll to execute program in Mod.ll that contains three functions and the main function is in Main.ll but I've got the following error LLVM ERROR: Program used external function 'foo' which could not be resolved! Thanks in advance -- * Rasha Salah Omar Msc Student at E-JUST Demonestrator at
2013 Aug 14
1
[LLVMdev] Lookup table for basicblocks
Hi All, I need to implement something like a variable for each basic block How to implement lookup table in LLVM , I think ValueSymbolTable is closest one but how could I do that by it -- * Rasha Salah Omar Msc Student at E-JUST Demonestrator at Faculty of Computers and Informatics Benha University* * e-mail: rasha.omar at ejust.edu.eg* P* Please consider the
2013 Aug 24
1
[LLVMdev] Threading in llvm
Hello All, How could I use threading with LLVM such as pthread.h or openmp? I need it urgently Thank you in advance -- * Rasha Salah Omar Msc Student at E-JUST Demonestrator at Faculty of Computers and Informatics Benha University* * e-mail: rasha.omar at ejust.edu.eg* P* Please consider the environment before printing this email.* -------------- next part