<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/llvm/lib/CodeGen/MachineFunctionAnalysis.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>[llvm] Support building with c++23 (#154372)</title>
<updated>2025-08-29T12:52:07+00:00</updated>
<author>
<name>Kyle Krüger</name>
<email>7158199+kykrueger@users.noreply.github.com</email>
</author>
<published>2025-08-29T12:52:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=5d0294fcb61560a228e230e8a477fc44746ec62b'/>
<id>5d0294fcb61560a228e230e8a477fc44746ec62b</id>
<content type='text'>
closes #154331 

This PR addresses all minimum changes needed to compile LLVM and MLIR
with the c++23 standard.
It is a work in progress and to be reviewed for better methods of
handling the parts of the build broken by c++23.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
closes #154331 

This PR addresses all minimum changes needed to compile LLVM and MLIR
with the c++23 standard.
It is a work in progress and to be reviewed for better methods of
handling the parts of the build broken by c++23.</pre>
</div>
</content>
</entry>
<entry>
<title>[CodeGen][NPM] Clear MachineFunctions without using PA (#148113)</title>
<updated>2025-07-18T06:28:01+00:00</updated>
<author>
<name>Vikram Hegde</name>
<email>115221833+vikramRH@users.noreply.github.com</email>
</author>
<published>2025-07-18T06:28:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=06528070fce04d580821b3448f1d5321e0a9a97b'/>
<id>06528070fce04d580821b3448f1d5321e0a9a97b</id>
<content type='text'>
same as https://github.com/llvm/llvm-project/pull/139517

This replaces the InvalidateAnalysisPass&lt;MachineFunctionAnalysis&gt; pass.

There are no cross-function analysis requirements right now, so clearing
all analyses works for the last pass in the pipeline.

Having the InvalidateAnalysisPass&lt;MachineFunctionAnalysis&gt;() is causing
a problem with ModuleToCGSCCPassAdaptor by deleting machine functions
for other functions and ending up with exactly one correctly compiled
MF, with the rest being vanished.

This is because ModuleToCGSCCPAdaptor propagates PassPA (received from
the CGSCCToFunctionPassAdaptor that runs the actual codegen pipeline on
MFs) to the next SCC. That causes MFA invalidation on functions in the
next SCC.

For us, PassPA happens to be returned from
invalidate&lt;machine-function-analysis&gt; which abandons the
MachineFunctionAnalysis. So while the first function runs through the
pipeline normally, invalidate also deletes the functions in the next SCC
before its pipeline is run. (this seems to be the intended mechanism of
the CG adaptor to allow cross-SCC invalidations.

Co-authored-by : Oke, Akshat
&lt;[Akshat.Oke@amd.com](mailto:Akshat.Oke@amd.com)&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
same as https://github.com/llvm/llvm-project/pull/139517

This replaces the InvalidateAnalysisPass&lt;MachineFunctionAnalysis&gt; pass.

There are no cross-function analysis requirements right now, so clearing
all analyses works for the last pass in the pipeline.

Having the InvalidateAnalysisPass&lt;MachineFunctionAnalysis&gt;() is causing
a problem with ModuleToCGSCCPassAdaptor by deleting machine functions
for other functions and ending up with exactly one correctly compiled
MF, with the rest being vanished.

This is because ModuleToCGSCCPAdaptor propagates PassPA (received from
the CGSCCToFunctionPassAdaptor that runs the actual codegen pipeline on
MFs) to the next SCC. That causes MFA invalidation on functions in the
next SCC.

For us, PassPA happens to be returned from
invalidate&lt;machine-function-analysis&gt; which abandons the
MachineFunctionAnalysis. So while the first function runs through the
pipeline normally, invalidate also deletes the functions in the next SCC
before its pipeline is run. (this seems to be the intended mechanism of
the CG adaptor to allow cross-SCC invalidations.

Co-authored-by : Oke, Akshat
&lt;[Akshat.Oke@amd.com](mailto:Akshat.Oke@amd.com)&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>CodeGen: Remove MachineModuleInfo reference from MachineFunction (#100357)</title>
<updated>2024-07-26T09:10:08+00:00</updated>
<author>
<name>Matt Arsenault</name>
<email>Matthew.Arsenault@amd.com</email>
</author>
<published>2024-07-26T09:10:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=63e1647827f3427c5f3ad37461d84a63ba5fcdaf'/>
<id>63e1647827f3427c5f3ad37461d84a63ba5fcdaf</id>
<content type='text'>
This avoids another unserializable field. Move the DbgInfoAvailable
field into the AsmPrinter, which is only really a cache/convenience
bit for checking a direct IR module metadata check.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This avoids another unserializable field. Move the DbgInfoAvailable
field into the AsmPrinter, which is only really a cache/convenience
bit for checking a direct IR module metadata check.</pre>
</div>
</content>
</entry>
<entry>
<title>[IR] Remove Function.h include from Analysis.h (NFC) (#97056)</title>
<updated>2024-06-28T14:41:00+00:00</updated>
<author>
<name>Nikita Popov</name>
<email>npopov@redhat.com</email>
</author>
<published>2024-06-28T14:41:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=c0866cefe9bc524d8f31400413fcc14de10c50e2'/>
<id>c0866cefe9bc524d8f31400413fcc14de10c50e2</id>
<content type='text'>
Use a forward-declaration instead.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use a forward-declaration instead.</pre>
</div>
</content>
</entry>
<entry>
<title>[NewPM][CodeGen] Add `MachineFunctionAnalysis` (#88610)</title>
<updated>2024-04-30T01:54:48+00:00</updated>
<author>
<name>paperchalice</name>
<email>liujunchang97@outlook.com</email>
</author>
<published>2024-04-30T01:54:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=6ea0c0a28343b2676baf480db490b5a27fa11d7c'/>
<id>6ea0c0a28343b2676baf480db490b5a27fa11d7c</id>
<content type='text'>
In new pass system, `MachineFunction` could be an analysis result again,
machine module pass can now fetch them from analysis manager.
`MachineModuleInfo` no longer owns them.
Remove `FreeMachineFunctionPass`, replaced by
`InvalidateAnalysisPass&lt;MachineFunctionAnalysis&gt;`.

Now `FreeMachineFunction` is replaced by
`InvalidateAnalysisPass&lt;MachineFunctionAnalysis&gt;`, the workaround in
`MachineFunctionPassManager` is no longer needed, there is no difference
between `unittests/MIR/PassBuilderCallbacksTest.cpp` and
`unittests/IR/PassBuilderCallbacksTest.cpp`.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In new pass system, `MachineFunction` could be an analysis result again,
machine module pass can now fetch them from analysis manager.
`MachineModuleInfo` no longer owns them.
Remove `FreeMachineFunctionPass`, replaced by
`InvalidateAnalysisPass&lt;MachineFunctionAnalysis&gt;`.

Now `FreeMachineFunction` is replaced by
`InvalidateAnalysisPass&lt;MachineFunctionAnalysis&gt;`, the workaround in
`MachineFunctionPassManager` is no longer needed, there is no difference
between `unittests/MIR/PassBuilderCallbacksTest.cpp` and
`unittests/IR/PassBuilderCallbacksTest.cpp`.</pre>
</div>
</content>
</entry>
<entry>
<title>CodeGen: Remove MachineFunctionAnalysis =&gt; Enable (Machine)ModulePasses</title>
<updated>2016-08-24T01:52:46+00:00</updated>
<author>
<name>Matthias Braun</name>
<email>matze@braunis.de</email>
</author>
<published>2016-08-24T01:52:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=733fe3676c629b25edcae79d3ba3ccb24e6c6cb3'/>
<id>733fe3676c629b25edcae79d3ba3ccb24e6c6cb3</id>
<content type='text'>
Re-apply this patch, hopefully I will get away without any warnings
in the constructor now.

This patch removes the MachineFunctionAnalysis. Instead we keep a
map from IR Function to MachineFunction in the MachineModuleInfo.

This allows the insertion of ModulePasses into the codegen pipeline
without breaking it because the MachineFunctionAnalysis gets dropped
before a module pass.

Peak memory should stay unchanged without a ModulePass in the codegen
pipeline: Previously the MachineFunction was freed at the end of a codegen
function pipeline because the MachineFunctionAnalysis was dropped; With
this patch the MachineFunction is freed after the AsmPrinter has
finished.

Differential Revision: http://reviews.llvm.org/D23736

llvm-svn: 279602
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Re-apply this patch, hopefully I will get away without any warnings
in the constructor now.

This patch removes the MachineFunctionAnalysis. Instead we keep a
map from IR Function to MachineFunction in the MachineModuleInfo.

This allows the insertion of ModulePasses into the codegen pipeline
without breaking it because the MachineFunctionAnalysis gets dropped
before a module pass.

Peak memory should stay unchanged without a ModulePass in the codegen
pipeline: Previously the MachineFunction was freed at the end of a codegen
function pipeline because the MachineFunctionAnalysis was dropped; With
this patch the MachineFunction is freed after the AsmPrinter has
finished.

Differential Revision: http://reviews.llvm.org/D23736

llvm-svn: 279602
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert r279564. It introduces undefined behavior (binding a reference to a</title>
<updated>2016-08-23T22:08:27+00:00</updated>
<author>
<name>Richard Smith</name>
<email>richard-llvm@metafoo.co.uk</email>
</author>
<published>2016-08-23T22:08:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=8c3fbdc6c4649f8c3c018cf32be4407c672e574c'/>
<id>8c3fbdc6c4649f8c3c018cf32be4407c672e574c</id>
<content type='text'>
dereferenced null pointer) in MachineModuleInfo::MachineModuleInfo that causes
-Werror builds (including several buildbots) to fail.

llvm-svn: 279580
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
dereferenced null pointer) in MachineModuleInfo::MachineModuleInfo that causes
-Werror builds (including several buildbots) to fail.

llvm-svn: 279580
</pre>
</div>
</content>
</entry>
<entry>
<title>CodeGen: Remove MachineFunctionAnalysis =&gt; Enable (Machine)ModulePasses</title>
<updated>2016-08-23T20:58:29+00:00</updated>
<author>
<name>Matthias Braun</name>
<email>matze@braunis.de</email>
</author>
<published>2016-08-23T20:58:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=4c1f1f120c9da460a7b1d1f24936499d8caeae11'/>
<id>4c1f1f120c9da460a7b1d1f24936499d8caeae11</id>
<content type='text'>
Re-apply this commit with the deletion of a MachineFunction delegated to
a separate pass to avoid use after free when doing this directly in
AsmPrinter.

This patch removes the MachineFunctionAnalysis. Instead we keep a
map from IR Function to MachineFunction in the MachineModuleInfo.

This allows the insertion of ModulePasses into the codegen pipeline
without breaking it because the MachineFunctionAnalysis gets dropped
before a module pass.

Peak memory should stay unchanged without a ModulePass in the codegen
pipeline: Previously the MachineFunction was freed at the end of a codegen
function pipeline because the MachineFunctionAnalysis was dropped; With
this patch the MachineFunction is freed after the AsmPrinter has
finished.

Differential Revision: http://reviews.llvm.org/D23736

llvm-svn: 279564
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Re-apply this commit with the deletion of a MachineFunction delegated to
a separate pass to avoid use after free when doing this directly in
AsmPrinter.

This patch removes the MachineFunctionAnalysis. Instead we keep a
map from IR Function to MachineFunction in the MachineModuleInfo.

This allows the insertion of ModulePasses into the codegen pipeline
without breaking it because the MachineFunctionAnalysis gets dropped
before a module pass.

Peak memory should stay unchanged without a ModulePass in the codegen
pipeline: Previously the MachineFunction was freed at the end of a codegen
function pipeline because the MachineFunctionAnalysis was dropped; With
this patch the MachineFunction is freed after the AsmPrinter has
finished.

Differential Revision: http://reviews.llvm.org/D23736

llvm-svn: 279564
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "(HEAD -&gt; master, origin/master, origin/HEAD) CodeGen: Remove MachineFunctionAnalysis =&gt; Enable (Machine)ModulePasses"</title>
<updated>2016-08-23T05:17:11+00:00</updated>
<author>
<name>Matthias Braun</name>
<email>matze@braunis.de</email>
</author>
<published>2016-08-23T05:17:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=7f66202d38148a7c5b1cf6723de9d442f5566e46'/>
<id>7f66202d38148a7c5b1cf6723de9d442f5566e46</id>
<content type='text'>
Reverting while tracking down a use after free.

This reverts commit r279502.

llvm-svn: 279503
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reverting while tracking down a use after free.

This reverts commit r279502.

llvm-svn: 279503
</pre>
</div>
</content>
</entry>
<entry>
<title>CodeGen: Remove MachineFunctionAnalysis =&gt; Enable (Machine)ModulePasses</title>
<updated>2016-08-23T03:20:09+00:00</updated>
<author>
<name>Matthias Braun</name>
<email>matze@braunis.de</email>
</author>
<published>2016-08-23T03:20:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=fd936841ebefb39a383fe651126998f6728efcbc'/>
<id>fd936841ebefb39a383fe651126998f6728efcbc</id>
<content type='text'>
This patch removes the MachineFunctionAnalysis. Instead we keep a
map from IR Function to MachineFunction in the MachineModuleInfo.

This allows the insertion of ModulePasses into the codegen pipeline
without breaking it because the MachineFunctionAnalysis gets dropped
before a module pass.

Peak memory should stay unchanged without a ModulePass in the codegen
pipeline: Previously the MachineFunction was freed at the end of a codegen
function pipeline because the MachineFunctionAnalysis was dropped; With
this patch the MachineFunction is freed after the AsmPrinter has
finished.

Differential Revision: http://reviews.llvm.org/D23736

llvm-svn: 279502
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch removes the MachineFunctionAnalysis. Instead we keep a
map from IR Function to MachineFunction in the MachineModuleInfo.

This allows the insertion of ModulePasses into the codegen pipeline
without breaking it because the MachineFunctionAnalysis gets dropped
before a module pass.

Peak memory should stay unchanged without a ModulePass in the codegen
pipeline: Previously the MachineFunction was freed at the end of a codegen
function pipeline because the MachineFunctionAnalysis was dropped; With
this patch the MachineFunction is freed after the AsmPrinter has
finished.

Differential Revision: http://reviews.llvm.org/D23736

llvm-svn: 279502
</pre>
</div>
</content>
</entry>
</feed>
