search for: addincoming

Displaying 20 results from an estimated 31 matches for "addincoming".

2008 Feb 27
1
[LLVMdev] adding asserts to PHINode::addIncoming
I noticed that addIncoming doesn't check if the passed in arguments are null or not, so I added a check for it. -e
2008 Feb 27
0
[LLVMdev] [PATCH] Add asserts to PHINode::addIncoming to check for null pointer arguments.
--- include/llvm/Instructions.h | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) -------------- next part -------------- A non-text attachment was scrubbed... Name: dde0e9f5d09e5f4377fcbab2602cea1ecb111d0c.diff Type: text/x-patch Size: 574 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20080227/678e7a9a/attachment.bin>
2011 Feb 01
3
[LLVMdev] Loop simplification
...t; > I didn't notice anything that will do what you want out-of-box, but it should not be hard to write. llvm::FoldSingleEntryPHINodes is an example of phi node replacement. But in this case, you'll need to do one in-place operand replacement for each successor phi use and call PhiNode::addIncoming for the rest. Note that multiple successor phis may use the same predecessor phi, so you should be careful of mutating the phis while iterating their uses. If you cover the trivial case first with llvm::MergeBlockIntoPredecessor, then the predecessor phis should have no uses other than successor ph...
2011 Feb 01
0
[LLVMdev] Loop simplification
...he 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->begin(); succ->getFirstNonPHI() != it; ++it) { PHINode *phi = dyn_cast<PHINode>(it); UT_ASSERT(phi); UT_ASSERT(phi->getBa...
2013 Nov 09
1
[LLVMdev] Variable-length Phi-node
You can call addIncoming(). /// addIncoming - Add an incoming value to the end of the PHI list /// void addIncoming(Value *V, BasicBlock *BB) { assert(V && "PHI node got a null value!"); assert(BB && "PHI node got a null basic block!"); assert(getType() == V->getTyp...
2012 Mar 08
2
[LLVMdev] Updating value from PHI
...litBB->getFirstInsertionPt()); int IDX = PN->getBasicBlockIndex(splitBB); while (IDX != -1) { Value *oldValue = PN->getIncomingValue((unsigned(IDX))); PN->removeIncomingValue(IDX, false); newPHIvalue->addIncoming(oldValue, loopLatchBB); newPHIvalue->addIncoming(PN, loopHeaderBB); IDX = PN->getBasicBlockIndex(splitBB); } } On Wed, Mar 7, 2012 at 4:04 PM, Ryan Taylor <ryta1203 at gmail.com> wrote: > I have attached a case of what...
2009 Oct 01
3
[LLVMdev] PHI and Allocas
...idoscope tutorial, I've learnt that I can substitute the PHI node creation by allocas and retrieving the value later, if needed. The Kaleidoscope example seems to account for one value only, the result of: Value *ThenV = Then->Codegen(); (...) Value *ElseV = Else->Codegen(); (...) PN->addIncoming(ThenV, ThenBB); PN->addIncoming(ElseV, ElseBB); But both Then and Else are expressions, so the Value returned is in the form of a single variable. ExprAST *Then = ParseExpression(); (...) ExprAST *Else = ParseExpression(); In my toy language, I accept any number of statements inside a block....
2012 Mar 08
0
[LLVMdev] Updating value from PHI
...onPt()); > int IDX = PN->getBasicBlockIndex(splitBB); > while (IDX != -1) { > Value *oldValue = PN->getIncomingValue((unsigned(IDX))); > PN->removeIncomingValue(IDX, false); > newPHIvalue->addIncoming(oldValue, loopLatchBB); > newPHIvalue->addIncoming(PN, loopHeaderBB); > IDX = PN->getBasicBlockIndex(splitBB); > > } > } > > On Wed, Mar 7, 2012 at 4:04 PM, Ryan Taylor <ryta1203 at gmail.com> wrote: &gt...
2012 Aug 02
1
[LLVMdev] Adding Value to use_list of instruction
I have a new block with new PHI instructions. I addIncoming for the PHIs but this apparently doesn't update the use list, which I am trying to use later on to update any instructions who are no longer dominated. On Thu, Aug 2, 2012 at 2:55 PM, Eli Friedman <eli.friedman at gmail.com> wrote: > On Thu, Aug 2, 2012 at 2:52 PM, Ryan Taylor <ry...
2013 Nov 09
0
[LLVMdev] Variable-length Phi-node
On 9 Nov 2013, at 16:35, William Moses <moses.williamsteven at gmail.com> wrote: > Is it possible to create something which has the same effect of a variable-length phi node in the C++ api. Specifically, create a phi-node where the number of incoming values is not known at the time of its creation. The PHI node preallocates its storage, so no. > If there is no such way of creating a
2013 Nov 09
2
[LLVMdev] Variable-length Phi-node
All, Is it possible to create something which has the same effect of a variable-length phi node in the C++ api. Specifically, create a phi-node where the number of incoming values is not known at the time of its creation. If there is no such way of creating a phinode like that, would it be possible to create a dummy instruction and perform a replaceAllUsesWith? If so, what should the dummy
2011 Feb 01
0
[LLVMdev] Loop simplification
...cessor. I didn't notice anything that will do what you want out-of-box, but it should not be hard to write. llvm::FoldSingleEntryPHINodes is an example of phi node replacement. But in this case, you'll need to do one in-place operand replacement for each successor phi use and call PhiNode::addIncoming for the rest. Note that multiple successor phis may use the same predecessor phi, so you should be careful of mutating the phis while iterating their uses. If you cover the trivial case first with llvm::MergeBlockIntoPredecessor, then the predecessor phis should have no uses other than successor ph...
2011 Feb 01
5
[LLVMdev] Loop simplification
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 trying to undo some of the loop optimizations that LLVM has applied to my program to reduce a pair of nested loops to a single loop.
2009 Oct 01
0
[LLVMdev] PHI and Allocas
...n substitute > the PHI node creation by allocas and retrieving the value later, if > needed. The Kaleidoscope example seems to account for one value only, > the result of: > > Value *ThenV = Then->Codegen(); > (...) > Value *ElseV = Else->Codegen(); > (...) > PN->addIncoming(ThenV, ThenBB); > PN->addIncoming(ElseV, ElseBB); > > But both Then and Else are expressions, so the Value returned is in > the form of a single variable. > > ExprAST *Then = ParseExpression(); > (...) > ExprAST *Else = ParseExpression(); > > In my toy language, I a...
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
2012 Mar 07
4
[LLVMdev] Updating value from PHI
I am splitting a one BB loop into two BB. Basically, the one loop BB has 3 incoming values, one form back edge two from other edges. I want to extract the PHIs from the other two edges out into it's own BB and delete that from the loop, then redirect the backedge to the loopbody (non extracted portion) and create a new PHI coming from the extracted BB and the backedge. I can do this;
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
2017 Sep 25
0
Potential infinite loop in MemorySSAUpdater
...t; > std::copy(PhiOps.begin(), PhiOps.end(), Phi->op_begin()); > > std::copy(pred_begin(BB), pred_end(BB), Phi->block_begin()); > > } else { > > unsigned i = 0; > > for (auto *Pred : predecessors(BB)) > > Phi->addIncoming(PhiOps[i++], Pred); > > } > > > > Result = Phi; > > } > > if (MemoryPhi *MP = dyn_cast<MemoryPhi>(Result)) > > InsertedPHIs.push_back(MP); > > // Set ourselves up for the next variable by resetting visited state. > &gt...
2017 Sep 25
2
Potential infinite loop in MemorySSAUpdater
...e read we did above. if (PHIExistsButNeedsUpdate) { std::copy(PhiOps.begin(), PhiOps.end(), Phi->op_begin()); std::copy(pred_begin(BB), pred_end(BB), Phi->block_begin()); } else { unsigned i = 0; for (auto *Pred : predecessors(BB)) Phi->addIncoming(PhiOps[i++], Pred); } Result = Phi; } if (MemoryPhi *MP = dyn_cast<MemoryPhi>(Result)) InsertedPHIs.push_back(MP); // Set ourselves up for the next variable by resetting visited state. VisitedBlocks.erase(BB); return Result; In above code which is part...
2013 Mar 02
2
[LLVMdev] Question about method CodeExtractor::severSplitPHINodes
...edsFromRegion,00248 PN->getName <http://llvm.org/docs/doxygen/html/classllvm_1_1Value.html#ad452febc1ac0b394876e640ec03ffa38>()+".ce", NewBB->begin <http://llvm.org/docs/doxygen/html/classllvm_1_1BasicBlock.html#a0ed5f3ab3c2e4196ee0cffffa080c062>());00249 NewPN->addIncoming <http://llvm.org/docs/doxygen/html/classllvm_1_1PHINode.html#a089cccb6f231efee72abc76d0f9c695f>(PN, OldPred);00250 00251 // Loop over all of the incoming value in PN, moving them to NewPN if they00252 // are from the extracted region.00253 for (unsigned i = 0; i != PN->ge...