You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[MLIR][NVVM] Update mbarrier.init/inval Ops to use AnyTypeOf[] (#165558)
This patch updates the mbarrier.init/inval Ops
to use the AnyTypeOf[] construct for their
`addr` argument. This enables us to have a
single Op that can take a pointer in either
generic or shared memory space and generate the
right intrinsics during the lowering.
* Updated existing tests accordingly.
* Verified locally that there are no new regressions in `integration`
tests.
* TODO: Additional updates for the remaining mbarrier Ops are in
progress.
These will be refactored in subsequent patches.
Signed-off-by: Durgadoss R <[email protected]>
- `addr`: A pointer to the memory location of the *mbarrier object*. Uses generic
596
-
addressing, but the address must still be in the shared memory space.
596
+
- `addr`: A pointer to the memory location of the *mbarrier object*. The `addr`
597
+
must be a pointer to generic or shared::cta memory. When it is generic, the
598
+
underlying address must be within the shared::cta memory space; otherwise
599
+
the behavior is undefined.
597
600
- `count`: Integer specifying the number of threads that will participate in barrier
598
601
synchronization. Must be in the range [1, 2²⁰ - 1].
599
602
- `predicate`: Optional predicate for conditional execution.
600
603
601
604
[For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#parallel-synchronization-and-communication-instructions-mbarrier-init)
let summary = "Shared MBarrier Initialization Op";
619
-
let description = [{
620
-
This Op is the same as `nvvm.mbarrier.init` except that the *mbarrier object*
621
-
should be accessed using a shared-memory pointer instead of a generic-memory pointer.
622
-
623
-
[For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#parallel-synchronization-and-communication-instructions-mbarrier-init)
It is undefined behavior if the *mbarrier object* is already invalid.
645
633
646
634
The operation takes the following operand:
647
-
- `addr`: A pointer to the memory location of the *mbarrier object*. Uses generic
648
-
addressing, but the address must still be in the shared memory space.
635
+
- `addr`: A pointer to the memory location of the *mbarrier object*. The `addr`
636
+
must be a pointer to generic or shared::cta memory. When it is generic, the
637
+
underlying address must be within the shared::cta memory space; otherwise
638
+
the behavior is undefined.
649
639
650
640
[For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#parallel-synchronization-and-communication-instructions-mbarrier-inval)
let summary = "Shared MBarrier Invalidation Operation";
661
-
let description = [{
662
-
This Op is the same as `nvvm.mbarrier.inval` except that the *mbarrier object*
663
-
should be accessed using a shared-memory pointer instead of a generic-memory pointer.
643
+
let assemblyFormat = "$addr attr-dict `:` type(operands)";
664
644
665
-
[For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#parallel-synchronization-and-communication-instructions-mbarrier-inval)
0 commit comments