diff options
Diffstat (limited to 'tools/cfg_structure.py')
| -rw-r--r-- | tools/cfg_structure.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/cfg_structure.py b/tools/cfg_structure.py index 68522ec8b..9b7b41212 100644 --- a/tools/cfg_structure.py +++ b/tools/cfg_structure.py | |||
| @@ -80,7 +80,7 @@ def _dominators(rpo, preds): | |||
| 80 | return idom, pos | 80 | return idom, pos |
| 81 | 81 | ||
| 82 | 82 | ||
| 83 | def structure(succ): | 83 | def structure(succ, out_pcs=None): |
| 84 | rpo, back, preds = _order(succ) | 84 | rpo, back, preds = _order(succ) |
| 85 | idom, pos = _dominators(rpo, preds) | 85 | idom, pos = _dominators(rpo, preds) |
| 86 | 86 | ||
| @@ -158,7 +158,8 @@ def structure(succ): | |||
| 158 | out_list.append(("loop", x, lbody)) | 158 | out_list.append(("loop", x, lbody)) |
| 159 | else: | 159 | else: |
| 160 | out_list.append(("block", x)) | 160 | out_list.append(("block", x)) |
| 161 | if kind == "b" and len(below) == 1 and list(succ[x]) == [below[0][1]]: | 161 | if (kind == "b" and len(below) == 1 and list(succ[x]) == [below[0][1]] |
| 162 | and (out_pcs is None or set(out_pcs[x]) == {below[0][1]})): | ||
| 162 | stack.append(("emit", out_list, parent_list, below[0], depth)) | 163 | stack.append(("emit", out_list, parent_list, below[0], depth)) |
| 163 | else: | 164 | else: |
| 164 | hoist = (parent_list is not None and below | 165 | hoist = (parent_list is not None and below |