Home | History | Annotate | Download | only in Utils

Lines Matching refs:PHI

53 PHINodeFoldingThreshold("phi-node-folding-threshold", cl::Hidden, cl::init(1),
54 cl::desc("Control the amount of phi node folding to perform (default = 1)"));
124 // successor, and if that successor has a PHI node, and if *that* PHI node has
145 /// unconditional branch. PhiNodes will store all PHI nodes in common
155 // We fold the unconditional branch if we can easily update all PHI nodes in
184 /// AddPredecessorToBlock - Update PHI nodes in Succ to indicate that there will
186 /// flowing into the PHI nodes will be the same as those coming in from
598 // Remove PHI node entries for the dead edge.
672 // Remove PHI node entries for dead edges.
918 // sure we update the number of entries in the PHI nodes for these
1088 // Unfortunately, the successors of the if/else blocks may have PHI nodes in
1089 // them. If they do, all PHI entries for BB1/BB2 must agree for all PHI
1108 // Make the PHI node use the select for all incoming values for BB1/BB2
1115 // Update any PHI nodes in our new successors.
1146 // Gather the PHI nodes in BBEnd.
1192 // I1 and I2 should have a single use in the same PHI node, and they
1224 // with a PHI node after sinking. We only handle the case where there is
1233 // Early exit if we need a PHI node to replace a constant.
1260 DEBUG(dbgs() << "Create PHI node " << *NewPN << "\n";);
1375 /// %phi = phi [ %sub, %ThenBB ], [ 0, %EndBB ]
1471 // Check that the PHI nodes can be converted to selects.
1530 // Insert selects and rewrite the PHI operands.
1585 /// FoldCondBranchOnPHI - If we have a conditional branch on a PHI node value
1586 /// that is defined in the same block as the branch and if any PHI entries are
1592 // NOTE: we currently cannot transform this case if the PHI node is used
1597 // Degenerate case of a single entry PHI.
1606 // Okay, this is a simple enough basic block. See if any phi values are
1621 // The dest block might have PHI nodes, other predecessors and other
1630 // Update PHI nodes.
1684 /// PHI node, see if we can eliminate it.
1686 // Ok, this is a two entry PHI node. Check to see if this is a simple "if
1700 // Okay, we found that we can merge this two-entry phi node into a select.
1701 // Doing so would require us to fold *all* two entry phi nodes in this block.
1704 // fewer PHI nodes in this block.
1710 // Loop over the PHI's seeing if we can promote them all to select
1732 // If we folded the first phi, PN dangles at this point. Refresh it. If
1745 // If we all PHI nodes are promotable, check to make sure that all
1781 // If we can still promote the PHI nodes after this gauntlet of tests,
1782 // do all of the PHI's now.
1798 // Change the PHI node into a select instruction.
1831 // with PHI nodes. If there are other instructions, merging would cause extra
1855 // Unwrap any PHI nodes in the return blocks.
2038 // Check that we have two conditional branches. If there is a PHI node in
2197 // Update PHI nodes in the common successors.
2237 // Update PHI Node.
2283 // Otherwise, if there are multiple predecessors, insert a PHI that merges
2292 // Okay, we're going to insert the PHI node. Since PBI is not the only
2293 // predecessor, compute the PHI'd conditional value for all of the preds.
2431 // OtherDest may have phi nodes. If so, add an entry from PBI's
2596 /// ... = phi i1 [ true, %entry ], [ %tmp, %DEFAULT ], [ true, %entry ]
2599 /// the PHI, merging the third icmp into the switch.
2654 // The use of the icmp has to be in the 'end' block, by the only PHI node in
2663 // true in the PHI.
2670 // Replace ICI (which is used by the PHI for the default value) with true or
2696 // NewBB branches to the phi block, add the uncond branch and the phi entry.
2776 // If there are PHI nodes in EdgeBB, then we need to add a new entry to them
2802 // PHI nodes in EdgeBB, they need entries to be added corresponding to
3148 // Prune obsolete incoming values off the successor's PHI nodes.
3195 // Prune unused values from PHI nodes.
3211 /// by an unconditional branch), look at the phi node for BB in the successor
3213 /// the phi node, and set PhiIndex to BB's index in the phi node.
3229 while (PHINode *PHI = dyn_cast<PHINode>(I++)) {
3230 int Idx = PHI->getBasicBlockIndex(BB);
3231 assert(Idx >= 0 && "PHI has no entry for predecessor?");
3233 Value *InValue = PHI->getIncomingValue(Idx);
3237 return PHI;
3244 /// instruction to a phi node dominated by the switch, if that would mean that
3256 PHINode *PHI = FindPHIForConditionForwarding(CaseValue, CaseDest,
3258 if (!PHI) continue;
3260 ForwardingNodes[PHI].push_back(PhiIndex);
3267 PHINode *Phi = I->first;
3273 Phi->setIncomingValue(Indexes[I], SI->getCondition());
3349 /// GetCaseResults - Try to determine the resulting constant values in phi nodes
3392 // Get the values for this case from phi nodes in the destination block.
3394 while (PHINode *PHI = dyn_cast<PHINode>(I++)) {
3395 int Idx = PHI->getBasicBlockIndex(Pred);
3399 Constant *ConstVal = LookupConstant(PHI->getIncomingValue(Idx),
3406 // instructions in that block. They cannot be used (except in the phi nodes
3408 // successor. If it did, we would not be in this phi node.
3414 Res.push_back(std::make_pair(PHI, ConstVal));
3650 /// phi nodes in a common successor block with different constant values,
3676 // Figure out the corresponding result for each case value and phi node in the
3697 // Resulting value at phi nodes for this case value.
3704 // Append the result from this case to the list for each phi.
3718 PHINode *PHI = DefaultResultsList[I].first;
3720 DefaultResults[PHI] = Result;
3721 ResultTypes[PHI] = Result->getType();
3749 PHINode *PHI = PHIs[I];
3751 SwitchLookupTable Table(Mod, TableSize, MinCaseVal, ResultLists[PHI],
3752 DefaultResults[PHI], TD);
3758 if (PHI->hasOneUse() && isa<ReturnInst>(*PHI->use_begin()) &&
3759 *PHI->use_begin() == CommonDest->getFirstNonPHIOrDbg()) {
3765 PHI->addIncoming(Result, LookupBB);
3869 // If the Terminator is the only non-phi instruction, simplify the block.
3889 // for PHI nodes in common successor.
3964 // If this is a branch on a phi node in the current block, thread control
3965 // through this block if any PHI node entries are constants.
4026 PHINode *PHI = dyn_cast<PHINode>(i); ++i)
4027 for (unsigned i = 0, e = PHI->getNumIncomingValues(); i != e; ++i)
4028 if (passingValueIsAlwaysUndefined(PHI->getIncomingValue(i), PHI)) {
4029 TerminatorInst *T = PHI->getIncomingBlock(i)->getTerminator();
4032 BB->removePredecessor(PHI->getIncomingBlock(i));
4069 // Check for and eliminate duplicate PHI nodes in this block.
4077 // if there are no PHI nodes.
4084 // If there is a trivial two-entry PHI node in this basic block, and we can