Commit 5146917
authored
[ConstantFolding] Fix incorrect nvvm_round folding (#151563)
The `nvvm_round` intrinsic should round to the nearest even number in
the case of ties. It lowers to PTX `cvt.rni`, which will "round to
nearest integer, choosing even integer if source is equidistant between
two integers", so it matches the semantics of `rint` (and not `round` as
the name suggests).1 parent 2b27377 commit 5146917
File tree
2 files changed
+52
-3
lines changed- llvm
- lib/Analysis
- test/Transforms/InstSimplify
2 files changed
+52
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2679 | 2679 | | |
2680 | 2680 | | |
2681 | 2681 | | |
2682 | | - | |
2683 | | - | |
| 2682 | + | |
| 2683 | + | |
| 2684 | + | |
2684 | 2685 | | |
2685 | 2686 | | |
2686 | | - | |
| 2687 | + | |
2687 | 2688 | | |
2688 | 2689 | | |
2689 | 2690 | | |
| |||
Lines changed: 48 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
416 | 416 | | |
417 | 417 | | |
418 | 418 | | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
419 | 467 | | |
420 | 468 | | |
421 | 469 | | |
| |||
0 commit comments