search for: block_iterator

Displaying 19 results from an estimated 19 matches for "block_iterator".

2014 May 02
2
[LLVMdev] An unexpected behavior in RegionInfo's block_iterator
Hi Fellows, I notice an unexpected behavior in RegionInfo's block_iterator. Consider the following situation: a user creates her own region containing just a single basic block TheBB, then tries to have the block_iterator to print a DFS traversal of the region. The expected behavior should be that only the single basic block TheBB will be printed, but the real behavior is...
2014 May 02
2
[LLVMdev] An unexpected behavior in RegionInfo's block_iterator
...uniquely representing regions? Best, Paul [image: Inline image 1] On Fri, May 2, 2014 at 4:42 PM, Tobias Grosser <tobias at grosser.es> wrote: > On 02/05/2014 23:26, Paul Vario wrote: > >> Hi Fellows, >> >> I notice an unexpected behavior in RegionInfo's block_iterator. >> Consider >> the following situation: a user creates her own region containing just a >> single basic block TheBB, then tries to have the block_iterator to print a >> DFS traversal of the region. The expected behavior should be that only the >> single basic block Th...
2014 May 02
2
[LLVMdev] An unexpected behavior in RegionInfo's block_iterator
...gion interface suffices all my needs. It just does not contain an "iterator" that can iterate all the basic blocks in the region plus the exit at once. What I usually do, under this kind of situation, is to define a std::vector of basicblocks, push all the basic blocks in the region using block_iterator in a for loop. And then, at the end, push_back(region->getExit()). > > An example, where it is beneficial to use the block after the region as to > define a region is the following: > > IF-1 > / \ > | IF-2 > | / \ > | | | > \ | / &g...
2010 Dec 22
0
[LLVMdev] Extracting Single-entry single-exit Regions into functions
...our criteria, 1. Find all basic blocks in that regions 2. Call llvm::ExtractCodeRegion() to replace that region by a call to the extracted function. 3. Delete the region from the RegionPassManager queue 4. Update the RegionInfo to reflect the change To find all basic blocks (step 1), I use Region::block_iterator(). However, after changing the CFG, that block_iterator does not seem to work anymore. Should I add a list of basic blocks for each Region like what people did with Loop? Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail...
2011 Oct 14
0
[LLVMdev] BasicBlock succ iterator
...ands(); i++) { BasicBlock *bb = dyn_cast<BasicBlock> (termInst->getOperand(i)); if (bb == header) { termInst->setOperand(i,newBlock); } } }* * cout << "begin to delete loop" << endl; for (Loop::block_iterator bi = L->block_begin(), bi2; bi != L->block_end(); bi = bi2) { bi2 = bi; bi2++; BasicBlock * BB = *bi; for (BasicBlock::iterator ii = BB->begin(), ii2; ii != BB->end(); ii= ii2) { ii2 = ii; ii2++; Instruction...
2012 Jul 05
3
[LLVMdev] "symbol lookup error" while running a Simple Loop Pass
...a loop"); namespace { struct LoopInst : public LoopPass { static char ID; // Pass identification, replacement for typeid LoopInst() : LoopPass(ID) {} virtual bool runOnLoop(Loop *L, LPPassManager &LPM) { LoopInfo *LI = &getAnalysis<LoopInfo>(); for (Loop::block_iterator b = L->block_begin(), be = L->block_end();b != be; ++b) { for (BasicBlock::iterator i = (*b)->begin(), ie = (*b)->end(); i != ie; ++i) { ++LoopInstNum; errs() << "Hello: "; } } return false; } // We don't modify the program, so we preserve...
2011 Oct 06
1
[LLVMdev] replacing a global variable by a constant
I would delete the Loop. I used the following code. cout << "begin to delete loop" << endl; for (Loop::block_iterator bi = L->block_begin(), bi2; bi != L->block_end(); bi = bi2) { bi2 = bi; bi2++; BasicBlock * BB = *bi; for (BasicBlock::iterator ii = BB->begin(), ii2; ii != BB->end(); ii= ii2) { ii2 = ii; ii2++; Instruction *inst = ii;...
2012 Dec 01
0
[LLVMdev] [RFC] "noclone" function attribute
...has something similar in it: /// isSafeToClone - Return true if the loop body 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 fu...
2012 Jul 05
0
[LLVMdev] "symbol lookup error" while running a Simple Loop Pass
...a loop"); namespace { struct LoopInst : public LoopPass { static char ID; // Pass identification, replacement for typeid LoopInst() : LoopPass(ID) {} virtual bool runOnLoop(Loop *L, LPPassManager &LPM) { LoopInfo *LI = &getAnalysis<LoopInfo>(); for (Loop::block_iterator b = L->block_begin(), be = L->block_end();b != be; ++b) { for (BasicBlock::iterator i = (*b)->begin(), ie = (*b)->end(); i != ie; ++i) { ++LoopInstNum; errs() << "Hello: "; } } return false; } // We don't modify the program, so we prese...
2012 Jul 05
1
[LLVMdev] "symbol lookup error" while running a Simple Loop Pass
...struct LoopInst : public LoopPass { > static char ID; // Pass identification, replacement for typeid > LoopInst() : LoopPass(ID) {} > > virtual bool runOnLoop(Loop *L, LPPassManager &LPM) { > LoopInfo *LI = &getAnalysis<LoopInfo>(); > for (Loop::block_iterator b = L->block_begin(), be = L->block_end();b != be; > ++b) > { > for (BasicBlock::iterator i = (*b)->begin(), ie = (*b)->end(); i != ie; ++i) > { > ++LoopInstNum; > errs() << "Hello: "; > } > } > > return false; > } &...
2011 Oct 05
2
[LLVMdev] replacing a global variable by a constant
hi i want replacing a global variable by a constant value for erase instruction. i had seen the code that as follows for (llvm::GlobalVariable::use_iterator U = gv->use_begin(); U != gv->use_end();--U ) { llvm::Instruction *I = llvm::cast<llvm::Instruction>(U); I->replaceAllUsesWith(constPtr); I->eraseFromParent(); } but i dont know how can declare constptr.
2011 Oct 05
0
[LLVMdev] replacing a global variable by a constant
Hi nada, > i want replacing a global variable by a constant value for erase instruction. I'm not sure what you mean exactly. A GlobalVariable has pointer type. Do you want to replace that pointer by a constant pointer? Or is it rather that you want to say that the contents of the memory pointed to by the GlobalVariable is constant, and have all places that load that GlobalVariable
2011 Oct 13
6
[LLVMdev] BasicBlock succ iterator
Hi, All I want to implement DSWP Which is used for parallelization of loops. For this purpose, the loop was replaced with a new basic block in main function. And new functions were created and basic blocks of Loop assigned to them.I have checked blocks and branches for Succ and Pred relation and I have not found any problems. However I get the following error: * **opt:
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
...op has something similar in it: /// isSafeToClone - Return true if the loop body 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 funct...
2013 May 15
2
[LLVMdev] [polly] Polly Loop info and LoopSimplify functionality
...// Check to see that no blocks (other than the header) in this loop have // predecessors that are not in the loop. This is not valid for natural // loops, but can occur if the blocks are unreachable. Since they are // unreachable we can just shamelessly delete those CFG edges! for (Loop::block_iterator BB = L->block_begin(), E = L->block_end(); BB != E; ++BB) { if (*BB == L->getHeader()) continue; SmallPtrSet<BasicBlock*, 4> BadPreds; for (pred_iterator PI = pred_begin(*BB), PE = pred_end(*BB); PI != PE; ++PI) { BasicBlock *P = *PI; if (!L-&...
2013 Jan 31
0
[LLVMdev] [PATCH] parallel loop metadata
Dear all, Here's an updated version of the parallel loop metadata patch. It includes documentation for the new metadata types with a semantics description. -- Pekka -------------- next part -------------- A non-text attachment was scrubbed... Name: parallel-loop-metadata.patch Type: text/x-patch Size: 12972 bytes Desc: not available URL:
2013 Jan 30
3
[LLVMdev] [PATCH] parallel loop metadata
On Wed, Jan 30, 2013 at 12:35 PM, Pekka Jääskeläinen <pekka.jaaskelainen at tut.fi> wrote: > Thank you all for comments, > > > On 01/30/2013 11:22 AM, David Tweed wrote: >> >> In a personal capacity I'm quite interested in the issues of producing >> from a >> high-level language some LLVM IR which is labelled with vectorization info >> (including
2011 Oct 06
0
[LLVMdev] MIPS 32bit code generation
....uiuc.edu Message-ID: <CAHbEVmSiWNVhdhxHFbeggHrikw47qWctXfFfBTvbvN158VdXLA at mail.gmail.com> Content-Type: text/plain; charset="iso-8859-1" I would delete the Loop. I used the following code. cout << "begin to delete loop" << endl; for (Loop::block_iterator bi = L->block_begin(), bi2; bi != L->block_end(); bi = bi2) { bi2 = bi; bi2++; BasicBlock * BB = *bi; for (BasicBlock::iterator ii = BB->begin(), ii2; ii != BB->end(); ii= ii2) { ii2 = ii; ii2++; Instruction *inst = ii;...