5 Commits

Author SHA1 Message Date
Jay Foad
d4a0154902
[llvm-project] Fix typo "seperate" () 2024-06-13 20:20:27 +01:00
Christian Sigg
a5757c5b65
Switch member calls to isa/dyn_cast/cast/... to free function calls. ()
This change cleans up call sites. Next step is to mark the member
functions deprecated.

See https://mlir.llvm.org/deprecation and
https://discourse.llvm.org/t/preferred-casting-style-going-forward.
2024-04-19 15:58:27 +02:00
Guray Ozen
63389326f5
[mlir][nvvm] Support predicates in BasicPtxBuilder ()
This PR enhances `BasicPtxBuilder` to support predicates in PTX code
generation. The `BasicPtxBuilder` interface was initially introduced for
generating PTX code automatically for Ops that aren't supported by LLVM
core. Predicates, which are typically not supported in LLVM core, are
now supported using the same mechanism.

In PTX programming, instructions can be guarded by predicates as shown
below:. Here `@p` is a predicate register and guard the execution of the
instruction.

```
@p ptx.code op1, op2, op3
```

This PR introduces the `getPredicate` function in the `BasicPtxBuilder`
interface to set an optional predicate. When a predicate is provided,
the instruction is generated with predicate and guarded, otherwise,
predicate is not genearted. Note that the predicate value must always
appear as the last argument on the Op definition.

Additionally, this PR implements predicate usage for the following ops:

- mbarrier.init
- mbarrier.init.shared
- mbarrier.arrive.expect_tx
- mbarrier.arrive.expect_tx.shared
- cp.async.bulk.tensor.shared.cluster.global
- cp.async.bulk.tensor.global.shared.cta

See for more detail in PTX programing model

https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#ptx-instructions
2023-10-17 12:42:36 +02:00
Guray Ozen
282ea28f18
[mlir][nvvm] Fix circular dependency in ()
BasicPtxBuilder includes NVVMDialect and vice versa. Cmake appereantly
forgives that, but this causes bazel build fails. This PR aims to fix
that
2023-10-12 16:24:36 -07:00
Guray Ozen
25da11541c
[mlir][nvvm] Move BasicPtxBuilder Interface to Its Own File (NFC) () 2023-10-12 07:13:58 -07:00