Lines Matching defs:LowerSwitch
1 //===- LowerSwitch.cpp - Eliminate Switch instructions --------------------===//
9 // The LowerSwitch transformation rewrites switch instructions with a sequence
74 class LowerSwitch : public FunctionPass {
79 LowerSwitch() : FunctionPass(ID) {
120 bool operator()(const LowerSwitch::CaseRange& C1,
121 const LowerSwitch::CaseRange& C2) {
130 char LowerSwitch::ID = 0;
133 char &llvm::LowerSwitchID = LowerSwitch::ID;
135 INITIALIZE_PASS_BEGIN(LowerSwitch, "lowerswitch",
139 INITIALIZE_PASS_END(LowerSwitch, "lowerswitch",
144 return new LowerSwitch();
147 bool LowerSwitch::runOnFunction(Function &F) {
151 // Prevent LazyValueInfo from using the DominatorTree as LowerSwitch does not
153 // Currently the DominatorTree is only used by LowerSwitch indirectly via LVI
187 const LowerSwitch::CaseVector &C) {
190 for (LowerSwitch::CaseVector::const_iterator B = C.begin(), E = C.end();
249 LowerSwitch::switchConvert(CaseItr Begin, CaseItr End, ConstantInt *LowerBound,
333 BasicBlock *LowerSwitch::newLeafBlock(CaseRange &Leaf, Value *Val,
400 unsigned LowerSwitch::Clusterify(CaseVector& Cases, SwitchInst *SI) {
441 void LowerSwitch::processSwitchInst(SwitchInst *SI,
488 // LowerSwitch isn't as good, and also much more expensive in terms of
493 // switch, while LowerSwitch only needs to call LVI once per switch.