<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/mlir/lib/Dialect/OpenMP/Transforms/OpenMPOffloadPrivatizationPrepare.cpp, branch main</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>[flang][mlir] fix irreflexibility violation of strict weak ordering in #155348 (#164833)</title>
<updated>2025-10-24T09:55:16+00:00</updated>
<author>
<name>Emilio Cota</name>
<email>ecg@google.com</email>
</author>
<published>2025-10-24T09:55:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=fb925b5244012f42bfbd2f4566a6f01789d7412d'/>
<id>fb925b5244012f42bfbd2f4566a6f01789d7412d</id>
<content type='text'>
This fixes strict weak ordering checks violations from #155348 when
running these two tests:

    mlir/test/Dialect/OpenMP/omp-offload-privatization-prepare.mlir
    mlir/test/Dialect/OpenMP/omp-offload-privatization-prepare-by-value.mlir

Sample error:

    /stable/src/libcxx/include/__debug_utils/strict_weak_ordering_check.h:50: libc++ Hardening assertion !__comp(*__first + __a), *(__first + __b)) failed: Your comparator is not a valid strict-weak ordering

This is because (x &lt; x) should be false, not true, to meet the
irreflexibility property. (Note that .dominates(x, x) returns true.)

I'm afraid that even after this commit we can't guarantee a strict weak
ordering, because we can't guarantee transitivity of equivalence by
sorting with a strict dominance function. However the tests are not
failing anymore, and I am not at all familiar with this code so I will
leave this concern up to the original author for consideration. (Ideas
without any further context: I would consider a topological sort or
walking a dominator tree.)

Reference on std::sort and strict weak ordering:

  https://danlark.org/2022/04/20/changing-stdsort-at-googles-scale-and-beyond/</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This fixes strict weak ordering checks violations from #155348 when
running these two tests:

    mlir/test/Dialect/OpenMP/omp-offload-privatization-prepare.mlir
    mlir/test/Dialect/OpenMP/omp-offload-privatization-prepare-by-value.mlir

Sample error:

    /stable/src/libcxx/include/__debug_utils/strict_weak_ordering_check.h:50: libc++ Hardening assertion !__comp(*__first + __a), *(__first + __b)) failed: Your comparator is not a valid strict-weak ordering

This is because (x &lt; x) should be false, not true, to meet the
irreflexibility property. (Note that .dominates(x, x) returns true.)

I'm afraid that even after this commit we can't guarantee a strict weak
ordering, because we can't guarantee transitivity of equivalence by
sorting with a strict dominance function. However the tests are not
failing anymore, and I am not at all familiar with this code so I will
leave this concern up to the original author for consideration. (Ideas
without any further context: I would consider a topological sort or
walking a dominator tree.)

Reference on std::sort and strict weak ordering:

  https://danlark.org/2022/04/20/changing-stdsort-at-googles-scale-and-beyond/</pre>
</div>
</content>
</entry>
<entry>
<title>[flang][mlir] Fix-forward heap use-after-free in #155348 (#164712)</title>
<updated>2025-10-22T22:37:59+00:00</updated>
<author>
<name>Thurston Dang</name>
<email>thurston@google.com</email>
</author>
<published>2025-10-22T22:37:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=cea0037136e61777811f40775c6406ac351e9142'/>
<id>cea0037136e61777811f40775c6406ac351e9142</id>
<content type='text'>
`mapInfoOp.getMembers()` on line 258 is use-after-free, because
cloneModifyAndErase (line 255) erased `mapInfoOp`. Fix the issue by
replacing subsequent `mapInfoOp` usages with `clonedOp`.

Similarly, update `memberMapInfoOp` to avoid subsequent use-after-free.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
`mapInfoOp.getMembers()` on line 258 is use-after-free, because
cloneModifyAndErase (line 255) erased `mapInfoOp`. Fix the issue by
replacing subsequent `mapInfoOp` usages with `clonedOp`.

Similarly, update `memberMapInfoOp` to avoid subsequent use-after-free.</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir][IR] Deprecate `OpBuilder::create` in favor of free functions (#164649)</title>
<updated>2025-10-22T18:58:10+00:00</updated>
<author>
<name>Jakub Kuderski</name>
<email>jakub@nod-labs.com</email>
</author>
<published>2025-10-22T18:58:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=c0b42ec05344707d94805ec795a7bc8d33a09594'/>
<id>c0b42ec05344707d94805ec795a7bc8d33a09594</id>
<content type='text'>
These have been soft-deprecated since July:
https://discourse.llvm.org/t/psa-opty-create-now-with-100-more-tab-complete/87339

Add a deprecation attribute to prevent new uses from creeping in.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
These have been soft-deprecated since July:
https://discourse.llvm.org/t/psa-opty-create-now-with-100-more-tab-complete/87339

Add a deprecation attribute to prevent new uses from creeping in.</pre>
</div>
</content>
</entry>
<entry>
<title>[Flang][mlir] - Translation of delayed privatization for deferred target-tasks (#155348)</title>
<updated>2025-10-22T17:18:56+00:00</updated>
<author>
<name>Pranav Bhandarkar</name>
<email>pranav.bhandarkar@amd.com</email>
</author>
<published>2025-10-22T17:18:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=e2ad55499197db540d09e7201b9b80366a0908c3'/>
<id>e2ad55499197db540d09e7201b9b80366a0908c3</id>
<content type='text'>
This PR adds support for translation of the private clause on deferred
target tasks - that is `omp.target` operations with the `nowait` clause.

An offloading call for a deferred target-task is not blocking - the
offloading (target-generating) host task continues its execution after issuing the offloading
call. Therefore, the key problem we need to solve is to ensure that the
data needed for private variables to be initialized in the target task
persists even after the host task has completed.
We do this in a new pass called `PrepareForOMPOffloadPrivatizationPass`.
For a privatized variable that needs its host counterpart for
initialization (such as the shape of the data from the descriptor when
an allocatable is privatized or the value of the data when an
allocatable is firstprivatized),
  - the pass allocates memory on the heap.
- it then initializes this memory by using the `init` and `copy` (for
firstprivate) regions of the corresponding `omp::PrivateClauseOp`.
- Finally the memory allocated on the heap is freed using the `dealloc`
region of the same `omp::PrivateClauseOp` instance. This step is not
straightforward though, because we cannot simply free the memory that's
going to be used by another thread without any synchronization. So, for
deallocation, we create a `omp.task` after the `omp.target` and
synchronize the two with a dummy dependency (using the `depend` clause).
In this newly created `omp.task` we do the deallocation.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This PR adds support for translation of the private clause on deferred
target tasks - that is `omp.target` operations with the `nowait` clause.

An offloading call for a deferred target-task is not blocking - the
offloading (target-generating) host task continues its execution after issuing the offloading
call. Therefore, the key problem we need to solve is to ensure that the
data needed for private variables to be initialized in the target task
persists even after the host task has completed.
We do this in a new pass called `PrepareForOMPOffloadPrivatizationPass`.
For a privatized variable that needs its host counterpart for
initialization (such as the shape of the data from the descriptor when
an allocatable is privatized or the value of the data when an
allocatable is firstprivatized),
  - the pass allocates memory on the heap.
- it then initializes this memory by using the `init` and `copy` (for
firstprivate) regions of the corresponding `omp::PrivateClauseOp`.
- Finally the memory allocated on the heap is freed using the `dealloc`
region of the same `omp::PrivateClauseOp` instance. This step is not
straightforward though, because we cannot simply free the memory that's
going to be used by another thread without any synchronization. So, for
deallocation, we create a `omp.task` after the `omp.target` and
synchronize the two with a dummy dependency (using the `depend` clause).
In this newly created `omp.task` we do the deallocation.</pre>
</div>
</content>
</entry>
</feed>
