Commit 4c241a9
committed
[InstCombine] Fold
Solves issue #63321. This patch explicitly folds `(-1 + A) & B` into `A ? 0 : B`. Additional trunc will be created when `A` is neither i1 nor <N x i1>. https://alive2.llvm.org/ce/z/pWv9jJ Reviewed By: goldstein.w.n Differential Revision: https://reviews.llvm.org/D153148(-1 + A) & B into A ? 0 : B where A is effectively a bool1 parent 71d2258 commit 4c241a9
File tree
3 files changed
+19
-10
lines changed- llvm
- lib/Transforms/InstCombine
- test/Transforms/InstCombine
3 files changed
+19
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2654 | 2654 | | |
2655 | 2655 | | |
2656 | 2656 | | |
| 2657 | + | |
| 2658 | + | |
| 2659 | + | |
| 2660 | + | |
| 2661 | + | |
| 2662 | + | |
| 2663 | + | |
| 2664 | + | |
| 2665 | + | |
| 2666 | + | |
| 2667 | + | |
| 2668 | + | |
2657 | 2669 | | |
2658 | 2670 | | |
2659 | 2671 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
261 | 261 | | |
262 | 262 | | |
263 | 263 | | |
264 | | - | |
265 | | - | |
266 | | - | |
| 264 | + | |
| 265 | + | |
267 | 266 | | |
268 | 267 | | |
269 | 268 | | |
| |||
300 | 299 | | |
301 | 300 | | |
302 | 301 | | |
303 | | - | |
304 | 302 | | |
305 | 303 | | |
306 | 304 | | |
307 | | - | |
308 | | - | |
| 305 | + | |
| 306 | + | |
309 | 307 | | |
310 | 308 | | |
311 | 309 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
930 | 930 | | |
931 | 931 | | |
932 | 932 | | |
933 | | - | |
934 | | - | |
935 | | - | |
936 | | - | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
937 | 936 | | |
938 | 937 | | |
939 | 938 | | |
| |||
0 commit comments