Commit 1247fdd
committed
[SimplifyCFG] Relax
We should be able to allow `simplifySwitchOfPowersOfTwo` transform
to take place, as, on recent X86 targets, the weighted latency-size
appears to be 2. This favours computing trailing zeroes and indexing
into a smaller value table, over generating a jump table with an
indirect branch, which overall should be more efficient.cttz cost check in simplifySwitchOfPowersOfTwo
1 parent c5972da commit 1247fdd
File tree
2 files changed
+45
-10
lines changed- llvm
- lib/Transforms/Utils
- test/Transforms/SimplifyCFG/X86
2 files changed
+45
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7198 | 7198 | | |
7199 | 7199 | | |
7200 | 7200 | | |
7201 | | - | |
7202 | | - | |
| 7201 | + | |
| 7202 | + | |
| 7203 | + | |
| 7204 | + | |
7203 | 7205 | | |
7204 | 7206 | | |
7205 | 7207 | | |
| |||
7211 | 7213 | | |
7212 | 7214 | | |
7213 | 7215 | | |
7214 | | - | |
7215 | | - | |
7216 | | - | |
7217 | | - | |
7218 | | - | |
7219 | | - | |
7220 | | - | |
| 7216 | + | |
| 7217 | + | |
| 7218 | + | |
| 7219 | + | |
| 7220 | + | |
7221 | 7221 | | |
7222 | 7222 | | |
7223 | 7223 | | |
7224 | | - | |
| 7224 | + | |
7225 | 7225 | | |
7226 | 7226 | | |
7227 | 7227 | | |
| |||
Lines changed: 35 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
0 commit comments