<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/flang/lib/Optimizer/HLFIR/Transforms/BufferizeHLFIR.cpp, branch users/mingmingl-llvm/samplefdo-profile-format</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] Attach proper storage to [hl]fir.declare in lowering. (#155742)</title>
<updated>2025-09-04T22:49:11+00:00</updated>
<author>
<name>Slava Zakharin</name>
<email>szakharin@nvidia.com</email>
</author>
<published>2025-09-04T22:49:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=83da8d08ff110fd5bf3fff17043420ba442e300c'/>
<id>83da8d08ff110fd5bf3fff17043420ba442e300c</id>
<content type='text'>
As described in
https://discourse.llvm.org/t/rfc-flang-representation-for-objects-inside-physical-storage/88026,
`[hl]fir.declare` should carry information about the layout
of COMMON/EQUIVALENCE variables within the physical storage.

This patch modifes Flang lowering to attach this information.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
As described in
https://discourse.llvm.org/t/rfc-flang-representation-for-objects-inside-physical-storage/88026,
`[hl]fir.declare` should carry information about the layout
of COMMON/EQUIVALENCE variables within the physical storage.

This patch modifes Flang lowering to attach this information.</pre>
</div>
</content>
</entry>
<entry>
<title>[flang] Fix `replaceAllUsesWith` API violations (1/N) (#154698)</title>
<updated>2025-08-21T09:48:14+00:00</updated>
<author>
<name>Matthias Springer</name>
<email>me@m-sp.org</email>
</author>
<published>2025-08-21T09:48:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=60ee0560da2f6996c422eb8a6cbbdb59ee27b826'/>
<id>60ee0560da2f6996c422eb8a6cbbdb59ee27b826</id>
<content type='text'>
`replaceAllUsesWith` is not safe to use in a dialect conversion and will
be deactivated soon (#154112). Fix commit fixes some API violations.
Also some general improvements.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
`replaceAllUsesWith` is not safe to use in a dialect conversion and will
be deactivated soon (#154112). Fix commit fixes some API violations.
Also some general improvements.</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir][NFC] update `flang/lib` create APIs (12/n) (#149914)</title>
<updated>2025-07-24T23:05:40+00:00</updated>
<author>
<name>Maksim Levental</name>
<email>maksim.levental@gmail.com</email>
</author>
<published>2025-07-24T23:05:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=dcfc853c51aecf6538182378c016f8e1604e7e97'/>
<id>dcfc853c51aecf6538182378c016f8e1604e7e97</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] Migrate away from ArrayRef(std::nullopt_t) (#149337)</title>
<updated>2025-07-17T22:23:55+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2025-07-17T22:23:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=2a7328dacae39e87ca4cc7548b9abcdba60b946b'/>
<id>2a7328dacae39e87ca4cc7548b9abcdba60b946b</id>
<content type='text'>
ArrayRef(std::nullopt_t) has been deprecated.  This patch replaces
std::nullopt with {}.

A subsequence patch will address those places where we need to replace
std::nullopt with mlir::TypeRange{} or mlir::ValueRange{}.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
ArrayRef(std::nullopt_t) has been deprecated.  This patch replaces
std::nullopt with {}.

A subsequence patch will address those places where we need to replace
std::nullopt with mlir::TypeRange{} or mlir::ValueRange{}.</pre>
</div>
</content>
</entry>
<entry>
<title>[flang][hlfir] do not propagate polymorphic temporary as allocatables (#142609)</title>
<updated>2025-06-06T07:53:41+00:00</updated>
<author>
<name>jeanPerier</name>
<email>jperier@nvidia.com</email>
</author>
<published>2025-06-06T07:53:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=6a41f53c39cb4a40a9085e26697f3460eb8bedb1'/>
<id>6a41f53c39cb4a40a9085e26697f3460eb8bedb1</id>
<content type='text'>
Polymorphic temporary are currently propagated as
fir.ref&lt;fir.class&lt;fir.heap&lt;&gt;&gt;&gt; because their allocation may be delayed
to the hlfir.assign copy (using realloc).

This patch moves away from this and directly allocate the temp and
propagate it as a fir.class.

The polymorphic temporaries creating is also simplified by avoiding the
need to call the runtime to setup the descriptor altogether (the runtime
is still call for the allocation currently because alloca/allocmem do
not support polymorphism).</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Polymorphic temporary are currently propagated as
fir.ref&lt;fir.class&lt;fir.heap&lt;&gt;&gt;&gt; because their allocation may be delayed
to the hlfir.assign copy (using realloc).

This patch moves away from this and directly allocate the temp and
propagate it as a fir.class.

The polymorphic temporaries creating is also simplified by avoiding the
need to call the runtime to setup the descriptor altogether (the runtime
is still call for the allocation currently because alloca/allocmem do
not support polymorphism).</pre>
</div>
</content>
</entry>
<entry>
<title>[flang] Code generation for fir.pack/unpack_array. (#132080)</title>
<updated>2025-03-31T18:42:17+00:00</updated>
<author>
<name>Slava Zakharin</name>
<email>szakharin@nvidia.com</email>
</author>
<published>2025-03-31T18:42:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=5f268d04f9898cb0f8d4a1371a7b22dc3c35e5fc'/>
<id>5f268d04f9898cb0f8d4a1371a7b22dc3c35e5fc</id>
<content type='text'>
The code generation relies on `ShallowCopyDirect` runtime
to copy data between the original and the temporary arrays
(both directions). The allocations are done by the compiler
generated code. The heap allocations could have been passed
to `ShallowCopy` runtime, but I decided to expose the allocations
so that the temporary descriptor passed to `ShallowCopyDirect`
has `nocapture` - maybe this will be better for LLVM optimizations.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The code generation relies on `ShallowCopyDirect` runtime
to copy data between the original and the temporary arrays
(both directions). The allocations are done by the compiler
generated code. The heap allocations could have been passed
to `ShallowCopy` runtime, but I decided to expose the allocations
so that the temporary descriptor passed to `ShallowCopyDirect`
has `nocapture` - maybe this will be better for LLVM optimizations.</pre>
</div>
</content>
</entry>
<entry>
<title>[flang] Reset all extents to zero for empty hlfir.elemental loops. (#124867)</title>
<updated>2025-01-29T20:03:05+00:00</updated>
<author>
<name>Slava Zakharin</name>
<email>szakharin@nvidia.com</email>
</author>
<published>2025-01-29T20:03:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=bac95752748a46f3c2e9ebeda67e7df2ea642e07'/>
<id>bac95752748a46f3c2e9ebeda67e7df2ea642e07</id>
<content type='text'>
An hlfir.elemental with a shape `(0, HUGE)` still runs `HUGE`
number of iterations when expanded into a loop nest.
HLFIR transformational operations inlined as hlfir.elemental
may execute slower comparing to Fortran runtime implementation.
This patch adds an option for BufferizeHLFIR pass to reset all
upper bounds in the elemental loop nests to zero, if the result
is an empty array.

A separate patch will enable this option in the driver after I do
more performance testing. The option is off by default now.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
An hlfir.elemental with a shape `(0, HUGE)` still runs `HUGE`
number of iterations when expanded into a loop nest.
HLFIR transformational operations inlined as hlfir.elemental
may execute slower comparing to Fortran runtime implementation.
This patch adds an option for BufferizeHLFIR pass to reset all
upper bounds in the elemental loop nests to zero, if the result
is an empty array.

A separate patch will enable this option in the driver after I do
more performance testing. The option is off by default now.</pre>
</div>
</content>
</entry>
<entry>
<title>[flang] Allow non-index length parameter on exprs fed into hlfir.get_length. (#124827)</title>
<updated>2025-01-29T20:01:13+00:00</updated>
<author>
<name>Slava Zakharin</name>
<email>szakharin@nvidia.com</email>
</author>
<published>2025-01-29T20:01:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=b8708753c89db07eb6993559b4546e5a97d94530'/>
<id>b8708753c89db07eb6993559b4546e5a97d94530</id>
<content type='text'>
The length might be any integer, so hlfir.get_length lowering
should explicitly cast it to `index`.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The length might be any integer, so hlfir.get_length lowering
should explicitly cast it to `index`.</pre>
</div>
</content>
</entry>
<entry>
<title>[flang][hlfir] fix issue 118922 (#119219)</title>
<updated>2024-12-10T14:00:32+00:00</updated>
<author>
<name>jeanPerier</name>
<email>jperier@nvidia.com</email>
</author>
<published>2024-12-10T14:00:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=28a0ad09c1c1184f667e2655318a138aa51dc9e8'/>
<id>28a0ad09c1c1184f667e2655318a138aa51dc9e8</id>
<content type='text'>
hlfir.elemental codegen optimize-out the final as_expr copy for temps
local to its body, but sometimes, clean-up may have been emitted for
this temp, and the code did not handle that.
This caused #118922 and @113843.

Only elide the copy if the as_expr is the last op.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
hlfir.elemental codegen optimize-out the final as_expr copy for temps
local to its body, but sometimes, clean-up may have been emitted for
this temp, and the code did not handle that.
This caused #118922 and @113843.

Only elide the copy if the as_expr is the last op.</pre>
</div>
</content>
</entry>
<entry>
<title>[flang][hlfir] add hlfir.eval_in_mem operation (#118067)</title>
<updated>2024-12-02T08:52:29+00:00</updated>
<author>
<name>jeanPerier</name>
<email>jperier@nvidia.com</email>
</author>
<published>2024-12-02T08:52:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a545cf5c6da6decbde95287f95e1ffce40116d23'/>
<id>a545cf5c6da6decbde95287f95e1ffce40116d23</id>
<content type='text'>
See HLFIROps.td change for the description of the operation.

The goal is to ease temporary storage elision for expression evaluation
(typically evaluating the RHS directly inside the LHS) for expressions
that do not have abtsractions in HLFIR and for which it is not clear
adding one would bring much. The case that is implemented in [the
following lowering
patch](https://github.com/llvm/llvm-project/pull/118070) is the array
call case, where adding a new hlfir.call would add complexity (needs to
deal with dispatch, inlining ....).</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
See HLFIROps.td change for the description of the operation.

The goal is to ease temporary storage elision for expression evaluation
(typically evaluating the RHS directly inside the LHS) for expressions
that do not have abtsractions in HLFIR and for which it is not clear
adding one would bring much. The case that is implemented in [the
following lowering
patch](https://github.com/llvm/llvm-project/pull/118070) is the array
call case, where adding a new hlfir.call would add complexity (needs to
deal with dispatch, inlining ....).</pre>
</div>
</content>
</entry>
</feed>
