Home | History | Annotate | Download | only in Utils

Lines Matching full:branch

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
157 // 1> We have a constant incoming value for the conditional branch;
158 // 2> We have "Cond" as the incoming value for the unconditional branch;
270 // branch to BB, then it must be in the 'conditional' part of the "if
567 // TODO: Preserve branch weight metadata, similarly to how
593 assert(ThisCases.size() == 1 && "Branch can only have one case!");
594 // Insert the new branch.
617 // Collect branch weights into a vector.
680 // Insert the new branch.
722 /// of the vector. If TI is a conditional eq, we need to swap the branch-weight
735 // and the corresponding branch-weight data is at index 2. We swap the
763 /// equality comparison instruction (either a switch or a branch on "X == c").
794 // Update the branch weight metadata along the way
801 // branch-weight metadata is inconsistent here.
813 // branch-weight metadata is inconsistent here.
821 // that don't occur in PTI, or that branch to BB will be activated.
993 /// HoistThenElseCodeToIf - Given a conditional branch that goes to BB1 and
994 /// BB2, hoist any common code in the two blocks up into the branch block. The
1031 // For a normal instruction, we just move one to right before the branch,
1123 /// SinkThenElseCodeToEnd - Given an unconditional branch that goes to BBEnd,
1125 /// ends with an unconditional branch. If it is true, sink any common code
1133 // an unconditional branch.
1398 // If ThenBB is actually on the false edge of the conditional branch, remember
1544 // false value is the preexisting value. Swap them if the branch
1559 /// BlockIsSimpleEnoughToThreadThrough - Return true if we can thread a branch
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
1613 // branch to RealDest.
1618 // Skip if the predecessor's terminator is an indirect branch.
1667 // Loop over all of the edges from PredBB to BB, changing them to branch
1696 // Don't bother if the branch will be constant folded trivially.
1819 /// SimplifyCondBranchToTwoReturns - If we found a conditional branch that goes
1824 assert(BI->isConditional() && "Must be a conditional branch");
1839 // Okay, we found a branch that is going to two return nodes. If
1841 // branch into a return.
1898 DEBUG(dbgs() << "\nCHANGING BRANCH TO TWO RETURNS INTO SELECT:"
1908 /// probabilities of the branch taking each edge. Fills in the two APInt
1914 "Looking for probabilities on unconditional branch?");
1953 // For unconditional branch, check for a simple CFG pattern, where
1984 // executed unconditionally. It must be in the same block as the branch, and
1992 // that feeds the branch. We later ensure that any values that _it_ uses
2010 // Make sure the instruction after the condition is the cond branch.
2107 DEBUG(dbgs() << "FOLDING BRANCH TO COMMON DEST:\n" << *PBI << *BB);
2248 // could replace PBI's branch probabilities with BI's.
2260 /// SimplifyCondBranchToCondBranch - If we have a conditional branch as a
2268 // If this block ends with a branch instruction, and if there is a
2269 // predecessor that ends on a branch of the same condition, make
2270 // this conditional branch redundant.
2273 // Okay, the outcome of this conditional branch is statically
2276 // Turn this into a branch on constant.
2280 return true; // Nuke the branch on constant.
2314 // If this is a conditional branch in an empty block, and if any
2315 // predecessors is a conditional branch to one of our destinations,
2341 // Check to make sure that the other destination of this branch
2366 // branch in it, where one edge (OtherDest) goes back to itself but the other
2371 // infinite loop with no cond branch.
2399 // Modify PBI to branch on the new condition to the new dests.
2404 // Update branch weight for PBI.
2462 // branch to TrueBB if Cond is true or to FalseBB if Cond is false.
2496 // Create an unconditional branch to it.
2500 // Create a conditional branch sharing the condition of the select.
2513 // Insert an unconditional branch to the one that was found;
2529 // with a branch - conditional if X and Y lead to distinct BBs,
2585 /// block that ends with an uncond branch. We are looking for a very specific
2696 // NewBB branches to the phi block, add the uncond branch and the phi entry.
2704 /// SimplifyBranchOnICmpChain - The specified branch is a conditional branch.
2744 // transformation. A switch with one value is just an cond branch.
2747 // TODO: Preserve branch weight metadata, similarly to how
2761 // then we evaluate them with an explicit branch first. Split the block
2765 // Remove the uncond branch added to the old block.
2812 // Erase the old branch instruction.
2826 // caused control to branch here.
2864 // Insert a branch to the normal destination right before the invoke.
2902 << "INTO UNCOND BRANCH PRED: " << *Pred);
2916 // branch itself into a select/return pair.
3091 /// integer range comparison into a sub, an icmp and a branch.
3129 // Update weight for the newly-created conditional branch.
3211 /// by an unconditional branch), look at the phi node for BB in the successor
3222 BranchInst *Branch = dyn_cast<BranchInst>(BB->getTerminator());
3223 if (!Branch || !Branch->isUnconditional())
3224 return NULL; // Terminator must be unconditional branch.
3226 BasicBlock *Succ = Branch->getSuccessor(0);
3369 // If the terminator is a simple branch, continue to the next block.
3736 // Check whether the condition value is within the case range, and branch to
3787 // If we only have one predecessor, and if it is a branch on this value,
3809 // Try to transform the switch into an icmp and a branch.
3850 // If the indirectbr has one successor, change it to a direct branch.
3886 // If this basic block is ONLY a compare and a branch, and if a predecessor
3899 // Conditional branch
3901 // If we only have one predecessor, and if it is a branch on this value,
3931 // If this basic block is ONLY a compare and a branch, and if a predecessor
3937 // We have a conditional branch to two blocks that are only reachable
3964 // If this is a branch on a phi node in the current block, thread control
4023 /// (eg. null pointer dereference), remove the branch leading here.