History log of /llvm-project/llvm/lib/CodeGen/MachineBlockPlacement.cpp (Results 1 – 25 of 331)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-21-init
# 19a7fe03 22-Jan-2025 Kazu Hirata <kazu@google.com>

[CodeGen] Avoid repeated hash lookups (NFC) (#123894)


Revision tags: llvmorg-19.1.7
# 67efbd0b 08-Jan-2025 Ryan Mansfield <ryan_mansfield@apple.com>

[LLVM] Fix various cl::desc typos and whitespace issues (NFC) (#121955)


Revision tags: llvmorg-19.1.6, llvmorg-19.1.5, llvmorg-19.1.4
# c9260e21 18-Nov-2024 Ellis Hoag <ellis.sparky.hoag@gmail.com>

[CodeLayout] Do not rebuild chains with -apply-ext-tsp-for-size (#115934)

https://github.com/llvm/llvm-project/pull/109711 disables
`buildCFGChains()` when `-apply-ext-tsp-for-size` is used to impr

[CodeLayout] Do not rebuild chains with -apply-ext-tsp-for-size (#115934)

https://github.com/llvm/llvm-project/pull/109711 disables
`buildCFGChains()` when `-apply-ext-tsp-for-size` is used to improve
codesize. Tail merging can change the layout and normally requires
`buildCFGChains()` to be called again, but we want to prevent this when
optimizing for codesize. We saw slight size improvement on large
binaries with this change. If `-apply-ext-tsp-for-size` is not used,
this should be a NFC.

show more ...


# b8d6659b 12-Nov-2024 Ellis Hoag <ellis.sparky.hoag@gmail.com>

[CodeLayout] Do not flip branch condition when using optsize (#114607)

* Do not use profile data when flipping a branch condition when
optimizing for size. This should improving outlining and ICF d

[CodeLayout] Do not flip branch condition when using optsize (#114607)

* Do not use profile data when flipping a branch condition when
optimizing for size. This should improving outlining and ICF due to more
uniform instruction sequences.
* Refactor `optimizeBranches()` to use early `continue`s
* Use the correct debug location for `insertBranch()`

show more ...


Revision tags: llvmorg-19.1.3
# 6ab26eab 28-Oct-2024 Ellis Hoag <ellis.sparky.hoag@gmail.com>

Check hasOptSize() in shouldOptimizeForSize() (#112626)


Revision tags: llvmorg-19.1.2
# cb5fbd2f 10-Oct-2024 Ellis Hoag <ellis.sparky.hoag@gmail.com>

[CodeLayout] Do not verify after assigning blocks (#111754)

Rather than invariantly running `F->verify()` when asserts are enabled,
run machine IR verification in LIT tests only.

Swap `CHECK-PER

[CodeLayout] Do not verify after assigning blocks (#111754)

Rather than invariantly running `F->verify()` when asserts are enabled,
run machine IR verification in LIT tests only.

Swap `CHECK-PERF` and `CHECK-SIZE` in `code_placement_ext_tsp_large.ll`.

Remove `={0,1,true,false}` from flags in tests.

show more ...


# 9016f27c 02-Oct-2024 spupyrev <spupyrev@users.noreply.github.com>

[CodeLayout] Size-aware machine block placement (#109711)

This is an implementation of a new "size-aware" machine block placement.
The
idea is to reorder blocks so that the number of fall-through ju

[CodeLayout] Size-aware machine block placement (#109711)

This is an implementation of a new "size-aware" machine block placement.
The
idea is to reorder blocks so that the number of fall-through jumps is
maximized.
Observe that profile data is ignored for the optimization, and it is
applied only
for instances with hasOptSize()=true.
This strategy has two benefits:
(i) it eliminates jump instructions, which results in smaller text size;
(ii) we avoid using profile data while reordering blocks, which yields
more
"uniform" functions, thus helping ICF and machine outliner/merger.

For large (mobile) apps, the size benefits of (i) and (ii) are roughly
the same,
combined providing up to 0.5% uncompressed and up to 1% compressed
savings size
on top of the current solution.

The optimization is turned off by default.

show more ...


Revision tags: llvmorg-19.1.1
# fbec1c2a 26-Sep-2024 Ellis Hoag <ellis.sparky.hoag@gmail.com>

[NFC][CodeLayout] Remove unused parameter (#110145)

The `NodeCounts` parameter of `calcExtTspScore()` is unused, so remove
it.
Use `SmallVector` since arrays are expected to be small since they
r

[NFC][CodeLayout] Remove unused parameter (#110145)

The `NodeCounts` parameter of `calcExtTspScore()` is unused, so remove
it.
Use `SmallVector` since arrays are expected to be small since they
represent MBBs.

show more ...


# 71ca9fcb 24-Sep-2024 Matt Arsenault <Matthew.Arsenault@amd.com>

llvm-reduce: Don't print verifier failed machine functions (#109673)

This produces far too much terminal output, particularly for the
instruction reduction. Since it doesn't consider the liveness o

llvm-reduce: Don't print verifier failed machine functions (#109673)

This produces far too much terminal output, particularly for the
instruction reduction. Since it doesn't consider the liveness of of
the instructions it's deleting, it produces quite a lot of verifier
errors.

show more ...


# 36dce509 24-Sep-2024 spupyrev <spupyrev@users.noreply.github.com>

[CodeLayout][NFC] Format and minor refactoring of MBP (#109729)

This PR has two (NFC) commits:
- clang-format MBP
- move a part of tail duplication and block aligning into helper
functions for bette

[CodeLayout][NFC] Format and minor refactoring of MBP (#109729)

This PR has two (NFC) commits:
- clang-format MBP
- move a part of tail duplication and block aligning into helper
functions for better readability.

show more ...


Revision tags: llvmorg-19.1.0, llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3
# 862d822d 08-Aug-2024 Alexis Engelke <engelke@in.tum.de>

[CodeGen] Don't renumber invalid domtree (#102427)

Machine block placement might remove nodes from the function but does
not update the dominator tree accordingly. Instead of renumbering (which
mi

[CodeGen] Don't renumber invalid domtree (#102427)

Machine block placement might remove nodes from the function but does
not update the dominator tree accordingly. Instead of renumbering (which
might crash due to accessing removed blocks), set the domtree to null to
make clear that it is invalid at this point.

Fixup of #102107.

show more ...


# d871b2e0 06-Aug-2024 Alexis Engelke <engelke@in.tum.de>

[CodeGen] Use optimized domtree for MachineFunction (#102107)

The dominator tree gained an optimization to use block numbers instead
of a DenseMap to store blocks. Given that machine basic blocks a

[CodeGen] Use optimized domtree for MachineFunction (#102107)

The dominator tree gained an optimization to use block numbers instead
of a DenseMap to store blocks. Given that machine basic blocks already
have numbers, expose these via appropriate GraphTraits. For debugging,
block number epochs are added to MachineFunction -- this greatly helps
in finding uses of block numbers after RenumberBlocks().

In a few cases where dominator trees are preserved across renumberings,
the dominator tree is updated to use the new numbers.

show more ...


Revision tags: llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1
# 5bae81ba 24-Jul-2024 Krzysztof Pszeniczny <kpszeniczny@google.com>

[CodeGen] Add an option to skip extTSP BB placement for huge functions. (#99310)

The extTSP-based basic block layout algorithm improves the performance
of the generated code, but unfortunately it h

[CodeGen] Add an option to skip extTSP BB placement for huge functions. (#99310)

The extTSP-based basic block layout algorithm improves the performance
of the generated code, but unfortunately it has a super-linear time
complexity. This leads to extremely long compilation times for certain
relatively rare kinds of autogenerated code.

This patch adds an `-mllvm` flag to optionally restrict extTSP only to
functions smaller than a specified threshold. While commit
bcdc0477319a26fd8dcdde5ace3bdd6743599f44 added a knob to to limit the
maximum chain size, it's still possible that for certain huge functions
the number of chains is very large, leading to a quadratic behaviour in
ExtTSPImpl::mergeChainPairs.

show more ...


# f0bd705c 24-Jul-2024 John Brawn <john.brawn@arm.com>

[CodeGen] Restore MachineBlockPlacement block ordering (#99351)

PR #91843 changed the algorithm used to find the next unplaced block so
that it iterates through the blocks in BlockFilter instead of

[CodeGen] Restore MachineBlockPlacement block ordering (#99351)

PR #91843 changed the algorithm used to find the next unplaced block so
that it iterates through the blocks in BlockFilter instead of iterating
through the blocks in the function and checking if they are in the block
filter. Unfortunately this sometimes results in a different block
ordering being chosen, as the order of blocks in BlockFilter comes from
the order in MachineLoopInfo, and in some cases this differs from the
order they are in the function. This can also give an end result that
has worse performance.

Fix this by making collectLoopBlockSet place blocks in its output in the
order that they are in the function.

show more ...


Revision tags: llvmorg-20-init
# 09989996 12-Jul-2024 paperchalice <liujunchang97@outlook.com>

[CodeGen][NewPM] Port `machine-block-freq` to new pass manager (#98317)

- Add `MachineBlockFrequencyAnalysis`.
- Add `MachineBlockFrequencyPrinterPass`.
- Use `MachineBlockFrequencyInfoWrapperPass

[CodeGen][NewPM] Port `machine-block-freq` to new pass manager (#98317)

- Add `MachineBlockFrequencyAnalysis`.
- Add `MachineBlockFrequencyPrinterPass`.
- Use `MachineBlockFrequencyInfoWrapperPass` in legacy pass manager.
- `LazyMachineBlockFrequencyInfo::print` is empty, drop it due to new
pass manager migration.

show more ...


# 79d0de2a 09-Jul-2024 paperchalice <liujunchang97@outlook.com>

[CodeGen][NewPM] Port `machine-loops` to new pass manager (#97793)

- Add `MachineLoopAnalysis`.
- Add `MachineLoopPrinterPass`.
- Convert to `MachineLoopInfoWrapperPass` in legacy pass manager.


# d38b518e 28-Jun-2024 paperchalice <liujunchang97@outlook.com>

Reapply "[CodeGen][NewPM] Port machine-branch-prob to new pass manager" (#96858) (#96869)

This reverts commit ab58b6d58edf6a7c8881044fc716ca435d7a0156.
In `CodeGen/Generic/MachineBranchProb.ll`, `l

Reapply "[CodeGen][NewPM] Port machine-branch-prob to new pass manager" (#96858) (#96869)

This reverts commit ab58b6d58edf6a7c8881044fc716ca435d7a0156.
In `CodeGen/Generic/MachineBranchProb.ll`, `llc` crashed with dumped MIR
when targeting PowerPC. Move test to `llc/new-pm`, which is X86
specific.

show more ...


# ab58b6d5 27-Jun-2024 paperchalice <liujunchang97@outlook.com>

Revert "[CodeGen][NewPM] Port machine-branch-prob to new pass manager" (#96858)

Reverts llvm/llvm-project#96389
Some ppc bots failed.


# 73e46c2b 27-Jun-2024 paperchalice <liujunchang97@outlook.com>

[CodeGen][NewPM] Port machine-branch-prob to new pass manager (#96389)

Like IR version `print<branch-prob>`, there is also a
`print<machine-branch-prob>`.


Revision tags: llvmorg-18.1.8
# 75882ed4 14-Jun-2024 William Junda Huang <williamjhuang@google.com>

[Codegen] (NFC) Faster algorithm for MachineBlockPlacement (#91843)

In MachineBlockPlacement, the function getFirstUnplacedBlock is
inefficient because in most cases (for usual loop CFG), this func

[Codegen] (NFC) Faster algorithm for MachineBlockPlacement (#91843)

In MachineBlockPlacement, the function getFirstUnplacedBlock is
inefficient because in most cases (for usual loop CFG), this function
fails to find a candidate, and its complexity becomes O(#(loops in
function) * #(blocks in function)). This makes the compilation of very
long functions slow. This update reduces it to O(k * #(blocks in
function)) where k is the maximum loop nesting depth, by iterating
through the BlockFilter instead.

show more ...


# 4b24c2df 12-Jun-2024 paperchalice <liujunchang97@outlook.com>

[CodeGen][NewPM] Split `MachinePostDominators` into a concrete analysis result (#95113)

`MachinePostDominators` version of #94571.


Revision tags: llvmorg-18.1.7, llvmorg-18.1.6
# 026a29e8 07-May-2024 Kazu Hirata <kazu@google.com>

[Analysis, CodeGen, DebugInfo] Use StringRef::operator== instead of StringRef::equals (NFC) (#91304)

I'm planning to remove StringRef::equals in favor of
StringRef::operator==.

- StringRef::oper

[Analysis, CodeGen, DebugInfo] Use StringRef::operator== instead of StringRef::equals (NFC) (#91304)

I'm planning to remove StringRef::equals in favor of
StringRef::operator==.

- StringRef::operator==/!= outnumber StringRef::equals by a factor of
53 under llvm/ in terms of their usage.

- The elimination of StringRef::equals brings StringRef closer to
std::string_view, which has operator== but not equals.

- S == "foo" is more readable than S.equals("foo"), especially for
!Long.Expression.equals("str") vs Long.Expression != "str".

show more ...


Revision tags: llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2
# 7d269a48 04-Feb-2024 Kazu Hirata <kazu@google.com>

[CodeGen] Use range-based for loops (NFC)


Revision tags: llvmorg-18.1.0-rc1, llvmorg-19-init, llvmorg-17.0.6
# d102f8bd 21-Nov-2023 Freddy Ye <freddy.ye@intel.com>

[MachineBlockPlacement][X86] Use max of MDAlign and TLIAlign to align Loops. (#71026)

This patch added backend consumption on a new loop metadata:
!1 = !{!"llvm.loop.align", i32 64}
which is gener

[MachineBlockPlacement][X86] Use max of MDAlign and TLIAlign to align Loops. (#71026)

This patch added backend consumption on a new loop metadata:
!1 = !{!"llvm.loop.align", i32 64}
which is generated from clang's new loop attribute:
[[clang::code_align()]]
clang patch: #70762

show more ...


Revision tags: llvmorg-17.0.5, llvmorg-17.0.4
# f9306f6d 25-Oct-2023 Kazu Hirata <kazu@google.com>

[ADT] Rename llvm::erase_value to llvm::erase (NFC) (#70156)

C++20 comes with std::erase to erase a value from std::vector. This
patch renames llvm::erase_value to llvm::erase for consistency with

[ADT] Rename llvm::erase_value to llvm::erase (NFC) (#70156)

C++20 comes with std::erase to erase a value from std::vector. This
patch renames llvm::erase_value to llvm::erase for consistency with
C++20.

We could make llvm::erase more similar to std::erase by having it
return the number of elements removed, but I'm not doing that for now
because nobody seems to care about that in our code base.

Since there are only 50 occurrences of erase_value in our code base,
this patch replaces all of them with llvm::erase and deprecates
llvm::erase_value.

show more ...


12345678910>>...14