llvm.org GIT mirror llvm / 2688bcb
Random updates to passes for indbr, I need blockaddress before I can do much more. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85316 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 11 years ago
3 changed file(s) with 10 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
208208
209209 FUNC_CODE_INST_RET = 10, // RET: [opty,opval]
210210 FUNC_CODE_INST_BR = 11, // BR: [bb#, bb#, cond] or [bb#]
211 FUNC_CODE_INST_SWITCH = 12, // SWITCH: [opty, operands...]
211 FUNC_CODE_INST_SWITCH = 12, // SWITCH: [opty, op0, op1, ...]
212212 FUNC_CODE_INST_INVOKE = 13, // INVOKE: [attr, fnty, op0,op1, ...]
213213 FUNC_CODE_INST_UNWIND = 14, // UNWIND
214214 FUNC_CODE_INST_UNREACHABLE = 15, // UNREACHABLE
236236 // new select on i1 or [N x i1]
237237 FUNC_CODE_INST_VSELECT = 29, // VSELECT: [ty,opval,opval,predty,pred]
238238 FUNC_CODE_INST_INBOUNDS_GEP= 30, // INBOUNDS_GEP: [n x operands]
239 FUNC_CODE_INST_INDBR = 31 // INDBR: [opty, operands...]
239 FUNC_CODE_INST_INDBR = 31 // INDBR: [opty, op0, op1, ...]
240240 };
241241 } // End bitc namespace
242242 } // End llvm namespace
3030 // Eliminating a switch is a big win, proportional to the number of edges
3131 // deleted.
3232 Reduction += (SI->getNumSuccessors()-1) * 40;
33 else if (isa(*UI))
34 // Eliminating an indirect branch is a big win.
35 Reduction += 200;
3336 else if (CallInst *CI = dyn_cast(*UI)) {
3437 // Turning an indirect call into a direct call is a BIG win
3538 Reduction += CI->getCalledValue() == V ? 500 : 0;
165165 return;
166166 }
167167
168 if (IndBrInst *IBI = dyn_cast(TI)) {
169 Succs.assign(Succs.size(), true);
170 return;
171 }
172
168173 SwitchInst &SI = cast(TI);
169174 LatticeVal SCValue;
170175 if (AggressiveUndef)