Lines Matching full:switch
87 // It is not safe to merge these two switch instructions if they have a common
89 // conflicting incoming values from the two switch blocks.
265 switch (I->getOpcode()) {
375 // If there are a ton of values, we don't want to make a ginormous switch.
454 // Do not permit merging of large switch instructions into their
681 /// equality comparison instruction (either a switch or a branch on "X == c").
708 // PredCases and PredDefault with the new switch cases we would like to
726 // Reconstruct the new switch statement we will be building.
779 // Convert pointer to int before we switch.
781 assert(TD && "Cannot switch on pointer without TargetData");
786 // Now that the successors are updated, create the new Switch instruction.
999 switch (HInst->getOpcode()) {
1885 // (switch (select cond, X, Y)) on constant X, Y
1928 /// this case, we merge the first two "or's of icmp" into a switch, but then the
1932 /// switch i8 %A, label %DEFAULT [ i8 1, label %end i8 2, label %end ]
1940 /// the PHI, merging the third icmp into the switch.
1953 // The pattern we're looking for is where our only predecessor is a switch on
1954 // 'V' and this block is the default case for the switch. In this case we can
1955 // fold the compared value into the switch to simplify things.
2016 // Okay, the switch goes to this block on a default value. Add an edge from
2017 // the switch to the merge point on the compared value.
2018 BasicBlock *NewBB = BasicBlock::Create(BB->getContext(), "switch.edge",
2032 /// fold it into a switch instruction if so.
2039 // Change br (X == 0 | X == 1), T, F into a switch instruction.
2060 // Avoid turning single icmps into a switch.
2064 // There might be duplicate constants in the list, which the switch
2069 // If Extra was used, we require at least two switch values to do the
2070 // transformation. A switch with one value is just an cond branch.
2081 << " cases into SWITCH. BB is:\n" << *BB);
2083 // If there are any extra values that couldn't be folded into the switch
2087 BasicBlock *NewBB = BB->splitBasicBlock(BI, "switch.early.test");
2109 // Convert pointer to int before we switch.
2111 assert(TD && "Cannot switch on pointer without TargetData");
2117 // Create the new switch instruction now.
2120 // Add all of the 'cases' to the switch instruction.
2442 /// TurnSwitchRangeIntoICmp - Turns a switch with that contains only a
2445 assert(SI->getNumCases() > 2 && "Degenerate switch?");
2470 Value *Cmp = Builder.CreateICmpULT(Sub, NumCases, "switch");
2484 /// EliminateDeadSwitchCases - Compute masked bits for the condition of a switch
2498 DEBUG(dbgs() << "SimplifyCFG: switch case '"
2503 // Remove dead cases from the switch.
2525 return NULL; // BB must be dominated by the switch.
2548 /// ForwardSwitchConditionToPHI - Try to forward the condition of a switch
2549 /// instruction to a phi node dominated by the switch, if that would mean that
2550 /// some of the destination blocks of the switch can be folded away.
2586 // If this switch is too complex to want to look at, ignore it.
2593 // see if that predecessor totally determines the outcome of this switch.
2603 // If the block only contains the switch, see if we can fold the block
2613 // Try to transform the switch into an icmp and a branch.
2695 // switch.
2719 // Try to turn "br (X == 0 | X == 1), T, F" into a switch instruction.