History log of /llvm-project/bolt/lib/Target/X86/X86MCPlusBuilder.cpp (Results 51 – 74 of 74)
Revision Date Author Comments
# 686406a0 04-Apr-2022 Amir Ayupov <aaupov@fb.com>

[BOLT][NFC] Use X86 mnemonic checks

Remove switches in X86MCPlusBuilder.cpp, use mnemonic checks instead

Reviewed By: rafauler

Differential Revision: https://reviews.llvm.org/D122853


# 42e8e001 18-Mar-2022 Amir Ayupov <aaupov@fb.com>

[BOLT][NFC] Use X86 mnemonic tables

Remove tables from X86MCPlusBuilder, make use of llvm::X86 mnemonic tables.

Reviewed By: rafauler

Differential Revision: https://reviews.llvm.org/D121573


# dc1cf838 16-Mar-2022 Amir Ayupov <aaupov@fb.com>

[BOLT] Strip redundant AdSize override prefix

Since LLVM MC now preserves redundant AdSize override prefix (0x67), remove it
in BOLT explicitly (-x86-strip-redundant-adsize, on by default).

Test Pl

[BOLT] Strip redundant AdSize override prefix

Since LLVM MC now preserves redundant AdSize override prefix (0x67), remove it
in BOLT explicitly (-x86-strip-redundant-adsize, on by default).

Test Plan:
`bin/llvm-lit -a bolt/test/X86/addr32.s`

Reviewed By: rafauler

Differential Revision: https://reviews.llvm.org/D120975

show more ...


# 698127df 16-Mar-2022 Amir Ayupov <aaupov@fb.com>

[BOLT][NFC] Move isMOVSX64rm32 out of MCPlusBuilder

Reviewed By: rafauler

Differential Revision: https://reviews.llvm.org/D121669


# 5790441c 10-Mar-2022 Amir Ayupov <aaupov@fb.com>

[BOLT][NFC] Use getShortOpcodeArith in X86MCPlusBuilder

Unify `llvm::X86::getRelaxedOpcodeArith` and `getShortArithOpcode` in
X86MCPlusBuilder.cpp.

Addresses https://lists.llvm.org/pipermail/llvm-d

[BOLT][NFC] Use getShortOpcodeArith in X86MCPlusBuilder

Unify `llvm::X86::getRelaxedOpcodeArith` and `getShortArithOpcode` in
X86MCPlusBuilder.cpp.

Addresses https://lists.llvm.org/pipermail/llvm-dev/2022-January/154526.html

Reviewed By: rafauler

Differential Revision: https://reviews.llvm.org/D121404

show more ...


# 687e4af1 08-Feb-2022 Amir Ayupov <aaupov@fb.com>

[BOLT] CMOVConversion pass

Convert simple hammocks into cmov based on misprediction rate.

Test Plan:
- Assembly test: `cmov-conversion.s`
- Testing on a binary:
# Bootstrap clang with `-x86-cmov-

[BOLT] CMOVConversion pass

Convert simple hammocks into cmov based on misprediction rate.

Test Plan:
- Assembly test: `cmov-conversion.s`
- Testing on a binary:
# Bootstrap clang with `-x86-cmov-converter-force-all` and `-Wl,--emit-relocs`
(Release build)
# Collect perf.data:

- `clang++ <opts> bolt/lib/Core/BinaryFunction.cpp -E > bf.cpp`
- `perf record -e cycles:u -j any,u -- clang-15 bf.cpp -O2 -std=c++14 -c -o bf.o`
# Optimize clang-15 with and w/o -cmov-conversion:
- `llvm-bolt clang-15 -p perf.data -o clang-15.bolt`
- `llvm-bolt clang-15 -p perf.data -cmov-conversion -o clang-15.bolt.cmovconv`
# Run perf experiment:
- test: `clang-15.bolt.cmovconv`,
- control: `clang-15.bolt`,
- workload (clang options): `bf.cpp -O2 -std=c++14 -c -o bf.o`
Results:
```
task-clock [delta: -360.21 ± 356.75, delta(%): -1.7760 ± 1.7589, p-value: 0.047951, balance: -6]
instructions [delta: 44061118 ± 13246382, delta(%): 0.0690 ± 0.0207, p-value: 0.000001, balance: 50]
icache-misses [delta: -5534468 ± 2779620, delta(%): -0.4331 ± 0.2175, p-value: 0.028014, balance: -28]
branch-misses [delta: -1624270 ± 1113244, delta(%): -0.3456 ± 0.2368, p-value: 0.030300, balance: -22]
```

Reviewed By: rafauler

Differential Revision: https://reviews.llvm.org/D120177

show more ...


# fada2309 03-Mar-2022 Maksim Panchenko <maks@fb.com>

[BOLT][NFC] Return MCRegister::NoRegister from MCPlusBuilder::getNoRegister()

Reviewed By: yota9

Differential Revision: https://reviews.llvm.org/D120863


# 08dcbed9 24-Feb-2022 Amir Ayupov <aaupov@fb.com>

[BOLT] Fix X86MCPlusBuilder::replaceRegWithImm

Reassigning the operand didn't update the operand type which resulted in an
assertion (`Assertion `isReg() && "This is not a register operand!"' failed

[BOLT] Fix X86MCPlusBuilder::replaceRegWithImm

Reassigning the operand didn't update the operand type which resulted in an
assertion (`Assertion `isReg() && "This is not a register operand!"' failed.`)
Reset the instruction instead.

Test Plan:
```
ninja check-bolt
...
PASS: BOLT-Unit :: Core/./CoreTests/X86/MCPlusBuilderTester.ReplaceRegWithImm/0 (90 of 136)
```

Reviewed By: rafauler

Differential Revision: https://reviews.llvm.org/D120263

show more ...


# 57f7c7d9 09-Feb-2022 serge-sans-paille <sguelton@redhat.com>

Add missing MC includes in bolt/

Changes needed after ef736a1c39f27ef4 that removes some implicit
dependencies from MrCV headers.


# 167b623a 02-Feb-2022 Amir Ayupov <aaupov@fb.com>

[BOLT][NFC] Use isInt<> instead of range checks

Summary: Reuse LLVM isInt check

Reviewed By: maksfb

FBD33945182


# a9cd49d5 04-Aug-2021 Amir Ayupov <aaupov@fb.com>

[BOLT][NFC] Move Offset annotation to Group 1

Summary:
Move the annotation to avoid dynamic memory allocations.
Improves the CPU time of instrumenting a large binary by 1% (+-0.8%, p-value 0.01)

Te

[BOLT][NFC] Move Offset annotation to Group 1

Summary:
Move the annotation to avoid dynamic memory allocations.
Improves the CPU time of instrumenting a large binary by 1% (+-0.8%, p-value 0.01)

Test Plan: NFC

Reviewers: maksfb

FBD30091656

show more ...


# 82278a8f 09-Jan-2022 Maksim Panchenko <maks@fb.com>

[BOLT][NFC] Refactor X86MCPlusBuilder

Summary:
Selectively apply clang-format and other minor refactoring to the code
in X86MCPlusBuilder.cpp

(cherry picked from FBD33495550)


# 799cbbb7 05-Jan-2022 Amir Ayupov <aaupov@fb.com>

[BOLT][NFC] Reuse X86BaseInfo interfaces for macrofusion checks

Summary:
Remove X86MCPlusBuilder code that duplicates checks in X86BaseInfo.
Remove isINC and isDEC as redundant.

The new code of `X8

[BOLT][NFC] Reuse X86BaseInfo interfaces for macrofusion checks

Summary:
Remove X86MCPlusBuilder code that duplicates checks in X86BaseInfo.
Remove isINC and isDEC as redundant.

The new code of `X86MCPlusBuilder::isMacroOpFusionPair` is functionally
equivalent to `X86AsmBackend::isMacroFused`. However, as the method is
declared/defined in X86AsmBackend.cpp and not exported in a header file,
there's no way to use it in BOLT without changes in LLVM code.

(cherry picked from FBD33440373)

show more ...


# 1d3c1507 07-Jan-2022 Amir Ayupov <aaupov@fb.com>

[BOLT] Remove ineligible macro-fusion patterns

Summary:
Remove patterns ineligible for macro-fusion:
- First instruction has a memory destination

This is a temporary commit to align BOLT with LLVM

[BOLT] Remove ineligible macro-fusion patterns

Summary:
Remove patterns ineligible for macro-fusion:
- First instruction has a memory destination

This is a temporary commit to align BOLT with LLVM MC interfaces.
(cherry picked from FBD33479340)

show more ...


# bc9032c7 05-Jan-2022 Maksim Panchenko <maks@fb.com>

[BOLT][NFC] Use uniform DEBUG_TYPE for MCPlus builders

(cherry picked from FBD33435121)


# 89ceb779 29-Dec-2021 Amir Ayupov <aaupov@fb.com>

[BOLT][NFC] Fix braces usage in Target

Summary:
Refactor bolt/lib/Target to follow the braces rule for if/else/loop from
[LLVM Coding Standards](https://llvm.org/docs/CodingStandards.html).

(cherry

[BOLT][NFC] Fix braces usage in Target

Summary:
Refactor bolt/lib/Target to follow the braces rule for if/else/loop from
[LLVM Coding Standards](https://llvm.org/docs/CodingStandards.html).

(cherry picked from FBD33345353)

show more ...


# 2f09f445 21-Dec-2021 Maksim Panchenko <maks@fb.com>

[BOLT][NFC] Fix file-description comments

Summary: Fix comments at the start of source files.

(cherry picked from FBD33274597)


# 46e93fb4 15-Dec-2021 Rafael Auler <rafaelauler@fb.com>

Fix frameopt crash when processing POPF

Summary: POPF instruction was triggering an assertion in our analysis.

(cherry picked from FBD33141809)


# 69706eaf 09-Dec-2021 Maksim Panchenko <maks@fb.com>

[BOLT] Refactor BinaryBasicBlock to use ADT

Summary:
Refactor members of BinaryBasicBlock. Replace some std containers with
ADT equivalents. The size of BinaryBasicBlock on x86-64 Linux is reduced
f

[BOLT] Refactor BinaryBasicBlock to use ADT

Summary:
Refactor members of BinaryBasicBlock. Replace some std containers with
ADT equivalents. The size of BinaryBasicBlock on x86-64 Linux is reduced
from 232 bytes to 192 bytes.

(cherry picked from FBD33081850)

show more ...


# b69d487a 03-Dec-2021 Amir Ayupov <aaupov@fb.com>

[BOLT][NFC] Remove unused MCPlusBuilder::isEnter

Summary: Remove unused code identified via coverage report.

(cherry picked from FBD32818608)


# 8e632eae 03-Dec-2021 Amir Ayupov <aaupov@fb.com>

[BOLT][NFC] Remove unused MCPlusBuilder::createIndirectCall method

Summary: Remove unused code identified via coverage report.

(cherry picked from FBD32818329)


# 933df2a4 09-Nov-2021 Maksim Panchenko <maks@fb.com>

[BOLT][NFC] Remove references to internal tasks

(cherry picked from FBD32272387)


# 85ffa8e4 11-Oct-2021 Alexey Moksyakov <alexey.moksyakov@huawei.com>

[PR][BOLT][Instrumentation] Optimize eflags load/store

Summary:
This commit uses reviews.llvm.org/D6629 as a reference to optimize
X86::EFLAGS load/store in the instrumentation snippet by using lahf

[PR][BOLT][Instrumentation] Optimize eflags load/store

Summary:
This commit uses reviews.llvm.org/D6629 as a reference to optimize
X86::EFLAGS load/store in the instrumentation snippet by using lahf/sahf
instructions instead of pushf/popf.

(cherry picked from FBD31662303)

show more ...


# a34c753f 08-Oct-2021 Rafael Auler <rafaelauler@fb.com>

Rebase: [NFC] Refactor sources to be buildable in shared mode

Summary:
Moves source files into separate components, and make explicit
component dependency on each other, so LLVM build system knows h

Rebase: [NFC] Refactor sources to be buildable in shared mode

Summary:
Moves source files into separate components, and make explicit
component dependency on each other, so LLVM build system knows how to
build BOLT in BUILD_SHARED_LIBS=ON.

Please use the -c merge.renamelimit=230 git option when rebasing your
work on top of this change.

To achieve this, we create a new library to hold core IR files (most
classes beginning with Binary in their names), a new library to hold
Utils, some command line options shared across both RewriteInstance
and core IR files, a new library called Rewrite to hold most classes
concerned with running top-level functions coordinating the binary
rewriting process, and a new library called Profile to hold classes
dealing with profile reading and writing.

To remove the dependency from BinaryContext into X86-specific classes,
we do some refactoring on the BinaryContext constructor to receive a
reference to the specific backend directly from RewriteInstance. Then,
the dependency on X86 or AArch64-specific classes is transfered to the
Rewrite library. We can't have the Core library depend on targets
because targets depend on Core (which would create a cycle).

Files implementing the entry point of a tool are transferred to the
tools/ folder. All header files are transferred to the include/
folder. The src/ folder was renamed to lib/.

(cherry picked from FBD32746834)

show more ...


123