<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/flang/lib/Lower/Support/ReductionProcessor.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][OpenMP] Restore reduction processor behavior broken by #145837 (#150178)</title>
<updated>2025-07-23T09:23:00+00:00</updated>
<author>
<name>Kareem Ergawy</name>
<email>kareem.ergawy@amd.com</email>
</author>
<published>2025-07-23T09:23:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=36c37b019b5daae79785e8558d693e6ec42b0ebd'/>
<id>36c37b019b5daae79785e8558d693e6ec42b0ebd</id>
<content type='text'>
Fixes #149089 and #149700.

Before #145837, when processing a reduction symbol not yet supported by
OpenMP lowering, the reduction processor would simply skip filling in
the reduction symbols and variables. With #145837, this behvaior was
slightly changed because the reduction symbols are populated before
invoking the reduction processor (this is more convenient to shared the
code with `do concurrent`).

This PR restores the previous behavior.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes #149089 and #149700.

Before #145837, when processing a reduction symbol not yet supported by
OpenMP lowering, the reduction processor would simply skip filling in
the reduction symbols and variables. With #145837, this behvaior was
slightly changed because the reduction symbols are populated before
invoking the reduction processor (this is more convenient to shared the
code with `do concurrent`).

This PR restores the previous behavior.</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir][NFC] update `flang/Lower` create APIs (8/n) (#149912)</title>
<updated>2025-07-21T23:54:29+00:00</updated>
<author>
<name>Maksim Levental</name>
<email>maksim.levental@gmail.com</email>
</author>
<published>2025-07-21T23:54:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a3a007ad5fa20abc90ead4e1030b481bf109b4cf'/>
<id>a3a007ad5fa20abc90ead4e1030b481bf109b4cf</id>
<content type='text'>
See https://github.com/llvm/llvm-project/pull/147168 for more info.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
See https://github.com/llvm/llvm-project/pull/147168 for more info.</pre>
</div>
</content>
</entry>
<entry>
<title>[flang][Lower] fix warning (#148667)</title>
<updated>2025-07-14T16:59:50+00:00</updated>
<author>
<name>Tom Eccles</name>
<email>tom.eccles@arm.com</email>
</author>
<published>2025-07-14T16:59:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=3d6aac31fcb5f7a988be5e484e44bdc9033265c5'/>
<id>3d6aac31fcb5f7a988be5e484e44bdc9033265c5</id>
<content type='text'>
GCC 9.3.0
```
.../flang/lib/Lower/Support/ReductionProcessor.cpp:137:1: error: control reaches end of non-void function [-Werror=return-type]
```</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
GCC 9.3.0
```
.../flang/lib/Lower/Support/ReductionProcessor.cpp:137:1: error: control reaches end of non-void function [-Werror=return-type]
```</pre>
</div>
</content>
</entry>
<entry>
<title>[flang] Support `do concurrent ... reduce` for associating names (#148597)</title>
<updated>2025-07-14T10:18:16+00:00</updated>
<author>
<name>Kareem Ergawy</name>
<email>kareem.ergawy@amd.com</email>
</author>
<published>2025-07-14T10:18:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a716cc0961d1b0fa76aba78a2509253d0646f41d'/>
<id>a716cc0961d1b0fa76aba78a2509253d0646f41d</id>
<content type='text'>
Extends reduction support for `do concurrent`, in particular, for
associating names. Consider the following input:
```fortran
subroutine dc_associate_reduce
  integer :: i
  real, allocatable, dimension(:) :: x

  associate(x_associate =&gt; x)
  do concurrent (i = 1:10) reduce(+: x_associate)
  end do
  end associate
end subroutine
```

The declaration of `x_associate` is emitted as follows:
```mlir
%13:2 = hlfir.declare %10(%12) {uniq_name = "...."} : (!fir.heap&lt;!fir.array&lt;?xf32&gt;&gt;, !fir.shapeshift&lt;1&gt;) -&gt; (!fir.box&lt;!fir.array&lt;?xf32&gt;&gt;, !fir.heap&lt;!fir.array&lt;?xf32&gt;&gt;)
```
where the HLFIR base type is an array descriptor (i.e. the
allocatable/heap attribute is dropped as stipulated by the spec; section
11.1.3.3).

The problem here is that `declare_reduction` ops accept only reference
types. This restriction is already partially handled for
`fir::BaseBoxType`'s by allocating a stack slot for the descriptor and
storing the box in that stack allocation. We have to modify this a
littble bit for `associate` since the HLFIR and FIR base types are
different (unlike most scenarios).</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Extends reduction support for `do concurrent`, in particular, for
associating names. Consider the following input:
```fortran
subroutine dc_associate_reduce
  integer :: i
  real, allocatable, dimension(:) :: x

  associate(x_associate =&gt; x)
  do concurrent (i = 1:10) reduce(+: x_associate)
  end do
  end associate
end subroutine
```

The declaration of `x_associate` is emitted as follows:
```mlir
%13:2 = hlfir.declare %10(%12) {uniq_name = "...."} : (!fir.heap&lt;!fir.array&lt;?xf32&gt;&gt;, !fir.shapeshift&lt;1&gt;) -&gt; (!fir.box&lt;!fir.array&lt;?xf32&gt;&gt;, !fir.heap&lt;!fir.array&lt;?xf32&gt;&gt;)
```
where the HLFIR base type is an array descriptor (i.e. the
allocatable/heap attribute is dropped as stipulated by the spec; section
11.1.3.3).

The problem here is that `declare_reduction` ops accept only reference
types. This restriction is already partially handled for
`fir::BaseBoxType`'s by allocating a stack slot for the descriptor and
storing the box in that stack allocation. We have to modify this a
littble bit for `associate` since the HLFIR and FIR base types are
different (unlike most scenarios).</pre>
</div>
</content>
</entry>
<entry>
<title>[flang][do concurrent] Extned `getAllocaBlock()` and emit yields correctly (#146853)</title>
<updated>2025-07-11T08:17:17+00:00</updated>
<author>
<name>Kareem Ergawy</name>
<email>kareem.ergawy@amd.com</email>
</author>
<published>2025-07-11T08:17:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=ab1c4905f4dc3bdeb05bff1f3de24f73d6d612e4'/>
<id>ab1c4905f4dc3bdeb05bff1f3de24f73d6d612e4</id>
<content type='text'>
Handles some loose ends in `do concurrent` reduction declarations. This
PR extends `getAllocaBlock` to handle declare ops, and also emit
`fir.yield` in all regions.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Handles some loose ends in `do concurrent` reduction declarations. This
PR extends `getAllocaBlock` to handle declare ops, and also emit
`fir.yield` in all regions.</pre>
</div>
</content>
</entry>
<entry>
<title>[NFC][flang] Move `ReductionProcessor` to `Lower/Support`. (#146025)</title>
<updated>2025-07-11T05:42:51+00:00</updated>
<author>
<name>Kareem Ergawy</name>
<email>kareem.ergawy@amd.com</email>
</author>
<published>2025-07-11T05:42:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=7c8a197918a0c4044c1be39a26d517eea95a5ec9'/>
<id>7c8a197918a0c4044c1be39a26d517eea95a5ec9</id>
<content type='text'>
With #145837, the `ReductionProcessor` component is now used by both
OpenMP and `do concurrent`. Therefore, this PR moves it to a shared
location: `flang/Lower/Support`.

PR stack:
- https://github.com/llvm/llvm-project/pull/145837
- https://github.com/llvm/llvm-project/pull/146025 (this one)
- https://github.com/llvm/llvm-project/pull/146028
- https://github.com/llvm/llvm-project/pull/146033</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
With #145837, the `ReductionProcessor` component is now used by both
OpenMP and `do concurrent`. Therefore, this PR moves it to a shared
location: `flang/Lower/Support`.

PR stack:
- https://github.com/llvm/llvm-project/pull/145837
- https://github.com/llvm/llvm-project/pull/146025 (this one)
- https://github.com/llvm/llvm-project/pull/146028
- https://github.com/llvm/llvm-project/pull/146033</pre>
</div>
</content>
</entry>
</feed>
