<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/mlir/lib/Conversion/OpenMPToLLVM/OpenMPToLLVM.cpp, branch users/aaupov/spr/main.boltnfc-speedup-batwritemaps</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/'/>
<entry>
<title>[mlir][OpenMP] Implement the ConvertToLLVMPatternInterface (#101997)</title>
<updated>2024-10-11T19:07:08+00:00</updated>
<author>
<name>Fabian Mora</name>
<email>fmora.dev@gmail.com</email>
</author>
<published>2024-10-11T19:07:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=58d97034c9c149d175c66440d31f46e9dfd4b760'/>
<id>58d97034c9c149d175c66440d31f46e9dfd4b760</id>
<content type='text'>
This patch implements the `ConvertToLLVMPatternInterface` for the OpenMP
dialect, allowing `convert-to-llvm` to act on the OpenMP dialect.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch implements the `ConvertToLLVMPatternInterface` for the OpenMP
dialect, allowing `convert-to-llvm` to act on the OpenMP dialect.</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir][NFC] Mark type converter in `populate...` functions as `const` (#111250)</title>
<updated>2024-10-05T19:32:40+00:00</updated>
<author>
<name>Matthias Springer</name>
<email>me@m-sp.org</email>
</author>
<published>2024-10-05T19:32:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=206fad0e218e83799e49ca15545d997c6c5e8a03'/>
<id>206fad0e218e83799e49ca15545d997c6c5e8a03</id>
<content type='text'>
This commit marks the type converter in `populate...` functions as
`const`. This is useful for debugging.

Patterns already take a `const` type converter. However, some
`populate...` functions do not only add new patterns, but also add
additional type conversion rules. That makes it difficult to find the
place where a type conversion was added in the code base. With this
change, all `populate...` functions that only populate pattern now have
a `const` type converter. Programmers can then conclude from the
function signature that these functions do not register any new type
conversion rules.

Also some minor cleanups around the 1:N dialect conversion
infrastructure, which did not always pass the type converter as a
`const` object internally.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This commit marks the type converter in `populate...` functions as
`const`. This is useful for debugging.

Patterns already take a `const` type converter. However, some
`populate...` functions do not only add new patterns, but also add
additional type conversion rules. That makes it difficult to find the
place where a type conversion was added in the code base. With this
change, all `populate...` functions that only populate pattern now have
a `const` type converter. Programmers can then conclude from the
function signature that these functions do not register any new type
conversion rules.

Also some minor cleanups around the 1:N dialect conversion
infrastructure, which did not always pass the type converter as a
`const` object internally.</pre>
</div>
</content>
</entry>
<entry>
<title>[MLIR][OpenMP] Add missing OpenMP to LLVM conversion patterns (#104440)</title>
<updated>2024-08-21T15:57:31+00:00</updated>
<author>
<name>Sergio Afonso</name>
<email>safonsof@amd.com</email>
</author>
<published>2024-08-21T15:57:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=839275d0536f992591f4c5d81e13a26e6095dda6'/>
<id>839275d0536f992591f4c5d81e13a26e6095dda6</id>
<content type='text'>
This patch adds conversion patterns to LLVM for the following OpenMP
dialect operations:
  - `omp.critical.declare`
  - `omp.cancel`
  - `omp.cancellation_point`
  - `omp.distribute`
  - `omp.teams`
  - `omp.ordered`
  - `omp.taskloop`

Also, arbitrary sorting of operations when passing them as template
argument lists when configuring that pass is replaced by alphabetical
sorting.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch adds conversion patterns to LLVM for the following OpenMP
dialect operations:
  - `omp.critical.declare`
  - `omp.cancel`
  - `omp.cancellation_point`
  - `omp.distribute`
  - `omp.teams`
  - `omp.ordered`
  - `omp.taskloop`

Also, arbitrary sorting of operations when passing them as template
argument lists when configuring that pass is replaced by alphabetical
sorting.</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir][OpenMP] Remove deprecated omp.reduction (#92732)</title>
<updated>2024-05-23T11:12:22+00:00</updated>
<author>
<name>Tom Eccles</name>
<email>tom.eccles@arm.com</email>
</author>
<published>2024-05-23T11:12:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=55e5842385ef18eaf7b5b6548413f4ee6f555dfc'/>
<id>55e5842385ef18eaf7b5b6548413f4ee6f555dfc</id>
<content type='text'>
This operation did not model the behaviour of reductions in the openmp
standard. It has since been replaced by block arguments on the outer
operation. See https://github.com/llvm/llvm-project/pull/79308 and
https://github.com/llvm/llvm-project/pull/80019</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This operation did not model the behaviour of reductions in the openmp
standard. It has since been replaced by block arguments on the outer
operation. See https://github.com/llvm/llvm-project/pull/79308 and
https://github.com/llvm/llvm-project/pull/80019</pre>
</div>
</content>
</entry>
<entry>
<title>[MLIR][Flang][OpenMP] Make omp.simdloop into a loop wrapper (#87365)</title>
<updated>2024-04-17T10:28:30+00:00</updated>
<author>
<name>Sergio Afonso</name>
<email>safonsof@amd.com</email>
</author>
<published>2024-04-17T10:28:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=3eb0ba34b0a2a29c2f34ead2b84fdf9b62cb29c1'/>
<id>3eb0ba34b0a2a29c2f34ead2b84fdf9b62cb29c1</id>
<content type='text'>
This patch updates the definition of `omp.simdloop` to enforce the
restrictions of a wrapper operation. It has been renamed to `omp.simd`,
to better reflect the naming used in the spec. All uses of "simdloop" in
function names have been updated accordingly.

Some changes to Flang lowering and OpenMP to LLVM IR translation are
introduced to prevent the introduction of compilation/test failures. The
eventual long term solution might be different.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch updates the definition of `omp.simdloop` to enforce the
restrictions of a wrapper operation. It has been renamed to `omp.simd`,
to better reflect the naming used in the spec. All uses of "simdloop" in
function names have been updated accordingly.

Some changes to Flang lowering and OpenMP to LLVM IR translation are
introduced to prevent the introduction of compilation/test failures. The
eventual long term solution might be different.</pre>
</div>
</content>
</entry>
<entry>
<title>[MLIR][OpenMP] NFC: Uniformize OpenMP ops names (#85393)</title>
<updated>2024-03-20T11:19:38+00:00</updated>
<author>
<name>Sergio Afonso</name>
<email>safonsof@amd.com</email>
</author>
<published>2024-03-20T11:19:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=d84252e064b3f35aa879c10e207f77e931f351d9'/>
<id>d84252e064b3f35aa879c10e207f77e931f351d9</id>
<content type='text'>
This patch proposes the renaming of certain OpenMP dialect operations with the
goal of improving readability and following a uniform naming convention for
MLIR operations and associated classes. In particular, the following operations
are renamed:

- `omp.map_info` -&gt; `omp.map.info`
- `omp.target_update_data` -&gt; `omp.target_update`
- `omp.ordered_region` -&gt; `omp.ordered.region`
- `omp.cancellationpoint` -&gt; `omp.cancellation_point`
- `omp.bounds` -&gt; `omp.map.bounds`
- `omp.reduction.declare` -&gt; `omp.declare_reduction`

Also, the following MLIR operation classes have been renamed:

- `omp::TaskLoopOp` -&gt; `omp::TaskloopOp`
- `omp::TaskGroupOp` -&gt; `omp::TaskgroupOp`
- `omp::DataBoundsOp` -&gt; `omp::MapBoundsOp`
- `omp::DataOp` -&gt; `omp::TargetDataOp`
- `omp::EnterDataOp` -&gt; `omp::TargetEnterDataOp`
- `omp::ExitDataOp` -&gt; `omp::TargetExitDataOp`
- `omp::UpdateDataOp` -&gt; `omp::TargetUpdateOp`
- `omp::ReductionDeclareOp` -&gt; `omp::DeclareReductionOp`
- `omp::WsLoopOp` -&gt; `omp::WsloopOp`</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch proposes the renaming of certain OpenMP dialect operations with the
goal of improving readability and following a uniform naming convention for
MLIR operations and associated classes. In particular, the following operations
are renamed:

- `omp.map_info` -&gt; `omp.map.info`
- `omp.target_update_data` -&gt; `omp.target_update`
- `omp.ordered_region` -&gt; `omp.ordered.region`
- `omp.cancellationpoint` -&gt; `omp.cancellation_point`
- `omp.bounds` -&gt; `omp.map.bounds`
- `omp.reduction.declare` -&gt; `omp.declare_reduction`

Also, the following MLIR operation classes have been renamed:

- `omp::TaskLoopOp` -&gt; `omp::TaskloopOp`
- `omp::TaskGroupOp` -&gt; `omp::TaskgroupOp`
- `omp::DataBoundsOp` -&gt; `omp::MapBoundsOp`
- `omp::DataOp` -&gt; `omp::TargetDataOp`
- `omp::EnterDataOp` -&gt; `omp::TargetEnterDataOp`
- `omp::ExitDataOp` -&gt; `omp::TargetExitDataOp`
- `omp::UpdateDataOp` -&gt; `omp::TargetUpdateOp`
- `omp::ReductionDeclareOp` -&gt; `omp::DeclareReductionOp`
- `omp::WsLoopOp` -&gt; `omp::WsloopOp`</pre>
</div>
</content>
</entry>
<entry>
<title>[MLIR][OpenMP] Support `llvm` conversion for `omp.private` regions (#81414)</title>
<updated>2024-02-16T04:57:41+00:00</updated>
<author>
<name>Kareem Ergawy</name>
<email>kareem.ergawy@amd.com</email>
</author>
<published>2024-02-16T04:57:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=118a2a52fd465b7576c54bd102ee2e417a3b9a71'/>
<id>118a2a52fd465b7576c54bd102ee2e417a3b9a71</id>
<content type='text'>
Introduces conversion of `omp.private`'s regions to the LLVM dialect.
This reuses the already existing conversion pattern for
`ReducetionDeclareOp` and repurposes it to be used for multi-region ops
as well.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Introduces conversion of `omp.private`'s regions to the LLVM dialect.
This reuses the already existing conversion pattern for
`ReducetionDeclareOp` and repurposes it to be used for multi-region ops
as well.</pre>
</div>
</content>
</entry>
<entry>
<title>[flang][OpenMP][Offloading][AMDGPU] Add test for `target update` (#76355)</title>
<updated>2024-01-02T08:50:27+00:00</updated>
<author>
<name>Kareem Ergawy</name>
<email>kareem.ergawy@amd.com</email>
</author>
<published>2024-01-02T08:50:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=75be7bb3fc6d28a7a97a0ca5c3231066b11bceba'/>
<id>75be7bb3fc6d28a7a97a0ca5c3231066b11bceba</id>
<content type='text'>
Adds a new test for offloading `target update` directive to AMD GPUs.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Adds a new test for offloading `target update` directive to AMD GPUs.</pre>
</div>
</content>
</entry>
<entry>
<title>[MLIR,Flang,OpenMP] Remove usage of getElementType in OpenMPTranslation (#69772)</title>
<updated>2023-10-23T21:25:58+00:00</updated>
<author>
<name>Kiran Chandramohan</name>
<email>kiran.chandramohan@arm.com</email>
</author>
<published>2023-10-23T21:25:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=0235cd73363c1f206cd93e2a6d133f392e832d4f'/>
<id>0235cd73363c1f206cd93e2a6d133f392e832d4f</id>
<content type='text'>
Remove usage of getElementType in OpenMPTranslation to pave way for
switching to opaque pointers in MLIR and Flang. The approach chosen
stores the elementType in a new field in MapInfo called varType. A
similar approach was chosen for AtomicReadOp in

https://github.com/llvm/llvm-project/commit/81767f52f49339be2c78fc9bf831856b9f57e2f0</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove usage of getElementType in OpenMPTranslation to pave way for
switching to opaque pointers in MLIR and Flang. The approach chosen
stores the elementType in a new field in MapInfo called varType. A
similar approach was chosen for AtomicReadOp in

https://github.com/llvm/llvm-project/commit/81767f52f49339be2c78fc9bf831856b9f57e2f0</pre>
</div>
</content>
</entry>
<entry>
<title>[OpenMP][MLIR] Refactor and extend current map support by adding MapInfoOp and DataBoundsOp operations to the OpenMP Dialect</title>
<updated>2023-09-19T13:26:46+00:00</updated>
<author>
<name>Andrew Gozillon</name>
<email>Andrew.Gozillon@amd.com</email>
</author>
<published>2023-09-19T12:58:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=571df0132daa903ed2c5ad5776e4d264b823de40'/>
<id>571df0132daa903ed2c5ad5776e4d264b823de40</id>
<content type='text'>
This patch adds two new operations:

The first is the DataBoundsOp, which is based on OpenACC's DataBoundsOp,
which holds stride, index, extent, lower bound and upper bounds
which will be used in future follow up patches to perform initial
array sectioning of mapped arrays, and Fortran pointer and
allocatable mapping. Similarly to OpenACC, this new OpenMP
DataBoundsOp also comes with a new OpenMP type, which
helps to restrict operations to accepting only
DataBoundsOp as an input or output where necessary
(or other related operations that implement this type as
a return).

The patch also adds the MapInfoOp which rolls up some of
the old map information stored in target
operations into this new operation, and adds new
information that will be utilised in the lowering of mapped
variables, e.g. the aforementioned DataBoundsOp, but also a
new ByCapture OpenMP MLIR attribute, and isImplicit boolean
attribute. Both the ByCapture and isImplicit arguments will
affect the lowering from the OpenMP dialect to LLVM-IR in
minor but important ways, such as shifting the final maptype
or generating different load/store combinations to maintain
semantics with the OpenMP standard and alignment with the
current Clang OpenMP output as best as possible.

This MapInfoOp operation is slightly based on OpenACC's
DataEntryOp, the main difference other than some slightly
different fields (e,g, isImplicit/MapType/ByCapture) is that
OpenACC's data operations "inherit" (the MLIR ODS
equivalent) from this operation, whereas in OpenMP operations
that utilise MapInfoOp's are composed of/contain them.

A series of these MapInfoOp (one per map clause list item) is
now held by target operations that represent OpenMP
directives that utilise map clauses, e.g. TargetOp. MapInfoOp's
do not have their own specialised lowering to LLVM-IR, instead
the lowering is dependent on the particular container of the
MapInfoOp's, e.g. TargetOp has its own lowering to LLVM-IR
which utilised the information stored inside of MapInfoOp's to
affect it's lowering and the end result of the LLVM-IR generated,
which in turn can differ for host and device.

This patch contains these operations, minor changes to the
printing and parsing to support them, changes to tests (only
those relevant to this segment of the patch, other test
additions and changes are in other dependent
patches in this series) and some alterations to the OpenMPToLLVM
rewriter to support the new OpenMP type and operations.

This patch is one in a series that are dependent on each
other:

https://reviews.llvm.org/D158734
https://reviews.llvm.org/D158735
https://reviews.llvm.org/D158737

Reviewers: kiranchandramohan, TIFitis, razvanlupusoru

Differential Revision: https://reviews.llvm.org/D158732
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch adds two new operations:

The first is the DataBoundsOp, which is based on OpenACC's DataBoundsOp,
which holds stride, index, extent, lower bound and upper bounds
which will be used in future follow up patches to perform initial
array sectioning of mapped arrays, and Fortran pointer and
allocatable mapping. Similarly to OpenACC, this new OpenMP
DataBoundsOp also comes with a new OpenMP type, which
helps to restrict operations to accepting only
DataBoundsOp as an input or output where necessary
(or other related operations that implement this type as
a return).

The patch also adds the MapInfoOp which rolls up some of
the old map information stored in target
operations into this new operation, and adds new
information that will be utilised in the lowering of mapped
variables, e.g. the aforementioned DataBoundsOp, but also a
new ByCapture OpenMP MLIR attribute, and isImplicit boolean
attribute. Both the ByCapture and isImplicit arguments will
affect the lowering from the OpenMP dialect to LLVM-IR in
minor but important ways, such as shifting the final maptype
or generating different load/store combinations to maintain
semantics with the OpenMP standard and alignment with the
current Clang OpenMP output as best as possible.

This MapInfoOp operation is slightly based on OpenACC's
DataEntryOp, the main difference other than some slightly
different fields (e,g, isImplicit/MapType/ByCapture) is that
OpenACC's data operations "inherit" (the MLIR ODS
equivalent) from this operation, whereas in OpenMP operations
that utilise MapInfoOp's are composed of/contain them.

A series of these MapInfoOp (one per map clause list item) is
now held by target operations that represent OpenMP
directives that utilise map clauses, e.g. TargetOp. MapInfoOp's
do not have their own specialised lowering to LLVM-IR, instead
the lowering is dependent on the particular container of the
MapInfoOp's, e.g. TargetOp has its own lowering to LLVM-IR
which utilised the information stored inside of MapInfoOp's to
affect it's lowering and the end result of the LLVM-IR generated,
which in turn can differ for host and device.

This patch contains these operations, minor changes to the
printing and parsing to support them, changes to tests (only
those relevant to this segment of the patch, other test
additions and changes are in other dependent
patches in this series) and some alterations to the OpenMPToLLVM
rewriter to support the new OpenMP type and operations.

This patch is one in a series that are dependent on each
other:

https://reviews.llvm.org/D158734
https://reviews.llvm.org/D158735
https://reviews.llvm.org/D158737

Reviewers: kiranchandramohan, TIFitis, razvanlupusoru

Differential Revision: https://reviews.llvm.org/D158732
</pre>
</div>
</content>
</entry>
</feed>
