Commit 71d2de8
authored
[X86] Promote cttz_i32(x) -> cttz_i64((i64)x | (1 << 32)) (#102900)
On 64bit targets we can promote i32 CTTZ nodes to i64 CTTZ_ZERO_UNDEF by setting the 32nd bit.
#57811 also queried about whether we should use BTS instead of MOVABS+OR to avoid a i64 immediate - I'm willing to tweak the DAGToDAG isel peephole for these cases if reviewers think it worthwhile. But most recent CPUs can actually handle MOVABS faster than BTS/C/R.......
Fixes #578111 parent b7ebb67 commit 71d2de8
File tree
5 files changed
+154
-240
lines changed- llvm
- lib/Target/X86
- test/CodeGen/X86
5 files changed
+154
-240
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
412 | 412 | | |
413 | 413 | | |
414 | 414 | | |
| 415 | + | |
415 | 416 | | |
416 | 417 | | |
417 | 418 | | |
| |||
3237 | 3238 | | |
3238 | 3239 | | |
3239 | 3240 | | |
3240 | | - | |
| 3241 | + | |
3241 | 3242 | | |
3242 | | - | |
| 3243 | + | |
| 3244 | + | |
3243 | 3245 | | |
3244 | 3246 | | |
3245 | 3247 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
317 | 317 | | |
318 | 318 | | |
319 | 319 | | |
320 | | - | |
321 | | - | |
322 | | - | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | | - | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
327 | 325 | | |
328 | 326 | | |
329 | 327 | | |
| |||
0 commit comments