Commit c4cb4a3
[SimplifyCFG] Propagate profile in
`simplifySwitchOfPowersOfTwo` converts (when applicable, see `00f5a1e30b`) a switch to a conditional branch. Its false case goes to the `default` target of the former switch, and the true case goes to a BB performing a `cttz`. We can calculate the branch weights from the branch weights of the old switch.
Issue llvm#147390simplifySwitchOfPowersOfTwo (llvm#165804)1 parent d4c02b4 commit c4cb4a3
File tree
3 files changed
+48
-8
lines changed- llvm
- lib/Transforms/Utils
- test/Transforms/SimplifyCFG/X86
- utils
3 files changed
+48
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| 83 | + | |
83 | 84 | | |
84 | 85 | | |
85 | 86 | | |
| |||
7632 | 7633 | | |
7633 | 7634 | | |
7634 | 7635 | | |
| 7636 | + | |
| 7637 | + | |
| 7638 | + | |
7635 | 7639 | | |
| 7640 | + | |
| 7641 | + | |
| 7642 | + | |
| 7643 | + | |
| 7644 | + | |
| 7645 | + | |
| 7646 | + | |
| 7647 | + | |
| 7648 | + | |
| 7649 | + | |
| 7650 | + | |
| 7651 | + | |
| 7652 | + | |
| 7653 | + | |
| 7654 | + | |
| 7655 | + | |
| 7656 | + | |
| 7657 | + | |
| 7658 | + | |
| 7659 | + | |
| 7660 | + | |
| 7661 | + | |
| 7662 | + | |
7636 | 7663 | | |
7637 | 7664 | | |
7638 | 7665 | | |
| |||
Lines changed: 21 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
6 | 11 | | |
7 | 12 | | |
8 | 13 | | |
| |||
35 | 40 | | |
36 | 41 | | |
37 | 42 | | |
38 | | - | |
| 43 | + | |
39 | 44 | | |
40 | | - | |
| 45 | + | |
41 | 46 | | |
42 | 47 | | |
43 | 48 | | |
44 | | - | |
| 49 | + | |
45 | 50 | | |
46 | 51 | | |
47 | 52 | | |
48 | | - | |
| 53 | + | |
49 | 54 | | |
50 | 55 | | |
51 | 56 | | |
| |||
62 | 67 | | |
63 | 68 | | |
64 | 69 | | |
65 | | - | |
| 70 | + | |
66 | 71 | | |
67 | 72 | | |
68 | 73 | | |
| |||
128 | 133 | | |
129 | 134 | | |
130 | 135 | | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1317 | 1317 | | |
1318 | 1318 | | |
1319 | 1319 | | |
1320 | | - | |
1321 | | - | |
1322 | 1320 | | |
1323 | 1321 | | |
1324 | 1322 | | |
| |||
0 commit comments