| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
| |
This reverts commit a72165e5df59032cdd54dcb18155f2630d73abd1.
Some buildbots have not been updated yet.
|
|
|
|
|
|
| |
This reverts commit 92523a35a827539db8557bbc3ecab7f9ea3f6ade.
Test whether all CI runners are updated.
|
|
|
|
|
|
|
| |
Vladislav Khmelevsky,
Advanced Software Technology Lab, Huawei
Differential Revision: https://reviews.llvm.org/D146085
|
| |
|
|
|
|
|
|
|
|
| |
Move out prepareToParse lambda, generalize it to handle mem events perf process.
Reviewed By: #bolt, rafauler
Differential Revision: https://reviews.llvm.org/D146002
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D146104
|
|
|
|
|
|
|
|
|
| |
The two methods don't belong in BinaryFunction methods.
Move the dispatch tables into target-specific MCPlusBuilder methods.
Reviewed By: rafauler
Differential Revision: https://reviews.llvm.org/D131813
|
|
|
|
|
|
|
|
|
| |
Pre-calculate the register size table in MCPlusBuilder constructor,
similar to `AliasMap`/`SmallerAliasMap` in `initAliases`.
Reviewed By: #bolt, rafauler
Differential Revision: https://reviews.llvm.org/D145828
|
|
|
|
|
|
|
|
| |
Simplifies D145687
Reviewed By: #bolt, rafauler
Differential Revision: https://reviews.llvm.org/D145972
|
|
|
|
|
|
|
|
| |
Apply the replacement throughout BOLT.
Reviewed By: #bolt, rafauler
Differential Revision: https://reviews.llvm.org/D145464
|
|
|
|
|
|
| |
Reviewed By: #bolt, rafauler
Differential Revision: https://reviews.llvm.org/D144924
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The golang support creates 2 new data segments, one of them contains
relocations in PIC binaries, so the section must have writable rights.
Currently BOLT creates only one new segment that contains new sections
with RX rights, now also create RW segment if there are any new writable
sections were allocated during BOLT binary processing.
Vladislav Khmelevsky,
Advanced Software Technology Lab, Huawei
Differential Revision: https://reviews.llvm.org/D143390
|
|
|
|
|
|
|
|
|
|
| |
Leverage move semantics for `std::vector`.
This also makes it consistent with `createInstrumentationSnippet`.
Reviewed By: Elvina
Differential Revision: https://reviews.llvm.org/D145465
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It was using a redundant iteration over super regs to build
SmallerAliasMap. Removing this results in exactly the same alias maps
and a noticeable performance gain on targets with a large number of
registers.
Just anecdotally: on my machine, processing a small AArch64 binary went
from 2.7s down to 80ms.
Reviewed By: Amir
Differential Revision: https://reviews.llvm.org/D145779
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D144865
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch fixes few problems with supporting dynamic relocations in CI.
1. After dynamic relocations and functions were read search for dynamic
relocations located in functions. Currently we expected them only to be
relative and only to be in constant island. Mark islands of such
functions to have dynamic relocations and create CI access symbol on the
relocation offset, so the BD would be created for such place.
2. During function disassemble and handling address reference for
constant island check if the referred external CI has dynamic
relocation. And if it has one we would continue to refer original CI
rather then creating a local copy.
3. After function disassembly stage mark function that has dynamic reloc
in CI as non-simple. We don't want such functions to be optimized, since
such passes as split function would create 2 copies of CI which we
unable to support currently.
4. During updating output values for BF search for BD located in CI and
update their output locations.
5. On dynamic relocation patching stage search for binary data located
on relocation offset. If it was moved use new relocation offset value
rather then an old one.
Vladislav Khmelevsky,
Advanced Software Technology Lab, Huawei
Differential Revision: https://reviews.llvm.org/D143748
|
|
|
|
|
|
|
| |
Some build bots have not been updated to the new minimal CMake version.
Reverting for now and ping the buildbot owners.
This reverts commit 44c6b905f8527635e49bb3ea97dea315f92d38ec.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This partly undoes D137724.
This change has been discussed on discourse
https://discourse.llvm.org/t/rfc-upgrading-llvms-minimum-required-cmake-version/66193
Note this does not remove work-arounds for older CMake versions, that
will be done in followup patches.
Reviewed By: mehdi_amini, MaskRay, ChuanqiXu, to268, thieta, tschuett, phosek, #libunwind, #libc_vendors, #libc, #libc_abi, sivachandra, philnik, zibi
Differential Revision: https://reviews.llvm.org/D144509
|
|
|
|
|
|
|
|
|
|
| |
Allow a function with tail calls only to clobber its red zone.
Fixes https://github.com/llvm/llvm-project/issues/61114.
Reviewed By: #bolt, yota9
Differential Revision: https://reviews.llvm.org/D145202
|
|
|
|
|
|
|
|
|
|
| |
Remove the usage of StringMap in places where the iteration order
affects the output since the iteration over StringMap is
non-deterministic.
Reviewed By: Amir
Differential Revision: https://reviews.llvm.org/D145194
|
|
|
|
|
|
| |
Reviewed By: #bolt, maksfb
Differential Revision: https://reviews.llvm.org/D144758
|
|
|
|
|
|
|
|
| |
Expose log for testing purposes.
Reviewed By: #bolt, maksfb
Differential Revision: https://reviews.llvm.org/D144674
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In case of a function with unknown control flow but with a single jump
table and a single jump table site, we attempt to match the jump table
and a site and update block successors using jump table targets.
Restrict this behavior for split jump tables which have targets in a
fragment function.
Fixes https://github.com/llvm/llvm-project/issues/60795.
Reviewed By: #bolt, rafauler
Differential Revision: https://reviews.llvm.org/D144602
|
|
|
|
|
|
|
|
|
| |
Avoid modifying `BF`, instead set extra output parameter and modify BF in caller
scope.
Reviewed By: #bolt, rafauler
Differential Revision: https://reviews.llvm.org/D144598
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
ICF optimization runs multiple passes and the order in which functions
are folded could be dependent on the order they are being processed.
This order is indeterministic as functions are intermediately stored in
std::unordered_map<>. Note that this order is mostly stable, but is not
guaranteed to be and can change e.g. after switching to a different C++
library implementation.
Because the processing (and folding) order is indeterministic, the
previous way of calculating merged function call count could produce
different results.
Change the way we calculate the ICF call count to make it independent of
the function folding/processing order.
Mostly NFC as the output binary should remain the same, the change
affects only the console output.
Reviewed By: yota9
Differential Revision: https://reviews.llvm.org/D144807
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When createInstrumentedIndirectCall() was invoked for tail calls, we
attached annotation instruction twice to the new call instruction.
First in createDirectCall(), and then again while copying over the
metadata operands.
As a result, the annotations were not properly stripped for such calls
before the call to freeAnnotations() in LowerAnnotations pass. That lead
to use-after-free while restoring the offsets with setOffset() call.
Reviewed By: yota9
Differential Revision: https://reviews.llvm.org/D144806
|
|
|
|
|
|
|
| |
The two tests were failing on arm64-linux with:
BOLT-ERROR: invalid target 'x86-64'.
Differential Revision: https://reviews.llvm.org/D144593
|
|
|
|
|
|
| |
Reviewed By: Amir
Differential Revision: https://reviews.llvm.org/D144551
|
|
|
|
|
|
|
|
|
| |
Simplify `MCPlusBuilder::evaluateX86MemoryOperand`: make it return a struct
with memory operand analysis struct `X86MemOperand`.
Reviewed By: #bolt, rafauler
Differential Revision: https://reviews.llvm.org/D144310
|
|
|
|
|
|
| |
Use proper relocation for aarch64
Differential Revision: https://reviews.llvm.org/D144095
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
relative offsets.
Avoid replacing one adr instruction with two adrp+add by utilizing linker-provided nops
when they are present. By doing so we preserve relative offsets of next instructions
in a function which reduces chances to break undetected jump tables. This commit makes
release-mode lld-linked clang, lld and etc work after BOLT.
Reviewed By: rafauler, yota9
Differential Revision: https://reviews.llvm.org/D143887
|
|
|
|
|
|
| |
D144079
Differential Revision: https://reviews.llvm.org/D144344
|
|
|
|
|
|
|
|
|
| |
`isChildOf` is a more concise name for the check. Also, there's no need to
test if the function is a fragment before doing `isChildOf` check.
Reviewed By: #bolt, rafauler, maksfb
Differential Revision: https://reviews.llvm.org/D142667
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix llvm-bolt-wrapper to skip output file checks if llvm-bolt exits with error
code.
Test Plan:
- checkout to revision with invalid NFC mismatch in `is-strip.s` test
(e.g. 056af487831fb573e6895901d1e48f93922f9635~)
- run `nfc-check-setup.py`
- run `bin/llvm-lit -a tools/bolt/test/X86/is-strip.s`
Reviewed By: #bolt, rafauler
Differential Revision: https://reviews.llvm.org/D143614
|
|
|
|
|
|
|
|
| |
YAML specification does not allow keys duplication an a mapping. However, YAML
parser in LLVM does not have any check on that and uses only the last key entry.
In this change duplicated keys are merged to satisfy the spec.
Differential Revision: https://reviews.llvm.org/D141848
|
|
|
|
|
|
|
|
|
|
|
| |
In lite mode, include split function fragments to the list of functions to
process even if a fragment has no samples. This is required to properly
detect and update split jump tables (jump tables that contain pointers to code
in the main and cold fragments).
Reviewed By: #bolt, maksfb
Differential Revision: https://reviews.llvm.org/D140457
|
|
|
|
|
|
|
|
|
|
|
| |
We need to search referenced section based on relocations symbol section
to properly match end section symbols. For example on some binaries we
can observe that init_array_end/fini_array_end might be "placed" in to
the gap and since no section could be found for address the relocation
would be skipped resulting in wrong ADRP imm after emitting new text
resulting in binary sigsegv.
Credits for the test to Vladislav Khmelevskii aka yota9.
|
| |
|
|
|
|
|
|
| |
I also ran `git clang-format` to get the headers in the right order for
the new location, which has changed the order of other headers in two
files.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reject stripped binaries as a policy.
The core issue with stripped binaries is that we can't detect the presence
of split functions which require extra handling. Therefore BOLT can't ensure
functional correctness of produced binary if the input stripped binary contains
split functions. Supporting such cases is an interesting problem but it goes
against BOLT's intended goal of achieving peak program performance.
Reviewed By: maksfb
Differential Revision: https://reviews.llvm.org/D142686
|
|
|
|
|
|
|
|
|
|
| |
Follow LLVM Coding Standards guideline on using anonymous namespaces
(https://llvm.org/docs/CodingStandards.html#anonymous-namespaces)
and use `static` modifier for function definitions.
Reviewed By: #bolt, maksfb
Differential Revision: https://reviews.llvm.org/D143124
|
|
|
|
|
|
| |
GCC on AArch64 uses DW_CFA_GNU_NegateRAState for return address signing.
Differential Revision: https://reviews.llvm.org/D142572
|
|
|
|
|
|
|
|
|
|
| |
Follow the code style of fallible constructors in [LLVM Programmer's Manual]
(https://llvm.org/docs/ProgrammersManual.html#fallible-constructors)
and rename `RewriteInstance::createRewriteInstance` to `RewriteInstance::create`
Reviewed By: #bolt, rafauler
Differential Revision: https://reviews.llvm.org/D143119
|
|
|
|
|
|
| |
Reviewed By: rafauler
Differential Revision: https://reviews.llvm.org/D143117
|
|
|
|
|
|
| |
Reviewed By: #bolt, rafauler
Differential Revision: https://reviews.llvm.org/D143019
|
|
|
|
|
|
|
|
|
|
|
|
| |
The dependence is needed since Utils includes VCSRevision.h, and other
LLVM components that include this header also have the llvm_vcsrevision_h
dependency.
Fixes #60460.
Reviewed By: #bolt, ayermolo
Differential Revision: https://reviews.llvm.org/D143101
|
|
|
|
|
|
|
|
| |
Added logging when bolt is processing binary with split dwarf.
Reviewed By: rafauler
Differential Revision: https://reviews.llvm.org/D142576
|
|
|
|
| |
Old code breaks build with libstdc++ with assertions. Fix it.
|
|
|
|
|
|
|
|
|
| |
Allow partial name matching wrt LTO suffixes in `function-order`
user-supplied function list, the same as permitted by profile matching.
Reviewed By: #bolt, rafauler
Differential Revision: https://reviews.llvm.org/D142269
|
|
|
|
|
|
|
|
|
| |
Move individual warnings under verbosity >= 1, print out a warning with
aggregate number.
Reviewed By: #bolt, rafauler
Differential Revision: https://reviews.llvm.org/D142397
|