<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/offload/libomptarget/OpenMP/Mapping.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>[OpenMP] Fix crash with duplicate mapping on target directive (#146136)</title>
<updated>2025-06-29T21:41:24+00:00</updated>
<author>
<name>Julian Brown</name>
<email>julian.brown@amd.com</email>
</author>
<published>2025-06-29T21:41:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=b62b58d1bbbff7ca200f166603c80470639a0632'/>
<id>b62b58d1bbbff7ca200f166603c80470639a0632</id>
<content type='text'>
OpenMP allows duplicate mappings, i.e. in OpenMP 6.0, 7.9.6 "map
Clause":

  Two list items of the map clauses on the same construct must not share
  original storage unless one of the following is true: they are the same
  list item [or other omitted reasons]"

Duplicate mappings can arise as a result of user-defined mapper
processing (which I think is a separate bug, and is not addressed here),
but also in straightforward cases such as:

  #pragma omp target map(tofrom: s.mem[0:10]) map(tofrom: s.mem[0:10])

Both these cases cause crashes at runtime at present, due to an
unfortunate interaction between reference counting behaviour and shadow
pointer handling for blocks. This is what happens:

  1.  The member "s.mem" is copied to the target
  2.  A shadow pointer is created, modifying the pointer on the target
  3.  The member "s.mem" is copied to the target again
  4. The previous shadow pointer metadata is still present, so the runtime doesn't modify the target pointer a second time.

The fix is to disable step 3 if we've already done step 2 for a given
block that has the "is new" flag set.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
OpenMP allows duplicate mappings, i.e. in OpenMP 6.0, 7.9.6 "map
Clause":

  Two list items of the map clauses on the same construct must not share
  original storage unless one of the following is true: they are the same
  list item [or other omitted reasons]"

Duplicate mappings can arise as a result of user-defined mapper
processing (which I think is a separate bug, and is not addressed here),
but also in straightforward cases such as:

  #pragma omp target map(tofrom: s.mem[0:10]) map(tofrom: s.mem[0:10])

Both these cases cause crashes at runtime at present, due to an
unfortunate interaction between reference counting behaviour and shadow
pointer handling for blocks. This is what happens:

  1.  The member "s.mem" is copied to the target
  2.  A shadow pointer is created, modifying the pointer on the target
  3.  The member "s.mem" is copied to the target again
  4. The previous shadow pointer metadata is still present, so the runtime doesn't modify the target pointer a second time.

The fix is to disable step 3 if we've already done step 2 for a given
block that has the "is new" flag set.</pre>
</div>
</content>
</entry>
<entry>
<title>[offload] Remove redundant checks in MappingInfoTy::lookupMapping (#127638)</title>
<updated>2025-02-18T17:01:36+00:00</updated>
<author>
<name>Krzysztof Parzyszek</name>
<email>Krzysztof.Parzyszek@amd.com</email>
</author>
<published>2025-02-18T17:01:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=7b89c41e41ce1a8832130ce9bfa24b216bfe327b'/>
<id>7b89c41e41ce1a8832130ce9bfa24b216bfe327b</id>
<content type='text'>
Also add some clarifying comments.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Also add some clarifying comments.</pre>
</div>
</content>
</entry>
<entry>
<title>[Offload][NFC] Rename `src/` -&gt; `libomptarget/` (#126573)</title>
<updated>2025-02-10T19:22:10+00:00</updated>
<author>
<name>Joseph Huber</name>
<email>huberjn@outlook.com</email>
</author>
<published>2025-02-10T19:22:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a854c266b98468ad4479a7d3c56a3fa76437e30d'/>
<id>a854c266b98468ad4479a7d3c56a3fa76437e30d</id>
<content type='text'>
Summary:
The name `src` is confusing when combined with the plugins and the newly
added `liboffload`.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Summary:
The name `src` is confusing when combined with the plugins and the newly
added `liboffload`.</pre>
</div>
</content>
</entry>
</feed>
