File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
llvm/lib/CodeGen/SelectionDAG Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -135,6 +135,12 @@ static cl::opt<unsigned> SwitchPeelThreshold(
135
135
" switch statement. A value greater than 100 will void this "
136
136
" optimization" ));
137
137
138
+ static cl::opt<bool > YkNoFallThrough (
139
+ " yk-no-fallthrough" , cl::Hidden, cl::init(false ),
140
+ cl::desc(" Always emit a branch even if fallthrough is possible. This "
141
+ " is required for the yk JIT, so that the machine IR has the "
142
+ " same block structure as the high-level IR" ));
143
+
138
144
// Limit the width of DAG chains. This is important in general to prevent
139
145
// DAG-based analysis from blowing up. For example, alias analysis and
140
146
// load clustering may not complete in reasonable time. It is difficult to
@@ -2348,7 +2354,8 @@ void SelectionDAGBuilder::visitBr(const BranchInst &I) {
2348
2354
2349
2355
// If this is not a fall-through branch or optimizations are switched off,
2350
2356
// emit the branch.
2351
- if (Succ0MBB != NextBlock (BrMBB) || TM.getOptLevel () == CodeGenOpt::None)
2357
+ if ((YkNoFallThrough) || (Succ0MBB != NextBlock (BrMBB) ||
2358
+ TM.getOptLevel () == CodeGenOpt::None))
2352
2359
DAG.setRoot (DAG.getNode (ISD::BR, getCurSDLoc (),
2353
2360
MVT::Other, getControlRoot (),
2354
2361
DAG.getBasicBlock (Succ0MBB)));
You can’t perform that action at this time.
0 commit comments