Home | History | Annotate | Download | only in Utils

Lines Matching refs:Phi

51 PHINodeFoldingThreshold("phi-node-folding-threshold", cl::Hidden, cl::init(1),
52 cl::desc("Control the amount of phi node folding to perform (default = 1)"));
119 // successor, and if that successor has a PHI node, and if *that* PHI node has
140 /// unconditional branch. PhiNodes will store all PHI nodes in common
150 // We fold the unconditional branch if we can easily update all PHI nodes in
179 /// AddPredecessorToBlock - Update PHI nodes in Succ to indicate that there will
181 /// flowing into the PHI nodes will be the same as those coming in from
195 /// least one PHI node in it), check to see if the merge at this block is due
658 // Remove PHI node entries for the dead edge.
732 // Remove PHI node entries for dead edges.
978 // sure we update the number of entries in the PHI nodes for these
1131 // Unfortunately, the successors of the if/else blocks may have PHI nodes in
1132 // them. If they do, all PHI entries for BB1/BB2 must agree for all PHI
1151 // Make the PHI node use the select for all incoming values for BB1/BB2
1158 // Update any PHI nodes in our new successors.
1189 // Gather the PHI nodes in BBEnd.
1235 // I1 and I2 should have a single use in the same PHI node, and they
1267 // with a PHI node after sinking. We only handle the case where there is
1276 // Early exit if we need a PHI node to replace a constant.
1303 DEBUG(dbgs() << "Create PHI node " << *NewPN << "\n";);
1358 /// %phi = phi [ %sub, %ThenBB ], [ 0, %EndBB ]
1444 // Check that the PHI nodes can be converted to selects.
1486 // Insert selects and rewrite the PHI operands.
1541 /// FoldCondBranchOnPHI - If we have a conditional branch on a PHI node value
1542 /// that is defined in the same block as the branch and if any PHI entries are
1548 // NOTE: we currently cannot transform this case if the PHI node is used
1553 // Degenerate case of a single entry PHI.
1562 // Okay, this is a simple enough basic block. See if any phi values are
1577 // The dest block might have PHI nodes, other predecessors and other
1586 // Update PHI nodes.
1640 /// PHI node, see if we can eliminate it.
1642 // Ok, this is a two entry PHI node. Check to see if this is a simple "if
1656 // Okay, we found that we can merge this two-entry phi node into a select.
1657 // Doing so would require us to fold *all* two entry phi nodes in this block.
1660 PHI nodes in this block.
1666 // Loop over the PHI's seeing if we can promote them all to select
1688 // If we folded the first phi, PN dangles at this point. Refresh it. If
1701 // If we all PHI nodes are promotable, check to make sure that all
1737 // If we can still promote the PHI nodes after this gauntlet of tests,
1738 // do all of the PHI's now.
1754 // Change the PHI node into a select instruction.
1787 // with PHI nodes. If there are other instructions, merging would cause extra
1811 // Unwrap any PHI nodes in the return blocks.
1994 // Check that we have two conditional branches. If there is a PHI node in
2153 // Update PHI nodes in the common successors.
2193 // Update PHI Node.
2239 // Otherwise, if there are multiple predecessors, insert a PHI that merges
2248 // Okay, we're going to insert the PHI node. Since PBI is not the only
2249 // predecessor, compute the PHI'd conditional value for all of the preds.
2387 // OtherDest may have phi nodes. If so, add an entry from PBI's
2552 /// ... = phi i1 [ true, %entry ], [ %tmp, %DEFAULT ], [ true, %entry ]
2555 /// the PHI, merging the third icmp into the switch.
2610 // The use of the icmp has to be in the 'end' block, by the only PHI node in
2619 // true in the PHI.
2626 // Replace ICI (which is used by the PHI for the default value) with true or
2652 // NewBB branches to the phi block, add the uncond branch and the phi entry.
2732 // If there are PHI nodes in EdgeBB, then we need to add a new entry to them
2758 // PHI nodes in EdgeBB, they need entries to be added corresponding to
3099 // Prune obsolete incoming values off the successor's PHI nodes.
3146 // Prune unused values from PHI nodes.
3162 /// by an unconditional branch), look at the phi node for BB in the successor
3164 /// the phi node, and set PhiIndex to BB's index in the phi node.
3180 while (PHINode *PHI = dyn_cast<PHINode>(I++)) {
3181 int Idx = PHI->getBasicBlockIndex(BB);
3182 assert(Idx >= 0 && "PHI has no entry for predecessor?");
3184 Value *InValue = PHI->getIncomingValue(Idx);
3188 return PHI;
3195 /// instruction to a phi node dominated by the switch, if that would mean that
3207 PHINode *PHI = FindPHIForConditionForwarding(CaseValue, CaseDest,
3209 if (!PHI) continue;
3211 ForwardingNodes[PHI].push_back(PhiIndex);
3218 PHINode *Phi = I->first;
3224 Phi->setIncomingValue(Indexes[I], SI->getCondition());
3300 /// GetCaseResults - Try to determine the resulting constant values in phi nodes
3342 // Get the values for this case from phi nodes in the destination block.
3344 while (PHINode *PHI = dyn_cast<PHINode>(I++)) {
3345 int Idx = PHI->getBasicBlockIndex(Pred);
3349 Constant *ConstVal = LookupConstant(PHI->getIncomingValue(Idx),
3356 // instructions in that block. They cannot be used (except in the phi nodes
3358 // successor. If it did, we would not be in this phi node.
3364 Res.push_back(std::make_pair(PHI, ConstVal));
3600 /// phi nodes in a common successor block with different constant values,
3626 // Figure out the corresponding result for each case value and phi node in the
3647 // Resulting value at phi nodes for this case value.
3654 // Append the result from this case to the list for each phi.
3668 PHINode *PHI = DefaultResultsList[I].first;
3670 DefaultResults[PHI] = Result;
3671 ResultTypes[PHI] = Result->getType();
3699 PHINode *PHI = PHIs[I];
3701 SwitchLookupTable Table(Mod, TableSize, MinCaseVal, ResultLists[PHI],
3702 DefaultResults[PHI], TD);
3708 if (PHI->hasOneUse() && isa<ReturnInst>(*PHI->use_begin()) &&
3709 *PHI->use_begin() == CommonDest->getFirstNonPHIOrDbg()) {
3715 PHI->addIncoming(Result, LookupBB);
3819 // If the Terminator is the only non-phi instruction, simplify the block.
3839 // for PHI nodes in common successor.
3914 // If this is a branch on a phi node in the current block, thread control
3915 // through this block if any PHI node entries are constants.
3976 PHINode *PHI = dyn_cast<PHINode>(i); ++i)
3977 for (unsigned i = 0, e = PHI->getNumIncomingValues(); i != e; ++i)
3978 if (passingValueIsAlwaysUndefined(PHI->getIncomingValue(i), PHI)) {
3979 TerminatorInst *T = PHI->getIncomingBlock(i)->getTerminator();
3982 BB->removePredecessor(PHI->getIncomingBlock(i));
4019 // Check for and eliminate duplicate PHI nodes in this block.
4027 // if there are no PHI nodes.
4034 // If there is a trivial two-entry PHI node in this basic block, and we can