search for: pred_end

Displaying 20 results from an estimated 43 matches for "pred_end".

2005 Jan 13
2
[LLVMdev] the pred_begin and pred_end of BasicBlock
hi, I'm a bit confused by the pred_begin/end of BasicBlock in CFG.h. I cann't understand what is a **use** of a BasicBlock. Also, I have no idea of when CFG would be constructed in LLVM. Thanks. Zhou Feng
2005 Jan 13
0
[LLVMdev] the pred_begin and pred_end of BasicBlock
On Thu, 13 Jan 2005, Zhou Feng wrote: > hi, > I'm a bit confused by the pred_begin/end of BasicBlock in CFG.h. I cann't > understand what is a **use** of a BasicBlock. Also, I have no idea of when > CFG would be constructed in LLVM. The CFG is always implicit in LLVM. The two things that "use" BasicBlocks are branch/control flow instructions and PHI nodes.
2005 Jan 13
2
[LLVMdev] the pred_begin and pred_end of BasicBlock
Sorry, still a bit confused. Say we have two basic blocks: A and B. B has a label. There is no branch/control flow instructions explicit uses B. like this: A: code sequence does not contain br/other control flow instruction B: lable_of_b: code sequence Is A still a predecessor of B? Thanks. Chris Lattner wrote: > On Thu, 13 Jan 2005, Zhou Feng wrote: > >> hi, >> I'm
2011 Oct 14
0
[LLVMdev] BasicBlock succ iterator
...truction and each blocks belongs to a function. I'm really confused. I guess the problem is caused by the removal of the Loop,The code is as follows: * //every block to header (except the ones in the loop), will now redirect to newblock for (pred_iterator PI = pred_begin(header); PI != pred_end(header); ++PI) { BasicBlock *pred = *PI; if (L->contains(pred)) { continue; } TerminatorInst *termInst = pred->getTerminator(); for (unsigned i = 0; i < termInst->getNumOperands(); i++) { BasicBlock *bb = dyn_cast<Basic...
2011 Jan 31
3
[LLVMdev] How to convert an iterator to an object pointer
...e and it given compile time errors. error: cannot convert 'llvm::const_pred_iterator' to 'const llvm::BasicBlock*' in initialization const BasicBlock *b = PH->getParent(); // process all pred block of the current block for (const_pred_iterator pr=pred_begin(b), esc=pred_end(b); pr!=esc; ++pr) { const BasicBlock *p = pr; // ************error line ****************
2011 Feb 01
0
[LLVMdev] Loop simplification
...iterator it = pred->begin(); it != pred->end(); ++it) { PHINode *phi = dyn_cast<PHINode>(it); UT_ASSERT(phi); // Adjust the PHI to have the correct incoming block set for (pred_iterator pi = pred_begin(succ); pi != pred_end(succ); ++pi) { // We're a different predecessor than the predecessor block if (*pi != pred) { phi->addIncoming(phi, *pi); } } } // Update successor PHIs for (BasicBlock::iterator it = succ-...
2011 Feb 01
3
[LLVMdev] Loop simplification
On Feb 1, 2011, at 1:34 PM, Andrew Trick wrote: > On Feb 1, 2011, at 1:08 PM, Andrew Clinton wrote: > >> I have a (non-entry) basic block that contains only PHI nodes and an >> unconditional branch (that does not branch to itself). Is it always >> possible to merge this block with it's successor and produce a >> semantically equivalent program? I'm
2007 Dec 20
4
[LLVMdev] First time!
Hi! I want to know How to count the number of predecessors for each basic block? Thank You ____________________________________________________________________________________ Never miss a thing. Make Yahoo your home page. http://www.yahoo.com/r/hs
2008 Jan 22
3
[LLVMdev] Walking all the predecessors for a basic block
Hi all, Is there a way to walk through ALL the predecessors of a basic block in a CFG. I tried to iterate over the preds using this method for (pred_iterator PI = pred_begin(BB), E = pred_end(BB); PI != E; ++I) { BasicBlock *PredBB = *PI; } but this only gives the immediate predecessors for a basic block. For example, in this sample control flow graph. entry -> bb1 -> bb2 -> bb4 -> return | | bb3 <-| walking over the pre...
2010 May 04
2
[LLVMdev] Question about GVN
Hello, I was investigating GVN.cpp file and I found suspicious part: 1587 bool NeedToSplitEdges = false; 1588 for (pred_iterator PI = pred_begin(LoadBB), E = pred_end(LoadBB); 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...
2010 Jun 25
3
[LLVMdev] LLVM:help
How can I get list of its predecessor basic blocks from a basic block? --Rajwinder Singh -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100625/21c52063/attachment.html>
2010 Jun 25
0
[LLVMdev] LLVM:help
On 25/06/10 06:05, RAJWINDER SINGH wrote: > How can I get list of its predecessor basic blocks from a basic block? If BB is a BasicBlock*, you can get begin and end iterators using pred_begin(BB) and pred_end(BB). Ciao, Duncan.
2011 Jan 31
0
[LLVMdev] How to convert an iterator to an object pointer
...rors. > > error: cannot convert 'llvm::const_pred_iterator' to 'const > llvm::BasicBlock*' in initialization > > const BasicBlock *b = PH->getParent(); > // process all pred block of the current block > for (const_pred_iterator pr=pred_begin(b), esc=pred_end(b); pr!=esc; > ++pr) > { const BasicBlock *p = pr; // ************error line > **************** > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/...
2018 Aug 15
2
Queries Regarding Usage of PGOInstrumentation Passes instead of Deprecated ProfileInfo
...omputes the number of iterations performed by a loop from the profiling information available. The code snippet in my pass looks something like this. BasicBlock *header = loop->getHeader(); ProfileInfo &pi = getAnalysis< ProfileInfo >(); for(pred_iterator i=pred_begin(header), e=pred_end(header); i!=e; ++i) { BasicBlock *pred = *i; const double edgeCount = *pi.getEdgeWeight*( ProfileInfo::Edge(pred,header) ); */* Some code */* } Now, since ProfileInfo has been deprecated and we have PGOInstrumentation passes along with BranchProbability and BlockFrequency, I wish...
2019 Oct 30
2
How to make ScalarEvolution recompute SCEV values?
...fix, ValueToValueMapTy &VMap) { // original preheader of the loop const auto PreHeader = L->getLoopPreheader(); // keep track of the original predecessors std::set<BasicBlock *> AllPredecessors; for (auto PredIt = pred_begin(PreHeader), E = pred_end(PreHeader); PredIt != E; PredIt++) AllPredecessors.insert(*PredIt); BasicBlock *ExitBlock = L->getExitBlock(); auto DT = DominatorTree(*F); SmallVector<BasicBlock *, 8> Blocks; const auto ClonedLoop = cloneLoopWithPreheader(PreHeader, PreHead...
2008 May 14
1
[LLVMdev] Useless check in TailDuplication
...ecessors. By definition, it has at least one: The block containing BI. Is there a point I am missing here, or is this really a useless check? In particular, I'm talking about the following piece of code from lib/Transforms/Scalar/TailDuplication.cpp: pred_iterator PI = pred_begin(Dest), PE = pred_end(Dest); if (PI == PE && Dest != Dest->getParent()->begin()) return false; // It's just a dead block, ignore it... The attached patch removes this check. I can't find any problems with it, it causes no tests to fail. Gr. Matthijs -------------- next part --------------...
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:
2017 May 01
3
RFC: Stop using redundant PHI node entries for multi-edge predecessors
Today, the IR requires that if you have multiple edges from A to B (typically with a switch) any phi nodes in B must have an equal number of entries for A, but that all of them must have the same value. This seems rather annoying.... 1) It creates multiple uses of values in A for no apparently good reason 2) It makes updating PHI nodes using sets of predecessors incredibly hard 3) There is no
2017 May 01
4
RFC: Stop using redundant PHI node entries for multi-edge predecessors
...t; It also seems likely to open up more efficient in-memory representations >> if it is possible at some point to build maps of these things. >> >> Thoughts? > > > > So would this lead to a case where PHI->getNumOperands() != > std::distance(pred_begin(phiblock), pred_end(phiblock)) > > If so, that would seem problematic to handle as well. > :( Also, IIUC, today deleting an edge from A to B only requires removeIncomingValue(A) on B's PHI nodes, but after this change you'll have to check if you're deleting the last edge or not. Can (2), (3) and...
2010 Apr 07
2
[LLVMdev] graph abstraction proposal
...Type* node) {return succ_begin(node);} child_begin(NodeType* node) {return succ_end(node);} ... }; An invese graph is just another implementation e.g. struct BasicBlockInverseGraph { ... child_begin(NodeType* node) {return pred_begin(node);} child_begin(NodeType* node) {return pred_end(node);} ... }; And finally, the goal of the whole stuff, the simplification of DominatorTreeBase::recalculate with some pseudocode: void recalculate(Graph& graph) { reset(); this->Vertex.push_back(0); // Initialize roots this->Roots = graph.getRoots();...