<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp, branch users/MaskRay/spr/main.elf-orphan-placement-remove-hasinputsections-condition</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>[LoopUnroll] Consider convergence control tokens when unrolling (#91715)</title>
<updated>2024-06-06T07:43:46+00:00</updated>
<author>
<name>Sameer Sahasrabuddhe</name>
<email>sameer.sahasrabuddhe@amd.com</email>
</author>
<published>2024-06-06T07:43:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=e0ac087ff004f7a63ba64b9685f4f098d6ee54c5'/>
<id>e0ac087ff004f7a63ba64b9685f4f098d6ee54c5</id>
<content type='text'>
- There is no restriction on a loop with controlled convergent
operations when
  the relevant tokens are defined and used within the loop.

- When a token defined outside a loop is used inside (also called a loop
convergence heart), unrolling is allowed only in the absence of
remainder or
  runtime checks.

- When a token defined inside a loop is used outside, such a loop is
said to be
"extended". This loop can only be unrolled by also duplicating the
extended part
  lying outside the loop. Such unrolling is disabled for now.

- Clean up loop hearts: When unrolling a loop with a heart, duplicating
the
heart will introduce multiple static uses of a convergence control token
in a
cycle that does not contain its definition. This violates the static
rules for
tokens, and needs to be cleaned up into a single occurrence of the
intrinsic.

- Spell out the initializer for UnrollLoopOptions to improve
readability.


Original implementation [D85605] by Nicolai Haehnle
&lt;nicolai.haehnle@amd.com&gt;.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- There is no restriction on a loop with controlled convergent
operations when
  the relevant tokens are defined and used within the loop.

- When a token defined outside a loop is used inside (also called a loop
convergence heart), unrolling is allowed only in the absence of
remainder or
  runtime checks.

- When a token defined inside a loop is used outside, such a loop is
said to be
"extended". This loop can only be unrolled by also duplicating the
extended part
  lying outside the loop. Such unrolling is disabled for now.

- Clean up loop hearts: When unrolling a loop with a heart, duplicating
the
heart will introduce multiple static uses of a convergence control token
in a
cycle that does not contain its definition. This violates the static
rules for
tokens, and needs to be cleaned up into a single occurrence of the
intrinsic.

- Spell out the initializer for UnrollLoopOptions to improve
readability.


Original implementation [D85605] by Nicolai Haehnle
&lt;nicolai.haehnle@amd.com&gt;.</pre>
</div>
</content>
</entry>
<entry>
<title>[OpenMP][LLVM] Update alloca IP after `PrivCB` in `OMPIRBUIlder` (#93920)</title>
<updated>2024-06-05T03:13:47+00:00</updated>
<author>
<name>Kareem Ergawy</name>
<email>kareem.ergawy@amd.com</email>
</author>
<published>2024-06-05T03:13:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=7db4e6c1ec18785ad3f622556362d83c11d7efef'/>
<id>7db4e6c1ec18785ad3f622556362d83c11d7efef</id>
<content type='text'>
Fixes a crash uncovered by
[pr77666.f90](https://github.com/llvm/llvm-test-suite/blob/main/Fortran/gfortran/regression/gomp/pr77666.f90)
in the test suite when delayed privatization is enabled by default.

In particular, whenever `PrivCB` (the callback responsible for
generating privatizaiton logic for an OMP variable) generates a
multi-block privatization region, the insertion point diverges: the BB
component of the IP can become a different BB from the parent block of
the instruction iterator component of the IP. This PR updates the IP to
make sure that the BB is the parent block of the instruction iterator.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes a crash uncovered by
[pr77666.f90](https://github.com/llvm/llvm-test-suite/blob/main/Fortran/gfortran/regression/gomp/pr77666.f90)
in the test suite when delayed privatization is enabled by default.

In particular, whenever `PrivCB` (the callback responsible for
generating privatizaiton logic for an OMP variable) generates a
multi-block privatization region, the insertion point diverges: the BB
component of the IP can become a different BB from the parent block of
the instruction iterator component of the IP. This PR updates the IP to
make sure that the BB is the parent block of the instruction iterator.</pre>
</div>
</content>
</entry>
<entry>
<title>[flang][MLIR][OpenMP] make reduction by-ref toggled per variable (#92244)</title>
<updated>2024-05-16T14:27:59+00:00</updated>
<author>
<name>Tom Eccles</name>
<email>tom.eccles@arm.com</email>
</author>
<published>2024-05-16T14:27:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=74a87548e5b62881108e6cd1fd63b45580fc3097'/>
<id>74a87548e5b62881108e6cd1fd63b45580fc3097</id>
<content type='text'>
Fixes #88935

Toggling reduction by-ref broke when multiple reduction clauses were
used. Decisions made for the by-ref status for later clauses could then
invalidate decisions for earlier clauses. For example,

```
reduction(+:scalar,scalar2) reduction(+:array)
```

The first clause would choose by value reduction and generate by-value
reduction regions, but then after this the second clause would force
by-ref to support the array argument. But by the time the second clause
is processed, the first clause has already had the wrong kind of
reduction regions generated.

This is solved by toggling whether a variable should be reduced by
reference per variable. In the above example, this allows only `array`
to be reduced by ref.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes #88935

Toggling reduction by-ref broke when multiple reduction clauses were
used. Decisions made for the by-ref status for later clauses could then
invalidate decisions for earlier clauses. For example,

```
reduction(+:scalar,scalar2) reduction(+:array)
```

The first clause would choose by value reduction and generate by-value
reduction regions, but then after this the second clause would force
by-ref to support the array argument. But by the time the second clause
is processed, the first clause has already had the wrong kind of
reduction regions generated.

This is solved by toggling whether a variable should be reduced by
reference per variable. In the above example, this allows only `array`
to be reduced by ref.</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir][OpenMP] - Honor dependencies in code-generation of the if clause in `omp.task` correctly (#90891)</title>
<updated>2024-05-13T13:54:23+00:00</updated>
<author>
<name>Pranav Bhandarkar</name>
<email>pranav.bhandarkar@amd.com</email>
</author>
<published>2024-05-13T13:54:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=13cd88108f00fc97bcd1e4eb7cc9e4e388928677'/>
<id>13cd88108f00fc97bcd1e4eb7cc9e4e388928677</id>
<content type='text'>
This patch fixes the code generation of the if clause, specifically when the
condition evaluates to false and when the task directive has the depend
clause on it. When the if clause of a task construct evaluates to false,
then the task is an undeferred task. This undeferred task still has to
honor dependencies. Previously, the OpenMPIRbuilder didn't honor
dependencies. This patch fixes that.

Fixes https://github.com/llvm/llvm-project/issues/90869</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch fixes the code generation of the if clause, specifically when the
condition evaluates to false and when the task directive has the depend
clause on it. When the if clause of a task construct evaluates to false,
then the task is an undeferred task. This undeferred task still has to
honor dependencies. Previously, the OpenMPIRbuilder didn't honor
dependencies. This patch fixes that.

Fixes https://github.com/llvm/llvm-project/issues/90869</pre>
</div>
</content>
</entry>
<entry>
<title>[flang][OMPIRBuilder] Keep debug location in sync with insert point. (#89953)</title>
<updated>2024-05-10T09:12:24+00:00</updated>
<author>
<name>Abid Qadeer</name>
<email>haqadeer@amd.com</email>
</author>
<published>2024-05-10T09:12:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=641949654910a533076e35517d084e2961adbdfa'/>
<id>641949654910a533076e35517d084e2961adbdfa</id>
<content type='text'>
A customer reported an issue which I have reduced to the test in the PR.
If built with debug info enabled, the build fails with the following
error in the verifier.

!dbg attachment points at wrong subprogram for function

The problem happened because some of the functions in OMPIRBuilder.cpp
updated the insertion point with the passed in location but did not
change the current debug location. This caused a stale debug location to
be attached to the instruction.

I have solved it by replacing restoreIP with updateToLocation which
updates both the insertion point and debug location. The
updateToLocation is used in many places already, so this PR brings
functions that I have changed in line with rest of the file.

Slight issue is that I am not checking the return type of
updateToLocation as there is no good value I could return in that case.
But if we have a condition where updateToLocation will return false,
these functions will fail in any case.

I have added a test that checks that build does not fail. I was not sure
what is the correct location for the test should be. Happy to move it to
more appropriate location.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A customer reported an issue which I have reduced to the test in the PR.
If built with debug info enabled, the build fails with the following
error in the verifier.

!dbg attachment points at wrong subprogram for function

The problem happened because some of the functions in OMPIRBuilder.cpp
updated the insertion point with the passed in location but did not
change the current debug location. This caused a stale debug location to
be attached to the instruction.

I have solved it by replacing restoreIP with updateToLocation which
updates both the insertion point and debug location. The
updateToLocation is used in many places already, so this PR brings
functions that I have changed in line with rest of the file.

Slight issue is that I am not checking the return type of
updateToLocation as there is no good value I could return in that case.
But if we have a condition where updateToLocation will return false,
these functions will fail in any case.

I have added a test that checks that build does not fail. I was not sure
what is the correct location for the test should be. Happy to move it to
more appropriate location.</pre>
</div>
</content>
</entry>
<entry>
<title>[MLIR][OpenMP] Extend omp.private materialization support: `dealloc` (#90841)</title>
<updated>2024-05-03T06:59:01+00:00</updated>
<author>
<name>Kareem Ergawy</name>
<email>kareem.ergawy@amd.com</email>
</author>
<published>2024-05-03T06:59:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=922ab7089b2eb234afa6fa0e7db85110cd8a3351'/>
<id>922ab7089b2eb234afa6fa0e7db85110cd8a3351</id>
<content type='text'>
Extends current support for delayed privatization during translation to
LLVM IR. This adds support for materlizaing the `dealloc` region in
`omp.private` ops when this region contains clean-up/deallocation logic
that needs to be executed at the end of the parallel region.

This changes the `OMPIRBuilder` slightly to execute the finalization
callback **after** the privatization callback. This allows us to collect
information about privatized variables on the MLIR and LLVM sides so
that we can properly emit deallocation logic.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Extends current support for delayed privatization during translation to
LLVM IR. This adds support for materlizaing the `dealloc` region in
`omp.private` ops when this region contains clean-up/deallocation logic
that needs to be executed at the end of the parallel region.

This changes the `OMPIRBuilder` slightly to execute the finalization
callback **after** the privatization callback. This allows us to collect
information about privatized variables on the MLIR and LLVM sides so
that we can properly emit deallocation logic.</pre>
</div>
</content>
</entry>
<entry>
<title>[OpenMP] Remove 'minncta' attributes from NVPTX kernels (#88398)</title>
<updated>2024-04-15T20:28:05+00:00</updated>
<author>
<name>Joseph Huber</name>
<email>huberjn@outlook.com</email>
</author>
<published>2024-04-15T20:28:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=0287a5cc4e2a5ded1ae2e4079f91052e6a6b8d9b'/>
<id>0287a5cc4e2a5ded1ae2e4079f91052e6a6b8d9b</id>
<content type='text'>
Summary:
Currently we treat this attribute as a minimum number for the amount of
blocks scheduled on the kernel. However, the doucmentation states that
this applies to CTA's mapped onto a *single* SM. Currently we just set
it to the total number of blocks, which will almost always result in a
warning that the value is out of range and will be ignored. We don't
have a good way to automatically know how many CTAs can be put on a
single SM nor if we should do this, so we should probably leave this up
to users manually adding it.


https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#performance-tuning-directives-minnctapersm</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Summary:
Currently we treat this attribute as a minimum number for the amount of
blocks scheduled on the kernel. However, the doucmentation states that
this applies to CTA's mapped onto a *single* SM. Currently we just set
it to the total number of blocks, which will almost always result in a
warning that the value is out of range and will be ignored. We don't
have a good way to automatically know how many CTAs can be put on a
single SM nor if we should do this, so we should probably leave this up
to users manually adding it.


https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#performance-tuning-directives-minnctapersm</pre>
</div>
</content>
</entry>
<entry>
<title>[OpenMP] Add amdgpu-num-work-groups attribute to OpenMP kernels (#87695)</title>
<updated>2024-04-05T12:38:01+00:00</updated>
<author>
<name>Joseph Huber</name>
<email>huberjn@outlook.com</email>
</author>
<published>2024-04-05T12:38:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=2650375b3beeb60596ca38e2e06685e48e8ed01f'/>
<id>2650375b3beeb60596ca38e2e06685e48e8ed01f</id>
<content type='text'>
Summary:
This new attribute was introduced recently. We already do this for NVPTX
kernels so we should apply this for AMDGPU as well. This patch simply
applies this metadata in cases where a lower bound is known</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Summary:
This new attribute was introduced recently. We already do this for NVPTX
kernels so we should apply this for AMDGPU as well. This patch simply
applies this metadata in cases where a lower bound is known</pre>
</div>
</content>
</entry>
<entry>
<title>Reapply "[NFC][RemoveDIs] Switch ConstantExpr::getAsInstruction to not insert (#84737)"</title>
<updated>2024-03-19T15:49:10+00:00</updated>
<author>
<name>Stephen Tozer</name>
<email>stephen.tozer@sony.com</email>
</author>
<published>2024-03-19T15:09:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=9a96fb4445f4e9d9a7899189758ee6afbeb6510b'/>
<id>9a96fb4445f4e9d9a7899189758ee6afbeb6510b</id>
<content type='text'>
Fixes a build error caused by an unupdated getAsInstruction callsite in clang.

This reverts commit ab851f7fe946e7eed700ef9d82082eb721860189.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes a build error caused by an unupdated getAsInstruction callsite in clang.

This reverts commit ab851f7fe946e7eed700ef9d82082eb721860189.
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[NFC][RemoveDIs] Switch ConstantExpr::getAsInstruction to not insert (#84737)"</title>
<updated>2024-03-19T14:41:27+00:00</updated>
<author>
<name>Stephen Tozer</name>
<email>stephen.tozer@sony.com</email>
</author>
<published>2024-03-19T14:41:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=ab851f7fe946e7eed700ef9d82082eb721860189'/>
<id>ab851f7fe946e7eed700ef9d82082eb721860189</id>
<content type='text'>
Reverted due to buildbot failures:
https://lab.llvm.org/buildbot/#/builders/139/builds/61717/

This reverts commit 7ef433f62c199c414bffdcac1c8ee3159b29c5f5.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reverted due to buildbot failures:
https://lab.llvm.org/buildbot/#/builders/139/builds/61717/

This reverts commit 7ef433f62c199c414bffdcac1c8ee3159b29c5f5.
</pre>
</div>
</content>
</entry>
</feed>
