similar to: RFC: Stop using redundant PHI node entries for multi-edge predecessors

Displaying 20 results from an estimated 6000 matches similar to: "RFC: Stop using redundant PHI node entries for multi-edge predecessors"

2017 May 01
4
RFC: Stop using redundant PHI node entries for multi-edge predecessors
Hi, On Mon, May 1, 2017 at 8:47 AM, Daniel Berlin via llvm-dev <llvm-dev at lists.llvm.org> wrote: >> 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
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
2011 Feb 01
0
[LLVMdev] Loop simplification
Here's what I've got so far - it seems to work, aside from the fact that DeleteDeadPHIs is not removing at least one dead PHI in my test program. --------------------- static bool mergeBlockIntoSuccessor(BasicBlock *pred, BasicBlock *succ) { if (succ == pred) return false; if (pred->getFirstNonPHI() != pred->getTerminator()) return false; //
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
2020 May 15
3
ConstantFoldTerminator doesn't delete trivially dead phi inputs
I'm looking into some missed optimizations where CodeGenPrepare seems to leave trivially dead instructions lying around. This happens because CodeGenPrepare::runOnFunction calls ConstantFoldTerminator which folds a "br i1 false" into an unconditional branch and calls BasicBlock::removePredecessor which calls PHINode::removeIncomingValue. Each incoming value that is removed from a
2008 Jan 22
0
[LLVMdev] Walking all the predecessors for a basic block
Hi Pabhat, Have you checked out DepthFirstIterator? (include/llvm/ADT/ DepthFirstIterator.h). It provides an iterator abstraction to perform a forward/reverse DFS traversal of a graph. Many of the LLVM datatypes that represent graphs have a template specialization of the GraphTraits<> class which allows separate algorithms to treat them as graphs, walk them, etc. (Both BasicBlock
2008 Jan 02
2
[LLVMdev] immediate predecessors
hi, how to get the number of immediate predecessors for each basic block (arguements of remarks statement at the beginning of the basic block) thank you aditya ____________________________________________________________________________________ Never miss a thing. Make Yahoo your home page. http://www.yahoo.com/r/hs
2012 Mar 08
2
[LLVMdev] Updating value from PHI
Here is the code snippet that I am using to create the PHIs in the loop according to the PHIs in the new preheader. At this point I have already redirected the loop backedge and removed the preheader from the loop. for (BasicBlock::iterator II = loopHeaderBB->begin(); (PN=dyn_cast<PHINode>(II)); ++II) { // remove loop back PHI and add it to split BB
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 23
1
[LLVMdev] Walking all the predecessors for a basic block
Hi, Well, yes i did try your suggestion but i keep on running into a compilation problem. The error is: llvm[0]: Compiling Hello.cpp for Release build (PIC) /home/saraswat/llvm/llvm-2.1/include/llvm/ADT/GraphTraits.h: In instantiation of `llvm::GraphTraits<llvm::ilist_iterator<llvm::BasicBlock> >': Hello.cpp:59: instantiated from here
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
2011 Jan 31
3
[LLVMdev] How to convert an iterator to an object pointer
I have a pointer to a basic block and am iterating thru its predecessor blocks. I want to get a pointer to the predecessor block. How do I do it. I am using following code 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
2012 Mar 08
0
[LLVMdev] Updating value from PHI
I guess I thought that once I redirected the branches and created new PHIs that LLVM would correct the variable usage when I return true (changed CFG) from the pass. Is this not the case? On Wed, Mar 7, 2012 at 4:08 PM, Ryan Taylor <ryta1203 at gmail.com> wrote: > Here is the code snippet that I am using to create the PHIs in the loop > according to the PHIs in the new preheader. At
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:
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>
2011 Oct 14
0
[LLVMdev] BasicBlock succ iterator
Hi I have checked all blocks, each block have a Terminator instruction 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) {
2013 Nov 14
1
[LLVMdev] Basic Block Predecessor
All, Is there a fast way to retrieve all of the predecessors to a BasicBlock in a function. Specifically, is there a fast way to iterate through all BasicBlocks which can break to a specific BasicBlock? Thanks, Billy -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20131114/aa6220a2/attachment.html>
2012 Mar 08
0
[LLVMdev] Updating value from PHI
I have attached a case of what I am trying to do, I'm pretty sure I'm just missing some simple API call. In the cfg you can see that although Im setting "lsr.iv441" as "lsr.iv44" from for.body.387.i it's not propagating that through the block or graph. On Wed, Mar 7, 2012 at 12:03 PM, Ryan Taylor <ryta1203 at gmail.com> wrote: > I am splitting a one BB
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
2008 May 14
1
[LLVMdev] Useless check in TailDuplication
Hi, while reading the TailDuplication pass, I found a check that looks rather pointless. TailDuplication looks at an unconditional branch instruction, BI. It performs a number of checks on the successor of this branch instruction, Dest. One of this checks is counting the number of predecessor. If this count is zero, Dest is regarded as dead and no tail duplication happens. However, as far as I