search for: indirectbrinst

Displaying 12 results from an estimated 12 matches for "indirectbrinst".

2013 Jul 23
2
[LLVMdev] Steps to addDestination
Hi, I need to addDestination to some basic blocks I used the following code Value* Address; IndirectBrInst *IBI = IndirectBrInst::Create(Address, Result.size(),i->getTerminator() ); IBI->addDestination(i); The following error was issued void llvm::IndirectBrInst::init(llvm::Value *, unsigned int): Assertion `Address && Address->getType()->isPointerTy() && "Address of...
2013 Jul 24
2
[LLVMdev] Steps to addDestination
Hi 1- for(rit=Result.begin();rit!=Result.end();++rit) { Value* Address= BlockAddress::get (*rit); IndirectBrInst *IBI = IndirectBrInst::Create(Address, Result.size(),i->getTerminator() ); IBI->addDestination((*rit)); } I tried this code , but the needed destination wasn't added. 2- About LLVM backend $ llc -march=cpp example_file.ll -o I think it will be so helpful for my work Thanks...
2010 May 04
2
[LLVMdev] Question about GVN
...dBB); 1589 PI != E; ++PI) { 1590 BasicBlock *Pred = *PI; 1591 if (IsValueFullyAvailableInBlock(Pred, FullyAvailableBlocks)) { 1592 continue; 1593 } 1594 PredLoads[Pred] = 0; 1595 1596 if (Pred->getTerminator()->getNumSuccessors() != 1) { 1597 if (isa<IndirectBrInst>(Pred->getTerminator())) { 1598 DEBUG(dbgs() << "COULD NOT PRE LOAD BECAUSE OF INDBR CRITICAL EDGE '" 1599 << Pred->getName() << "': " << *LI << '\n'); 1600 return false; 1601 } 1602...
2013 Jul 25
0
[LLVMdev] Steps to addDestination
Hi Rasha, > for(rit=Result.begin();rit!=Result.end();++rit) > { > Value* Address= BlockAddress::get (*rit); > > IndirectBrInst *IBI = IndirectBrInst::Create(Address, Result.size(),i->getTerminator() ); > IBI->addDestination((*rit)); > } This would be creating a block looking something like: [ Do stuff ] indirectbr i8* blockaddress(@foo, %result1), [label %result1] indirectbr i8* blocka...
2013 Jul 23
0
[LLVMdev] Steps to addDestination
...tst, label %true, label %false ; You're not trying to create this true: ret i32 42 false: ret i32 0 } If that's incorrect, you're going about it entirely the wrong way. We can help with either, but it's best not to go too far on a misunderstanding. > Value* Address; > IndirectBrInst *IBI = IndirectBrInst::Create(Address, Result.size(),i->getTerminator() ); > > IBI->addDestination(i); The problem seems to be that "Address" is uninitialised but it needs to be set to some valid pointer value before creating your IndirectBr. To replicate my first example it...
2013 Jul 23
2
[LLVMdev] Steps to addDestination
...create this > true: > ret i32 42 > false: > ret i32 0 > } > > If that's incorrect, you're going about it entirely the wrong way. We > can help with either, but it's best not to go too far on a > misunderstanding. > > > Value* Address; > > IndirectBrInst *IBI = IndirectBrInst::Create(Address, > Result.size(),i->getTerminator() ); > > > > IBI->addDestination(i); > > The problem seems to be that "Address" is uninitialised but it needs > to be set to some valid pointer value before creating your IndirectBr. >...
2018 Aug 31
2
crash problem when using IndirectBrInst to replace BranchInst
...> BlockAddress * FalseDestAddr = BlockAddress::get(FalseDest); > > > Value * ConditionValue = BI->getCondition(); > > > > SelectInst * SI = SelectInst::Create(ConditionValue, TrueDestAddr, > FalseDestAddr, "", BI); > > > > IndirectBrInst *indirBr = IndirectBrInst::Create(SI, 2, BI); > > indirBr->addDestination(TrueDest); > > indirBr->addDestination(FalseDest); > > BI->eraseFromParent(); > > > But I met the following crash when using this pass to build the arm > target. The cr...
2018 Aug 30
4
crash problem when using IndirectBrInst to replace BranchInst
...ockAddress * TrueDestAddr = BlockAddress::get(TrueDest); BlockAddress * FalseDestAddr = BlockAddress::get(FalseDest); Value * ConditionValue = BI->getCondition(); SelectInst * SI = SelectInst::Create(ConditionValue, TrueDestAddr, FalseDestAddr, "", BI); IndirectBrInst *indirBr = IndirectBrInst::Create(SI, 2, BI); indirBr->addDestination(TrueDest); indirBr->addDestination(FalseDest); BI->eraseFromParent(); But I met the following crash when using this pass to build the arm target. The crash log is: Process: clang [8...
2012 Dec 01
0
[LLVMdev] [RFC] "noclone" function attribute
...safe to clone in practice. /// Routines that reform the loop CFG and split edges often fail on indirectbr. bool Loop::isSafeToClone() const { // Return false if any loop blocks contain indirectbrs. for (Loop::block_iterator I = block_begin(), E = block_end(); I != E; ++I) { if (isa<IndirectBrInst>((*I)->getTerminator())) return false; } return true; } Maybe a similar interface could be added to Instruction, and an instruction would declare itself unsafe to clone if it was a call to a function with the attribute that you are proposing. I could imagine that this may no...
2013 Jul 24
0
[LLVMdev] Steps to addDestination
Hi Rasha, On Wed, Jul 24, 2013 at 12:28 AM, Rasha Omar <rasha.sala7 at gmail.com> wrote: > 1- I need the first example. Oh good. > 2- I set the Address uninitialized according to the documentation > " Setting the name on the Value automatically updates the module's symbol > table" from Value.h source code That's referring to a string name, and is only really
2012 Dec 01
6
[LLVMdev] [RFC] "noclone" function attribute
Hi, OpenCL has a "barrier" function with very specific semantics, and there is currently no analogue to model this in LLVM. This has been touched on by the SPIR folks but I don't believe they put forward a proposal. The barrier function is a special function that ensures that all workitems executing a kernel have executed up to that point before execution on any workitem can
2012 Dec 01
2
[LLVMdev] [RFC] "noclone" function attribute
...is safe to clone in practice. /// Routines that reform the loop CFG and split edges often fail on indirectbr. bool Loop::isSafeToClone() const { // Return false if any loop blocks contain indirectbrs. for (Loop::block_iterator I = block_begin(), E = block_end(); I != E; ++I) { if (isa<IndirectBrInst>((*I)->getTerminator())) return false; } return true; } Maybe a similar interface could be added to Instruction, and an instruction would declare itself unsafe to clone if it was a call to a function with the attribute that you are proposing. I could imagine that this may not...