<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/bolt/lib/Passes/FrameAnalysis.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>[BOLT][NFC] Fix for a dangling reference UB (#163344)</title>
<updated>2025-10-14T09:00:35+00:00</updated>
<author>
<name>Slava Gurevich</name>
<email>sgurevich@gmail.com</email>
</author>
<published>2025-10-14T09:00:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=4a8dd4998dae8b7d67e416d20a1fa8a9451c64f5'/>
<id>4a8dd4998dae8b7d67e416d20a1fa8a9451c64f5</id>
<content type='text'>
Fix UB caused by accessing the top element of the stack via a dangling
reference after a call to .pop() This is tripping static analysis.

No functional changes. Performance impact is negligible, but alt.
implementation of the fix is possible if needed.

Testing: Both functional and unit tests are passing.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix UB caused by accessing the top element of the stack via a dangling
reference after a call to .pop() This is tripping static analysis.

No functional changes. Performance impact is negligible, but alt.
implementation of the fix is possible if needed.

Testing: Both functional and unit tests are passing.</pre>
</div>
</content>
</entry>
<entry>
<title>[BOLT] Remove unused local variables (NFC) (#140421)</title>
<updated>2025-05-18T00:43:29+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2025-05-18T00:43:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=d08833f23fc8b25e1c3ef88274aa12f330601932'/>
<id>d08833f23fc8b25e1c3ef88274aa12f330601932</id>
<content type='text'>
While I'm at it, this patch removes GetExecutablePath, which becomes
unused after removing the sole use.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
While I'm at it, this patch removes GetExecutablePath, which becomes
unused after removing the sole use.</pre>
</div>
</content>
</entry>
<entry>
<title>[BOLT][NFC] Move CallGraph from Passes to Core (#96922)</title>
<updated>2024-06-27T23:34:47+00:00</updated>
<author>
<name>shaw young</name>
<email>58664393+shawbyoung@users.noreply.github.com</email>
</author>
<published>2024-06-27T23:34:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=2430a354bfb9e8c08e0dd5f294012b40afb75ce0'/>
<id>2430a354bfb9e8c08e0dd5f294012b40afb75ce0</id>
<content type='text'>
Moved CallGraph and BinaryFunctionCallGraph from Passes to
Core for future use in stale matching.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Moved CallGraph and BinaryFunctionCallGraph from Passes to
Core for future use in stale matching.</pre>
</div>
</content>
</entry>
<entry>
<title>[NFC][BOLT] Remove dead code (SPTAllocatorsId) (#91477)</title>
<updated>2024-05-08T17:20:11+00:00</updated>
<author>
<name>Kristof Beyls</name>
<email>kristof.beyls@arm.com</email>
</author>
<published>2024-05-08T17:20:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=46435ac19e09039fb146fa6c12da0e640a66d435'/>
<id>46435ac19e09039fb146fa6c12da0e640a66d435</id>
<content type='text'>
It seems that SPTAllocatorsId is no longer used in FrameAnalysis, so
let's remove it.

It seems the use of SPTAllocatorsId was removed back in 2019, in commit
cc8415406c7.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It seems that SPTAllocatorsId is no longer used in FrameAnalysis, so
let's remove it.

It seems the use of SPTAllocatorsId was removed back in 2019, in commit
cc8415406c7.</pre>
</div>
</content>
</entry>
<entry>
<title>[BOLT][NFC] Log through JournalingStreams (#81524)</title>
<updated>2024-02-12T22:53:53+00:00</updated>
<author>
<name>Amir Ayupov</name>
<email>aaupov@fb.com</email>
</author>
<published>2024-02-12T22:53:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=52cf07116bf0a8cab87b0f55176d198bcaa02575'/>
<id>52cf07116bf0a8cab87b0f55176d198bcaa02575</id>
<content type='text'>
Make core BOLT functionality more friendly to being used as a
library instead of in our standalone driver llvm-bolt. To
accomplish this, we augment BinaryContext with journaling streams
that are to be used by most BOLT code whenever something needs to
be logged to the screen. Users of the library can decide if logs
should be printed to a file, no file or to the screen, as
before. To illustrate this, this patch adds a new option
`--log-file` that allows the user to redirect BOLT logging to a
file on disk or completely hide it by using
`--log-file=/dev/null`. Future BOLT code should now use
`BinaryContext::outs()` for printing important messages instead of
`llvm::outs()`. A new test log.test enforces this by verifying that
no strings are print to screen once the `--log-file` option is
used.

In previous patches we also added a new BOLTError class to report
common and fatal errors, so code shouldn't call exit(1) now. To
easily handle problems as before (by quitting with exit(1)),
callers can now use
`BinaryContext::logBOLTErrorsAndQuitOnFatal(Error)` whenever code
needs to deal with BOLT errors. To test this, we have fatal.s
that checks we are correctly quitting and printing a fatal error
to the screen.

Because this is a significant change by itself, not all code was
yet ported. Code from Profiler libs (DataAggregator and friends)
still print errors directly to screen.

Co-authored-by: Rafael Auler &lt;rafaelauler@fb.com&gt;

Test Plan: NFC</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Make core BOLT functionality more friendly to being used as a
library instead of in our standalone driver llvm-bolt. To
accomplish this, we augment BinaryContext with journaling streams
that are to be used by most BOLT code whenever something needs to
be logged to the screen. Users of the library can decide if logs
should be printed to a file, no file or to the screen, as
before. To illustrate this, this patch adds a new option
`--log-file` that allows the user to redirect BOLT logging to a
file on disk or completely hide it by using
`--log-file=/dev/null`. Future BOLT code should now use
`BinaryContext::outs()` for printing important messages instead of
`llvm::outs()`. A new test log.test enforces this by verifying that
no strings are print to screen once the `--log-file` option is
used.

In previous patches we also added a new BOLTError class to report
common and fatal errors, so code shouldn't call exit(1) now. To
easily handle problems as before (by quitting with exit(1)),
callers can now use
`BinaryContext::logBOLTErrorsAndQuitOnFatal(Error)` whenever code
needs to deal with BOLT errors. To test this, we have fatal.s
that checks we are correctly quitting and printing a fatal error
to the screen.

Because this is a significant change by itself, not all code was
yet ported. Code from Profiler libs (DataAggregator and friends)
still print errors directly to screen.

Co-authored-by: Rafael Auler &lt;rafaelauler@fb.com&gt;

Test Plan: NFC</pre>
</div>
</content>
</entry>
<entry>
<title>[BOLT][NFC] Use llvm::is_contained</title>
<updated>2023-03-14T22:37:03+00:00</updated>
<author>
<name>Amir Ayupov</name>
<email>amir.aupov@gmail.com</email>
</author>
<published>2023-03-14T22:36:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=2eae9d8eb2f6afb8d795d32e232e9d1a520f3860'/>
<id>2eae9d8eb2f6afb8d795d32e232e9d1a520f3860</id>
<content type='text'>
Apply the replacement throughout BOLT.

Reviewed By: #bolt, rafauler

Differential Revision: https://reviews.llvm.org/D145464
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Apply the replacement throughout BOLT.

Reviewed By: #bolt, rafauler

Differential Revision: https://reviews.llvm.org/D145464
</pre>
</div>
</content>
</entry>
<entry>
<title>[BOLT][NFC] Use llvm::any_of</title>
<updated>2022-08-28T04:36:15+00:00</updated>
<author>
<name>Amir Ayupov</name>
<email>aaupov@fb.com</email>
</author>
<published>2022-08-19T22:57:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=f119a2483d4fd72fe88bfc367822bcd045117e1e'/>
<id>f119a2483d4fd72fe88bfc367822bcd045117e1e</id>
<content type='text'>
Replace the imperative pattern of the following kind
```
bool IsTrue = false;
for (Element : Range) {
  if (Condition(Element)) {
    IsTrue = true;
    break;
  }
}
```
with functional style `llvm::any_of`:
```
bool IsTrue = llvm::any_of(Range, [&amp;](Element) {
  return Condition(Element);
});
```

Reviewed By: rafauler

Differential Revision: https://reviews.llvm.org/D132276
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Replace the imperative pattern of the following kind
```
bool IsTrue = false;
for (Element : Range) {
  if (Condition(Element)) {
    IsTrue = true;
    break;
  }
}
```
with functional style `llvm::any_of`:
```
bool IsTrue = llvm::any_of(Range, [&amp;](Element) {
  return Condition(Element);
});
```

Reviewed By: rafauler

Differential Revision: https://reviews.llvm.org/D132276
</pre>
</div>
</content>
</entry>
<entry>
<title>LLVM_FALLTHROUGH =&gt; [[fallthrough]]. NFC</title>
<updated>2022-08-09T04:06:52+00:00</updated>
<author>
<name>Fangrui Song</name>
<email>i@maskray.me</email>
</author>
<published>2022-08-09T04:06:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=0972a390b9c74cd994ad0250cf392aecb67502a3'/>
<id>0972a390b9c74cd994ad0250cf392aecb67502a3</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[BOLT] Add function layout class</title>
<updated>2022-07-17T00:23:24+00:00</updated>
<author>
<name>Fabian Parzefall</name>
<email>parzefall@fb.com</email>
</author>
<published>2022-07-17T00:23:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=8477bc67614a45d9bbd5caa407bb376069789c7b'/>
<id>8477bc67614a45d9bbd5caa407bb376069789c7b</id>
<content type='text'>
This patch adds a dedicated class to keep track of each function's
layout. It also lays the groundwork for splitting functions into
multiple fragments (as opposed to a strict hot/cold split).

Reviewed By: maksfb

Differential Revision: https://reviews.llvm.org/D129518
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch adds a dedicated class to keep track of each function's
layout. It also lays the groundwork for splitting functions into
multiple fragments (as opposed to a strict hot/cold split).

Reviewed By: maksfb

Differential Revision: https://reviews.llvm.org/D129518
</pre>
</div>
</content>
</entry>
<entry>
<title>[BOLT] Increase coverage of shrink wrapping [5/5]</title>
<updated>2022-07-12T00:30:13+00:00</updated>
<author>
<name>Rafael Auler</name>
<email>rafaelauler@fb.com</email>
</author>
<published>2022-05-21T03:10:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a3cfdd746e96a2e45953e5db1a6c87b925d16c8d'/>
<id>a3cfdd746e96a2e45953e5db1a6c87b925d16c8d</id>
<content type='text'>
Add -experimental-shrink-wrapping flag to control when we
want to move callee-saved registers even when addresses of the stack
frame are captured and used in pointer arithmetic, making it more
challenging to do alias analysis to prove that we do not access
optimized stack positions. This alias analysis is not yet implemented,
hence, it is experimental. In practice, though, no compiler would emit
code to do pointer arithmetic to access a saved callee-saved register
unless there is a memory bug or we are failing to identify a
callee-saved reg, so I'm not sure how useful it would be to formally
prove that.

Reviewed By: Amir

Differential Revision: https://reviews.llvm.org/D126115
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add -experimental-shrink-wrapping flag to control when we
want to move callee-saved registers even when addresses of the stack
frame are captured and used in pointer arithmetic, making it more
challenging to do alias analysis to prove that we do not access
optimized stack positions. This alias analysis is not yet implemented,
hence, it is experimental. In practice, though, no compiler would emit
code to do pointer arithmetic to access a saved callee-saved register
unless there is a memory bug or we are failing to identify a
callee-saved reg, so I'm not sure how useful it would be to formally
prove that.

Reviewed By: Amir

Differential Revision: https://reviews.llvm.org/D126115
</pre>
</div>
</content>
</entry>
</feed>
