<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/llvm/lib/Support/BlockFrequency.cpp, branch users/nico/python-1</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>[SHT_LLVM_BB_ADDR_MAP] Adds pretty printing of BFI and BPI for PGO Analysis Map in tools. (#82292)</title>
<updated>2024-02-27T19:13:00+00:00</updated>
<author>
<name>Micah Weston</name>
<email>micahsweston@gmail.com</email>
</author>
<published>2024-02-27T19:13:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=9ca8db352d22444feabd859380252f13826a8aff'/>
<id>9ca8db352d22444feabd859380252f13826a8aff</id>
<content type='text'>
Primary change is to add a flag `--pretty-pgo-analysis-map` to
llvm-readobj and llvm-objdump that prints block frequencies and branch
probabilities in the same manner as BFI and BPI respectively. This can
be helpful if you are manually inspecting the outputs from the tools.

In order to print, I moved the `printBlockFreqImpl` function from
Analysis to Support and renamed it to `printRelativeBlockFreq`.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Primary change is to add a flag `--pretty-pgo-analysis-map` to
llvm-readobj and llvm-objdump that prints block frequencies and branch
probabilities in the same manner as BFI and BPI respectively. This can
be helpful if you are manually inspecting the outputs from the tools.

In order to print, I moved the `printBlockFreqImpl` function from
Analysis to Support and renamed it to `printRelativeBlockFreq`.</pre>
</div>
</content>
</entry>
<entry>
<title>Avoid BlockFrequency overflow problems (#66280)</title>
<updated>2023-09-14T18:11:27+00:00</updated>
<author>
<name>Matthias Braun</name>
<email>matze@braunis.de</email>
</author>
<published>2023-09-14T18:11:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=b0c8c454238b495ebe4df25a161a120d1707c230'/>
<id>b0c8c454238b495ebe4df25a161a120d1707c230</id>
<content type='text'>
Multiplying raw block frequency with an integer carries a high risk
of overflow.

- Add `BlockFrequency::mul` return an std::optional with the product
  or `nullopt` to indicate an overflow.
- Fix two instances where overflow was likely.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Multiplying raw block frequency with an integer carries a high risk
of overflow.

- Add `BlockFrequency::mul` return an std::optional with the product
  or `nullopt` to indicate an overflow.
- Fix two instances where overflow was likely.</pre>
</div>
</content>
</entry>
<entry>
<title>[NFC][BlockFrequency] Move operator definitions into header</title>
<updated>2023-06-13T11:23:56+00:00</updated>
<author>
<name>Dhruv Chawla</name>
<email>44582521+dc03@users.noreply.github.com</email>
</author>
<published>2023-06-11T08:01:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=4e069d9cf910967c16fa6929cd15ccc20082533e'/>
<id>4e069d9cf910967c16fa6929cd15ccc20082533e</id>
<content type='text'>
While BlockFrequency::operator+= is a very simple operation, it's
definition is present in another TU which means that it doesn't get
inlined in non-LTO builds. This means that there is some performance
left on the table in those builds, as this operator is called many
times.

This patch moves that operator (and a few others) into the
BlockFrequency.h header which gives a small speedup (~0.1%):
https://llvm-compile-time-tracker.com/compare.php?from=6ee594be53e7efaa12086ad20f0d0268092a4c73&amp;to=6ac6cd99e211fae5ae5de41ad608604aa22f1882&amp;stat=instructions%3Au

Differential Revision: https://reviews.llvm.org/D152781
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
While BlockFrequency::operator+= is a very simple operation, it's
definition is present in another TU which means that it doesn't get
inlined in non-LTO builds. This means that there is some performance
left on the table in those builds, as this operator is called many
times.

This patch moves that operator (and a few others) into the
BlockFrequency.h header which gives a small speedup (~0.1%):
https://llvm-compile-time-tracker.com/compare.php?from=6ee594be53e7efaa12086ad20f0d0268092a4c73&amp;to=6ac6cd99e211fae5ae5de41ad608604aa22f1882&amp;stat=instructions%3Au

Differential Revision: https://reviews.llvm.org/D152781
</pre>
</div>
</content>
</entry>
<entry>
<title>[llvm] Cleanup header dependencies in ADT and Support</title>
<updated>2022-01-21T12:54:49+00:00</updated>
<author>
<name>serge-sans-paille</name>
<email>sguelton@redhat.com</email>
</author>
<published>2022-01-20T11:55:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=75e164f61d391979b4829bf2746a5d74b94e95f2'/>
<id>75e164f61d391979b4829bf2746a5d74b94e95f2</id>
<content type='text'>
The cleanup was manual, but assisted by "include-what-you-use". It consists in

1. Removing unused forward declaration. No impact expected.
2. Removing unused headers in .cpp files. No impact expected.
3. Removing unused headers in .h files. This removes implicit dependencies and
   is generally considered a good thing, but this may break downstream builds.
   I've updated llvm, clang, lld, lldb and mlir deps, and included a list of the
   modification in the second part of the commit.
4. Replacing header inclusion by forward declaration. This has the same impact
   as 3.

Notable changes:

- llvm/Support/TargetParser.h no longer includes llvm/Support/AArch64TargetParser.h nor llvm/Support/ARMTargetParser.h
- llvm/Support/TypeSize.h no longer includes llvm/Support/WithColor.h
- llvm/Support/YAMLTraits.h no longer includes llvm/Support/Regex.h
- llvm/ADT/SmallVector.h no longer includes llvm/Support/MemAlloc.h nor llvm/Support/ErrorHandling.h

You may need to add some of these headers in your compilation units, if needs be.

As an hint to the impact of the cleanup, running

clang++ -E  -Iinclude -I../llvm/include ../llvm/lib/Support/*.cpp -std=c++14 -fno-rtti -fno-exceptions | wc -l

before: 8000919 lines
after:  7917500 lines

Reduced dependencies also helps incremental rebuilds and is more ccache
friendly, something not shown by the above metric :-)

Discourse thread on the topic: https://llvm.discourse.group/t/include-what-you-use-include-cleanup/5831
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The cleanup was manual, but assisted by "include-what-you-use". It consists in

1. Removing unused forward declaration. No impact expected.
2. Removing unused headers in .cpp files. No impact expected.
3. Removing unused headers in .h files. This removes implicit dependencies and
   is generally considered a good thing, but this may break downstream builds.
   I've updated llvm, clang, lld, lldb and mlir deps, and included a list of the
   modification in the second part of the commit.
4. Replacing header inclusion by forward declaration. This has the same impact
   as 3.

Notable changes:

- llvm/Support/TargetParser.h no longer includes llvm/Support/AArch64TargetParser.h nor llvm/Support/ARMTargetParser.h
- llvm/Support/TypeSize.h no longer includes llvm/Support/WithColor.h
- llvm/Support/YAMLTraits.h no longer includes llvm/Support/Regex.h
- llvm/ADT/SmallVector.h no longer includes llvm/Support/MemAlloc.h nor llvm/Support/ErrorHandling.h

You may need to add some of these headers in your compilation units, if needs be.

As an hint to the impact of the cleanup, running

clang++ -E  -Iinclude -I../llvm/include ../llvm/lib/Support/*.cpp -std=c++14 -fno-rtti -fno-exceptions | wc -l

before: 8000919 lines
after:  7917500 lines

Reduced dependencies also helps incremental rebuilds and is more ccache
friendly, something not shown by the above metric :-)

Discourse thread on the topic: https://llvm.discourse.group/t/include-what-you-use-include-cleanup/5831
</pre>
</div>
</content>
</entry>
<entry>
<title>Update the file headers across all of the LLVM projects in the monorepo</title>
<updated>2019-01-19T08:50:56+00:00</updated>
<author>
<name>Chandler Carruth</name>
<email>chandlerc@gmail.com</email>
</author>
<published>2019-01-19T08:50:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=2946cd701067404b99c39fb29dc9c74bd7193eb3'/>
<id>2946cd701067404b99c39fb29dc9c74bd7193eb3</id>
<content type='text'>
to reflect the new license.

We understand that people may be surprised that we're moving the header
entirely to discuss the new license. We checked this carefully with the
Foundation's lawyer and we believe this is the correct approach.

Essentially, all code in the project is now made available by the LLVM
project under our new license, so you will see that the license headers
include that license only. Some of our contributors have contributed
code under our old license, and accordingly, we have retained a copy of
our old license notice in the top-level files in each project and
repository.

llvm-svn: 351636
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
to reflect the new license.

We understand that people may be surprised that we're moving the header
entirely to discuss the new license. We checked this carefully with the
Foundation's lawyer and we believe this is the correct approach.

Essentially, all code in the project is now made available by the LLVM
project under our new license, so you will see that the license headers
include that license only. Some of our contributors have contributed
code under our old license, and accordingly, we have retained a copy of
our old license notice in the top-level files in each project and
repository.

llvm-svn: 351636
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove redundant includes from lib/Support.</title>
<updated>2017-12-13T21:30:58+00:00</updated>
<author>
<name>Michael Zolotukhin</name>
<email>mzolotukhin@apple.com</email>
</author>
<published>2017-12-13T21:30:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=da9f40267730cb5d6ea50840851fa7aa84dcd2a2'/>
<id>da9f40267730cb5d6ea50840851fa7aa84dcd2a2</id>
<content type='text'>
llvm-svn: 320627
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
llvm-svn: 320627
</pre>
</div>
</content>
</entry>
<entry>
<title>Add - and -= operators to BlockFrequency using saturating arithmetic.</title>
<updated>2015-10-12T18:34:00+00:00</updated>
<author>
<name>Cong Hou</name>
<email>congh@google.com</email>
</author>
<published>2015-10-12T18:34:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=61e13de40859751d0c605d7509eeb5a99cf7e9c1'/>
<id>61e13de40859751d0c605d7509eeb5a99cf7e9c1</id>
<content type='text'>
llvm-svn: 250077
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
llvm-svn: 250077
</pre>
</div>
</content>
</entry>
<entry>
<title>Turn const/const&amp; into value type for BlockFrequency in functions of this class. Also fix a naming issue. NFC.</title>
<updated>2015-10-12T18:14:15+00:00</updated>
<author>
<name>Cong Hou</name>
<email>congh@google.com</email>
</author>
<published>2015-10-12T18:14:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=90c6cf8e7da76048dd10fd54bc56b9e45981eaed'/>
<id>90c6cf8e7da76048dd10fd54bc56b9e45981eaed</id>
<content type='text'>
llvm-svn: 250074
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
llvm-svn: 250074
</pre>
</div>
</content>
</entry>
<entry>
<title>Fixed a bug that BranchProbability is not defined in BlockFrequency.cpp. NFC.</title>
<updated>2015-09-11T02:47:30+00:00</updated>
<author>
<name>Cong Hou</name>
<email>congh@google.com</email>
</author>
<published>2015-09-11T02:47:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=c416e4182ae8ecfac02fc91e2eb2efb118915415'/>
<id>c416e4182ae8ecfac02fc91e2eb2efb118915415</id>
<content type='text'>
llvm-svn: 247376
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
llvm-svn: 247376
</pre>
</div>
</content>
</entry>
<entry>
<title>Pass BranchProbability/BlockMass by value instead of const&amp; as they are small. NFC.</title>
<updated>2015-09-10T23:10:42+00:00</updated>
<author>
<name>Cong Hou</name>
<email>congh@google.com</email>
</author>
<published>2015-09-10T23:10:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=c536bd9e73a4a525771e41b15b209dd1149040cd'/>
<id>c536bd9e73a4a525771e41b15b209dd1149040cd</id>
<content type='text'>
llvm-svn: 247357
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
llvm-svn: 247357
</pre>
</div>
</content>
</entry>
</feed>
