<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/flang/lib/Optimizer/Transforms/MemoryAllocation.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>[mlir][NFC] update `flang/Optimizer/Transforms` create APIs (11/n)  (#149915)</title>
<updated>2025-07-21T23:37:17+00:00</updated>
<author>
<name>Maksim Levental</name>
<email>maksim.levental@gmail.com</email>
</author>
<published>2025-07-21T23:37:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=46f6df0848ea04449c6179ecdedc404ee5b5cf11'/>
<id>46f6df0848ea04449c6179ecdedc404ee5b5cf11</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] handle alloca outside of entry blocks in MemoryAllocation (#98457)</title>
<updated>2024-07-17T07:15:47+00:00</updated>
<author>
<name>jeanPerier</name>
<email>jperier@nvidia.com</email>
</author>
<published>2024-07-17T07:15:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=31087c5e4c8ddfe08ab3ea6d3847e05c4738eeee'/>
<id>31087c5e4c8ddfe08ab3ea6d3847e05c4738eeee</id>
<content type='text'>
This patch generalizes the MemoryAllocation pass (alloca -&gt; heap) to
handle fir.alloca regardless of their postion in the IR. Currently, it
only dealt with fir.alloca in function entry blocks. The logic is placed
in a utility that can be used to replace alloca in an operation on
demand to whatever kind of allocation the utility user wants via
callbacks (allocmem, or custom runtime calls to instrument the code...).

To do so, a concept of ownership, that was already implied a bit and
used in passes like stack-reclaim, is formalized. Any operation with the
LoopLikeInterface, AutomaticAllocationScope, or IsolatedFromAbove owns
the alloca directly nested inside its regions, and they must not be used
after the operation.

The pass then looks for the exit points of region with such interface,
and use that to insert deallocation. If dominance is not proved, the
pass fallbacks to storing the new address into a C pointer variable
created in the entry of the owning region which allows inserting
deallocation as needed, included near the alloca itself to avoid leaks
when the alloca is executed multiple times due to block CFGs loops.

This should fix https://github.com/llvm/llvm-project/issues/88344.

In a next step, I will try to refactor lowering a bit to introduce
lifetime operation for alloca so that the deallocation points can be
inserted as soon as possible.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch generalizes the MemoryAllocation pass (alloca -&gt; heap) to
handle fir.alloca regardless of their postion in the IR. Currently, it
only dealt with fir.alloca in function entry blocks. The logic is placed
in a utility that can be used to replace alloca in an operation on
demand to whatever kind of allocation the utility user wants via
callbacks (allocmem, or custom runtime calls to instrument the code...).

To do so, a concept of ownership, that was already implied a bit and
used in passes like stack-reclaim, is formalized. Any operation with the
LoopLikeInterface, AutomaticAllocationScope, or IsolatedFromAbove owns
the alloca directly nested inside its regions, and they must not be used
after the operation.

The pass then looks for the exit points of region with such interface,
and use that to insert deallocation. If dominance is not proved, the
pass fallbacks to storing the new address into a C pointer variable
created in the entry of the owning region which allows inserting
deallocation as needed, included near the alloca itself to avoid leaks
when the alloca is executed multiple times due to block CFGs loops.

This should fix https://github.com/llvm/llvm-project/issues/88344.

In a next step, I will try to refactor lowering a bit to introduce
lifetime operation for alloca so that the deallocation points can be
inserted as soon as possible.</pre>
</div>
</content>
</entry>
<entry>
<title>mlir/LogicalResult: move into llvm (#97309)</title>
<updated>2024-07-02T09:42:33+00:00</updated>
<author>
<name>Ramkumar Ramachandra</name>
<email>ramkumar.ramachandra@codasip.com</email>
</author>
<published>2024-07-02T09:42:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=db791b278a414fb6df1acc1799adcf11d8fb9169'/>
<id>db791b278a414fb6df1acc1799adcf11d8fb9169</id>
<content type='text'>
This patch is part of a project to move the Presburger library into
LLVM.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch is part of a project to move the Presburger library into
LLVM.</pre>
</div>
</content>
</entry>
<entry>
<title>Reapply "[mlir] Mark `isa/dyn_cast/cast/...` member functions depreca… (#90406)</title>
<updated>2024-04-28T20:01:42+00:00</updated>
<author>
<name>Christian Sigg</name>
<email>chsigg@users.noreply.github.com</email>
</author>
<published>2024-04-28T20:01:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=fac349a169976f822fb27f03e623fa0d28aec1f3'/>
<id>fac349a169976f822fb27f03e623fa0d28aec1f3</id>
<content type='text'>
…ted. (#89998)" (#90250)

This partially reverts commit 7aedd7dc754c74a49fe84ed2640e269c25414087.

This change removes calls to the deprecated member functions. It does
not mark the functions deprecated yet and does not disable the
deprecation warning in TypeSwitch. This seems to cause problems with
MSVC.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
…ted. (#89998)" (#90250)

This partially reverts commit 7aedd7dc754c74a49fe84ed2640e269c25414087.

This change removes calls to the deprecated member functions. It does
not mark the functions deprecated yet and does not disable the
deprecation warning in TypeSwitch. This seems to cause problems with
MSVC.</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[mlir] Mark `isa/dyn_cast/cast/...` member functions deprecated. (#89998)" (#90250)</title>
<updated>2024-04-26T19:09:13+00:00</updated>
<author>
<name>dyung</name>
<email>douglas.yung@sony.com</email>
</author>
<published>2024-04-26T19:09:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=7aedd7dc754c74a49fe84ed2640e269c25414087'/>
<id>7aedd7dc754c74a49fe84ed2640e269c25414087</id>
<content type='text'>
This reverts commit 950b7ce0b88318f9099e9a7c9817d224ebdc6337.

This change is causing build failures on a bot
https://lab.llvm.org/buildbot/#/builders/216/builds/38157</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 950b7ce0b88318f9099e9a7c9817d224ebdc6337.

This change is causing build failures on a bot
https://lab.llvm.org/buildbot/#/builders/216/builds/38157</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir] Mark `isa/dyn_cast/cast/...` member functions deprecated. (#89998)</title>
<updated>2024-04-26T14:28:30+00:00</updated>
<author>
<name>Christian Sigg</name>
<email>chsigg@users.noreply.github.com</email>
</author>
<published>2024-04-26T14:28:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=950b7ce0b88318f9099e9a7c9817d224ebdc6337'/>
<id>950b7ce0b88318f9099e9a7c9817d224ebdc6337</id>
<content type='text'>
See https://mlir.llvm.org/deprecation and
https://discourse.llvm.org/t/preferred-casting-style-going-forward.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
See https://mlir.llvm.org/deprecation and
https://discourse.llvm.org/t/preferred-casting-style-going-forward.</pre>
</div>
</content>
</entry>
<entry>
<title>[flang][NFC] Use tablegen to reduce MemoryAllocationOpt boilerplate (#90062)</title>
<updated>2024-04-26T09:56:56+00:00</updated>
<author>
<name>Tom Eccles</name>
<email>tom.eccles@arm.com</email>
</author>
<published>2024-04-26T09:56:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=213ab9610ced9152f70f5b9777347c28e777a0ff'/>
<id>213ab9610ced9152f70f5b9777347c28e777a0ff</id>
<content type='text'>
This is another one that runs on functions but isn't appropriate to also
run on other top level operations. It needs to find all paths that
return from the function to free heap allocated memory. There isn't a
generic concept for general top level operations which is equivalent to
looking for function returns.

I removed the manual definition of the options structure because there
is already an identical definition in tablegen and the options are
documented in Passes.td.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is another one that runs on functions but isn't appropriate to also
run on other top level operations. It needs to find all paths that
return from the function to free heap allocated memory. There isn't a
generic concept for general top level operations which is equivalent to
looking for function returns.

I removed the manual definition of the options structure because there
is already an identical definition in tablegen and the options are
documented in Passes.td.</pre>
</div>
</content>
</entry>
<entry>
<title>[flang] Fix use-after-free in `MemoryAllocation.cpp` (#83768)</title>
<updated>2024-03-04T06:54:22+00:00</updated>
<author>
<name>Matthias Springer</name>
<email>me@m-sp.org</email>
</author>
<published>2024-03-04T06:54:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=354deba10a99136a3204dfa8128e53cd6e9558a7'/>
<id>354deba10a99136a3204dfa8128e53cd6e9558a7</id>
<content type='text'>
`AllocaOpConversion` takes an `ArrayRef&lt;Operation *&gt;`, but the
underlying `SmallVector&lt;Operation *&gt;` was dead by the time the pattern
ran.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
`AllocaOpConversion` takes an `ArrayRef&lt;Operation *&gt;`, but the
underlying `SmallVector&lt;Operation *&gt;` was dead by the time the pattern
ran.</pre>
</div>
</content>
</entry>
<entry>
<title>mlir/tblgen: use std::optional in generation</title>
<updated>2022-12-17T10:13:26+00:00</updated>
<author>
<name>Ramkumar Ramachandra</name>
<email>r@artagnon.com</email>
</author>
<published>2022-12-14T10:39:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=22426110c5ef329d9ff40212cd8e589b5c132667'/>
<id>22426110c5ef329d9ff40212cd8e589b5c132667</id>
<content type='text'>
This is part of an effort to migrate from llvm::Optional to
std::optional. This patch changes the way mlir-tblgen generates .inc
files, and modifies tests and documentation appropriately. It is a "no
compromises" patch, and doesn't leave the user with an unpleasant mix of
llvm::Optional and std::optional.

A non-trivial change has been made to ControlFlowInterfaces to split one
constructor into two, relating to a build failure on Windows.

See also: https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

Signed-off-by: Ramkumar Ramachandra &lt;r@artagnon.com&gt;

Differential Revision: https://reviews.llvm.org/D138934
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is part of an effort to migrate from llvm::Optional to
std::optional. This patch changes the way mlir-tblgen generates .inc
files, and modifies tests and documentation appropriately. It is a "no
compromises" patch, and doesn't leave the user with an unpleasant mix of
llvm::Optional and std::optional.

A non-trivial change has been made to ControlFlowInterfaces to split one
constructor into two, relating to a build failure on Windows.

See also: https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

Signed-off-by: Ramkumar Ramachandra &lt;r@artagnon.com&gt;

Differential Revision: https://reviews.llvm.org/D138934
</pre>
</div>
</content>
</entry>
<entry>
<title>[flang][mlir][arith] Fix flang build after dialect renaming</title>
<updated>2022-09-29T15:55:49+00:00</updated>
<author>
<name>Jakub Kuderski</name>
<email>kubak@google.com</email>
</author>
<published>2022-09-29T15:55:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=6c8d8d10455a3d38a92102ae3a94e1c06d3eb363'/>
<id>6c8d8d10455a3d38a92102ae3a94e1c06d3eb363</id>
<content type='text'>
Tested with `ninja check-flang`
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Tested with `ninja check-flang`
</pre>
</div>
</content>
</entry>
</feed>
