Commit 25c43d8
committed
[DAGCombiner] Turn
We already have a rule to turn `(neg (abs x))` into `(min x, (neg x))`.
But in some cases `(neg (max x, (neg x)))` is formed by an expanded
`abs` followed by a `neg` that is only generated after the expansion.
This patch adds a separate pattern to match this kind of cases.(neg (max x, (neg x))) into (min x, (neg x))
1 parent abf6f85 commit 25c43d8
File tree
2 files changed
+18
-8
lines changed- llvm
- lib/CodeGen/SelectionDAG
- test/CodeGen/RISCV
2 files changed
+18
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3949 | 3949 | | |
3950 | 3950 | | |
3951 | 3951 | | |
| 3952 | + | |
| 3953 | + | |
| 3954 | + | |
| 3955 | + | |
| 3956 | + | |
| 3957 | + | |
| 3958 | + | |
| 3959 | + | |
| 3960 | + | |
| 3961 | + | |
| 3962 | + | |
| 3963 | + | |
| 3964 | + | |
| 3965 | + | |
3952 | 3966 | | |
3953 | 3967 | | |
3954 | 3968 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
273 | 273 | | |
274 | 274 | | |
275 | 275 | | |
276 | | - | |
277 | | - | |
| 276 | + | |
278 | 277 | | |
279 | 278 | | |
280 | 279 | | |
| |||
315 | 314 | | |
316 | 315 | | |
317 | 316 | | |
318 | | - | |
319 | | - | |
| 317 | + | |
320 | 318 | | |
321 | 319 | | |
322 | 320 | | |
| |||
405 | 403 | | |
406 | 404 | | |
407 | 405 | | |
408 | | - | |
409 | | - | |
| 406 | + | |
410 | 407 | | |
411 | 408 | | |
412 | 409 | | |
| |||
476 | 473 | | |
477 | 474 | | |
478 | 475 | | |
479 | | - | |
480 | | - | |
| 476 | + | |
481 | 477 | | |
482 | 478 | | |
483 | 479 | | |
| |||
0 commit comments