9 Commits

Author SHA1 Message Date
Danial Klimkin
19992eea23
Partially revert "[mlir][NVVM] Add constant memory space identifier" (#111169)
The second part of the change introduced circular dependency between
LLVMDialect and BasicPtxBuilderInterface.
2024-10-04 17:03:43 +02:00
Matthias Springer
208f42fd9b
[mlir][NVVM] Add constant memory space identifier (#111141)
Also use these enums in `BasicPtxBuilderInferface.cpp`.
2024-10-04 15:13:34 +02:00
Youngsuk Kim
123e8c735d [mlir] Don't call llvm::raw_string_ostream::flush() (NFC)
Don't call raw_string_ostream::flush(), which is essentially a no-op.
As specified in the docs, raw_string_ostream is always unbuffered.
( 65b13610a5226b84889b923bae884ba395ad084d for further reference )
2024-09-22 15:37:34 -05:00
Ramkumar Ramachandra
db791b278a
mlir/LogicalResult: move into llvm (#97309)
This patch is part of a project to move the Presburger library into
LLVM.
2024-07-02 10:42:33 +01:00
Jay Foad
d4a0154902
[llvm-project] Fix typo "seperate" (#95373) 2024-06-13 20:20:27 +01:00
Christian Sigg
a5757c5b65
Switch member calls to isa/dyn_cast/cast/... to free function calls. (#89356)
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 (#67102)
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 (#68934)
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) (#68095) 2023-10-12 07:13:58 -07:00