Commit f76c132
authored
[SimplifyCFG] Fix weight calculation for
Continued from llvm#165804
This maintains the BFI of the default branch. Originally `10/63`, post-pass, it ends up being `5/63 + 58/63 * 5/58`(first term is from `PROF`, second is the probability of going to the switch lookup times the probability, there, of taking the default branch)
Issue llvm#147390simplifySwitchOfPowersOfTwo (llvm#165956)1 parent b0ae054 commit f76c132
File tree
2 files changed
+14
-9
lines changed- llvm
- lib/Transforms/Utils
- test/Transforms/SimplifyCFG/X86
2 files changed
+14
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7731 | 7731 | | |
7732 | 7732 | | |
7733 | 7733 | | |
7734 | | - | |
7735 | | - | |
| 7734 | + | |
| 7735 | + | |
7736 | 7736 | | |
7737 | 7737 | | |
7738 | 7738 | | |
7739 | 7739 | | |
7740 | | - | |
7741 | | - | |
7742 | | - | |
7743 | | - | |
7744 | | - | |
| 7740 | + | |
| 7741 | + | |
| 7742 | + | |
| 7743 | + | |
| 7744 | + | |
| 7745 | + | |
| 7746 | + | |
| 7747 | + | |
| 7748 | + | |
| 7749 | + | |
| 7750 | + | |
7745 | 7751 | | |
7746 | | - | |
7747 | 7752 | | |
7748 | 7753 | | |
7749 | 7754 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
144 | | - | |
| 144 | + | |
145 | 145 | | |
0 commit comments