Commit 5ecc6d1
authored
[mlir][AMDGPU] Use LDS-only MMRA fences for lds_barrier (#157919)
The previous lowering strategy for amdgpu.lds_barrier (which is an
operation whose semantics are) "s.barrier, and all LDS operations before
this happen-before LDS operations after this, and there must not be an
inherent fence/forcing-to-completion of global memory (for performance)"
was previosuly implemented through using manual calls to waitcnt()
intrinsics and the s_barrire intrinsic(s).
The lack of explicit fencing enabled miscompiles (where LDS accesses
were reordered with the barrier) on gfx12. Since LLVM now allows MMRA
annotations to ensure that only LDS accesses are fenced by a pair of
fences, we can now use these fences in order to explicitly represent the
semantics we want instead of trying to prescribe the method of their
implemntation.
Note that the gfx908 workaround of hiding the s_barrier in inline
assembly in order to prevent spurious vmem barriers remains in place,
but is is removed for gfx11 because the fences have been changed to give
us the effect we want recently.1 parent 8b7a76a commit 5ecc6d1
File tree
2 files changed
+36
-40
lines changed- mlir
- lib/Conversion/AMDGPUToROCDL
- test/Conversion/AMDGPUToROCDL
2 files changed
+36
-40
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
536 | 536 | | |
537 | 537 | | |
538 | 538 | | |
539 | | - | |
540 | | - | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
541 | 559 | | |
542 | 560 | | |
543 | 561 | | |
544 | | - | |
545 | | - | |
| 562 | + | |
546 | 563 | | |
547 | | - | |
548 | | - | |
| 564 | + | |
| 565 | + | |
549 | 566 | | |
550 | 567 | | |
551 | 568 | | |
552 | 569 | | |
553 | 570 | | |
554 | | - | |
555 | | - | |
556 | | - | |
557 | | - | |
558 | | - | |
559 | | - | |
560 | | - | |
561 | | - | |
562 | | - | |
563 | | - | |
564 | | - | |
565 | | - | |
566 | | - | |
567 | | - | |
568 | | - | |
569 | | - | |
570 | | - | |
571 | | - | |
572 | | - | |
573 | | - | |
574 | | - | |
575 | | - | |
576 | | - | |
577 | | - | |
| 571 | + | |
| 572 | + | |
578 | 573 | | |
579 | | - | |
580 | | - | |
581 | 574 | | |
582 | | - | |
| 575 | + | |
583 | 576 | | |
584 | 577 | | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
585 | 582 | | |
586 | 583 | | |
587 | 584 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
| |||
414 | 416 | | |
415 | 417 | | |
416 | 418 | | |
| 419 | + | |
417 | 420 | | |
418 | | - | |
419 | | - | |
| 421 | + | |
420 | 422 | | |
421 | | - | |
422 | 423 | | |
423 | | - | |
424 | 424 | | |
425 | | - | |
426 | | - | |
427 | | - | |
| 425 | + | |
428 | 426 | | |
429 | 427 | | |
| 428 | + | |
430 | 429 | | |
431 | 430 | | |
432 | 431 | | |
| |||
0 commit comments