Commit 982cbed
committed
[InstCombine] Fold logical and/or of range icmps with nowrap flags
This is an edge-case where we don't convert to bitwise and/or based
on implies poison reasoning, so explicitly try to perform the fold
in logical form. The transform itself is poison-safe, as both icmps
are based on the same value and any nowrap flags are discarded as
part of the fold (https://alive2.llvm.org/ce/z/aCwC8b for the used
example).1 parent 3c2a74a commit 982cbed
File tree
4 files changed
+22
-15
lines changed- llvm
- lib/Transforms/InstCombine
- test/Transforms/InstCombine
4 files changed
+22
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1128 | 1128 | | |
1129 | 1129 | | |
1130 | 1130 | | |
1131 | | - | |
1132 | | - | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
1133 | 1135 | | |
1134 | 1136 | | |
1135 | 1137 | | |
| |||
2513 | 2515 | | |
2514 | 2516 | | |
2515 | 2517 | | |
2516 | | - | |
| 2518 | + | |
2517 | 2519 | | |
2518 | 2520 | | |
2519 | 2521 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
350 | 350 | | |
351 | 351 | | |
352 | 352 | | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
353 | 356 | | |
354 | 357 | | |
355 | 358 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2805 | 2805 | | |
2806 | 2806 | | |
2807 | 2807 | | |
| 2808 | + | |
| 2809 | + | |
| 2810 | + | |
| 2811 | + | |
| 2812 | + | |
| 2813 | + | |
2808 | 2814 | | |
2809 | 2815 | | |
2810 | 2816 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1249 | 1249 | | |
1250 | 1250 | | |
1251 | 1251 | | |
1252 | | - | |
1253 | | - | |
1254 | | - | |
1255 | | - | |
1256 | | - | |
1257 | | - | |
| 1252 | + | |
| 1253 | + | |
| 1254 | + | |
| 1255 | + | |
1258 | 1256 | | |
1259 | 1257 | | |
1260 | 1258 | | |
| |||
1266 | 1264 | | |
1267 | 1265 | | |
1268 | 1266 | | |
1269 | | - | |
1270 | | - | |
1271 | | - | |
1272 | | - | |
1273 | | - | |
1274 | | - | |
| 1267 | + | |
| 1268 | + | |
| 1269 | + | |
| 1270 | + | |
1275 | 1271 | | |
1276 | 1272 | | |
1277 | 1273 | | |
| |||
0 commit comments