diff options
author | Amir Ayupov <aaupov@fb.com> | 2022-02-07 20:16:13 -0800 |
---|---|---|
committer | Amir Ayupov <aaupov@fb.com> | 2022-03-08 10:44:31 -0800 |
commit | 687e4af1c05ae36af88900d41150e260d8f273c0 (patch) | |
tree | 3e742ec4ac36a1daf0dfe7d19f43b2391331052d /flang/lib/Frontend/CompilerInvocation.cpp | |
parent | 151f809c558d3d7e67e4d4b7efe84218c3b8cfa7 (diff) | |
download | llvm-687e4af1c05ae36af88900d41150e260d8f273c0.zip llvm-687e4af1c05ae36af88900d41150e260d8f273c0.tar.gz llvm-687e4af1c05ae36af88900d41150e260d8f273c0.tar.bz2 |
[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
Diffstat (limited to 'flang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions