Commit 35a8d38
committed
[RISCV][IA] Check nuw on multiply when analyzing EVL
If we're checking to see if a number is a multiple of a small constant, we
need to be sure the multiply doesn't overflow for the mul logic to hold.
The VL is a unsigned number, so we care about unsigned overflow.
Once we've proven a number of a multiple, we can also use an exact udiv
as we know we're not discarding any bits.
This fixes what is technically a miscompile with EVL vectorization, but
I doubt we'd ever have seen it in practice since most EVLs are going to
much less than UINT_MAX.1 parent 9912ccb commit 35a8d38
File tree
2 files changed
+36
-148
lines changed- llvm
- lib/Target/RISCV
- test/CodeGen/RISCV/rvv
2 files changed
+36
-148
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
244 | 244 | | |
245 | 245 | | |
246 | 246 | | |
247 | | - | |
| 247 | + | |
248 | 248 | | |
249 | 249 | | |
250 | 250 | | |
| |||
296 | 296 | | |
297 | 297 | | |
298 | 298 | | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | | - | |
| 299 | + | |
| 300 | + | |
303 | 301 | | |
304 | 302 | | |
305 | 303 | | |
| |||
465 | 463 | | |
466 | 464 | | |
467 | 465 | | |
468 | | - | |
469 | | - | |
470 | | - | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
471 | 469 | | |
472 | 470 | | |
473 | 471 | | |
| |||
572 | 570 | | |
573 | 571 | | |
574 | 572 | | |
575 | | - | |
576 | | - | |
577 | | - | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
578 | 576 | | |
579 | 577 | | |
580 | 578 | | |
| |||
0 commit comments