Commit 806fdc7
committed
[SDAG] Make Select-with-Identity-Fold More Flexible; NFC
This change introduces a new overload of the method
`shouldFoldSelectWithIdentityConstant()`, which takes the opcode of the
select node and the non-identity operand of the select node and is
called after all other checks have been performed. Moreover, this change
adjusts the precondition of the fold so that it would work for `SELECT`
nodes in addition to `VSELECT` nodes.
No functional change is intended because the default (and currently
only) implementation restricts the fold to a `VSELECT` node; the same
restriction as before.
The rationale of this change is to make more fine grained decisions
possible when to revert the InstCombine canonicalization of
`(select c (binop x y) y)` to `(binop (select c x idc) y)` in the
backends.1 parent b6820c3 commit 806fdc7
File tree
2 files changed
+22
-5
lines changed- llvm
- include/llvm/CodeGen
- lib/CodeGen/SelectionDAG
2 files changed
+22
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3351 | 3351 | | |
3352 | 3352 | | |
3353 | 3353 | | |
3354 | | - | |
| 3354 | + | |
| 3355 | + | |
3355 | 3356 | | |
3356 | 3357 | | |
3357 | 3358 | | |
3358 | 3359 | | |
3359 | 3360 | | |
3360 | 3361 | | |
| 3362 | + | |
| 3363 | + | |
| 3364 | + | |
| 3365 | + | |
| 3366 | + | |
| 3367 | + | |
| 3368 | + | |
| 3369 | + | |
| 3370 | + | |
| 3371 | + | |
| 3372 | + | |
| 3373 | + | |
3361 | 3374 | | |
3362 | 3375 | | |
3363 | 3376 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2425 | 2425 | | |
2426 | 2426 | | |
2427 | 2427 | | |
2428 | | - | |
2429 | | - | |
| 2428 | + | |
| 2429 | + | |
| 2430 | + | |
2430 | 2431 | | |
2431 | 2432 | | |
2432 | 2433 | | |
| |||
2439 | 2440 | | |
2440 | 2441 | | |
2441 | 2442 | | |
| 2443 | + | |
2442 | 2444 | | |
2443 | 2445 | | |
2444 | 2446 | | |
2445 | 2447 | | |
2446 | | - | |
| 2448 | + | |
| 2449 | + | |
2447 | 2450 | | |
2448 | 2451 | | |
2449 | 2452 | | |
2450 | 2453 | | |
2451 | 2454 | | |
2452 | | - | |
| 2455 | + | |
| 2456 | + | |
2453 | 2457 | | |
2454 | 2458 | | |
2455 | 2459 | | |
| |||
0 commit comments