Commit Graph

68 Commits

Author SHA1 Message Date
Clement Courbet 41d0646d59 Re-land r335038 "[llvm-exegesis] A mechanism to add target-specific functionality.""
Fix typo: LLVM_NATIVE_ARCH -> LLVM_EXEGESIS_NATIVE_ARCH.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335041 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-19 11:28:59 +00:00
Clement Courbet 0dae1a0252 Revert r335038 "[llvm-exegesis] A mechanism to add target-specific functionality."
Breaks buildbots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335040 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-19 10:54:12 +00:00
Clement Courbet fdc767cc01 [llvm-exegesis] A mechanism to add target-specific functionality.
Summary: This is a step towards implementing memory operands and X87.

Reviewers: gchatelet

Subscribers: mgorny, tschuett, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335038 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-19 10:39:50 +00:00
Clement Courbet 49fb4d413f [llvm-exegesis] Use BenchmarkResult::Instructions instead of OpcodeName
Summary:
Get rid of OpcodeName.

To remove the opcode name from an old file:
```
cat old_file | sed '/opcode_name.*/d'
```

Reviewers: gchatelet

Subscribers: tschuett, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@334691 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-14 06:57:52 +00:00
Guillaume Chatelet f246e3e960 [llvm-exegesis] Fix buildbot - power was using native target for X86.
Reviewers: courbet

Reviewed By: courbet

Subscribers: tschuett, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@334601 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-13 14:07:36 +00:00
Guillaume Chatelet c855277f2a [llvm-exegesis] Fix failing assert when creating Snippet for LAHF.
Reviewers: courbet

Subscribers: tschuett, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@334599 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-13 13:53:56 +00:00
Guillaume Chatelet 7f976eb280 [llvm-exegesis] Cleaner design without mutable data.
Summary: Previous design was relying on the 'mutate' keyword and was quite confusing. This version separate mutable from immutable data and makes it clearer what changes and what doesn't.

Reviewers: courbet

Subscribers: tschuett, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@334596 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-13 13:24:41 +00:00
Guillaume Chatelet 331580afbf [llvm-exegesis] Move libpfm linking to LLVMExegesis.
Summary: This patch moves linking of libpfm from different places to a single one.

Reviewers: courbet

Subscribers: mgorny, tschuett, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@334499 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-12 13:07:16 +00:00
Guillaume Chatelet 184b9569f9 [llvm-exegesis] Improve error reporting.
Summary: BenchmarkResult IO functions now return an Error or Expected so caller can deal take proper action.

Reviewers: courbet

Subscribers: tschuett, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@334167 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-07 07:51:16 +00:00
Guillaume Chatelet a1c8d87b41 [llvm-exegesis] Serializes instruction's operand in BenchmarkResult's key.
Summary: Follow up patch to https://reviews.llvm.org/D47764.

Reviewers: courbet

Subscribers: tschuett, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@334165 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-07 07:40:40 +00:00
Clement Courbet f37d193460 [llvm-exegesis] move Mode from Key to BenchmarResult.
Moves the Mode field out of the Key. The existing yaml benchmark results can be fixed with the following script:

```
readonly FILE=$1
readonly MODE=latency # Change to uops to fix a uops benchmark.
cat $FILE | \
  sed "/^\ \+mode:\ \+$MODE$/d" | \
  sed "/^cpu_name.*$/i mode:            $MODE"
```

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

Authored by: Guillaume Chatelet

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@334079 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-06 09:42:36 +00:00
Clement Courbet bed775073b [llvm-exegesis] Add instructions to BenchmarkResult Key.
We want llvm-exegesis to explore instructions (effect of initial register values, effect of operand selection). To enable this a BenchmarkResult muststore all the relevant data in its key. This patch starts adding such data. Here we simply allow to store the generated instructions, following patches will add operands and initial values for registers.

https://reviews.llvm.org/D47764

Authored by: Guilluame Chatelet

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@334008 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-05 10:56:19 +00:00
Clement Courbet 2d87e5abe5 [llvm-exegesis][NFC] Use an enum instead of a string for benchmark mode.
Summary: YAML encoding is backwards-compatible.

Reviewers: gchatelet

Subscribers: tschuett, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@333886 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-04 11:43:40 +00:00
Clement Courbet 1d12ed5273 [llvm-exegesis] Analysis: Display idealized sched class port pressure.
Summary: Screenshot in phabricator diff.

Reviewers: gchatelet

Subscribers: mgorny, tschuett, mgrang, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@333753 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-01 14:18:02 +00:00
Clement Courbet df5bf794d6 [llvm-exegesis] Analysis: Show value extents.
Summary: Screenshot attached in phabricator.

Reviewers: gchatelet

Subscribers: tschuett, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@333181 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-24 12:41:02 +00:00
Clement Courbet a38d19ff57 [llvm-exegesis] Analysis output uses HTML.
Summary: This makes the report much more readable.

Reviewers: gchatelet

Subscribers: tschuett, mgrang, craig.topper, RKSimon, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332979 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-22 13:31:29 +00:00
Clement Courbet 710be84a00 [llvm-exegesis] Fix compile error on VS.
llvm::BitVector::const_set_bits_iterator is not formally a
ForwardIterator. Using it as such results in compile time errors on some
compilers:

FAILED: unittests/tools/llvm-exegesis/X86/CMakeFiles/LLVMExegesisX86Tests.dir/RegisterAliasingTest.cpp.obj
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xutility(967): error C2794: 'iterator_category': is not a member of any direct or indirect base class of 'std::iterator_traits<_InIt>'
        with
        [
            _InIt=llvm::BitVector::const_set_bits_iterator
        ]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332697 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-18 07:18:56 +00:00
Clement Courbet 3c529c01cb [llvm-exegesis] Disable failing ARM assembler tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332604 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-17 12:41:56 +00:00
Clement Courbet 4cdd921c67 [llvm-exegesis] Disable the tests failing on buildbots while we investigate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332600 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-17 11:55:08 +00:00
Clement Courbet 8f090f67c0 [llvm-exegesis][NFC] Remove dead function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332597 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-17 11:51:49 +00:00
Clement Courbet 8603d60d15 Fix r332592 : X86 tests should use the X86 target, not the native targets.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332594 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-17 11:31:24 +00:00
Clement Courbet 4f11b743f4 reland r332579: [llvm-exegesis] Update to cover latency through another opcode.
Restructuring the code to measure latency and uops.
The end goal is to have this program spawn another process to deal with SIGILL and other malformed programs. It is not yet the case in this redesign, it is still the main program that runs the code (and may crash).
It now uses BitVector instead of Graph for performance reasons.

https://reviews.llvm.org/D46821

(with fixed ARM tests)

Authored by Guillaume Chatelet

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332592 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-17 10:52:18 +00:00
Clement Courbet 9bb99f85e4 Revert r332579 "[llvm-exegesis] Update to cover latency through another opcode."
The revision failed to update the ARM tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332580 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-17 08:12:29 +00:00
Clement Courbet 33d415b159 [llvm-exegesis] Update to cover latency through another opcode.
Restructuring the code to measure latency and uops.
    The end goal is to have this program spawn another process to deal with SIGILL and other malformed programs. It is not yet the case in this redesign, it is still the main program that runs the code (and may crash).
    It now uses BitVector instead of Graph for performance reasons.

    https://reviews.llvm.org/D46821

    Authored by Guillaume Chatelet

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332579 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-17 07:38:21 +00:00
Clement Courbet bb3b3c2dfc [llvm-exegesis] Split AsmTemplate.Name into components.
Summary:
AsmTemplate becomes IntructionBenchmarkKey, which has three components.
This allows retreiving the opcode for analysis.

Reviewers: gchatelet

Subscribers: tschuett, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332348 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-15 13:07:05 +00:00
Clement Courbet 6357b5f405 [llvm-exegesis] InMemoryAssembler: handle return-less targets (e.g. arm).
Summary: Arm does not have a ret code per se.

Reviewers: gchatelet

Subscribers: mgorny, javed.absar, kristof.beyls, tschuett, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332331 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-15 07:40:21 +00:00
Clement Courbet e17809bf50 Re-land r332230 "[llvm-exegesis]Fix a warning in r332221"
comparison of integers of different signs: 'const unsigned long' and 'const int' [-Werror,-Wsign-compare]

unittests/tools/llvm-exegesis/BenchmarkResultTest.cpp:60:5: note: in instantiation of function template specialization 'testing::internal::EqHelper<false>::Compare<unsigned long, int>' requested here
    ASSERT_EQ(FromDiskVector.size(), 1);

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332235 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-14 12:00:35 +00:00
Clement Courbet 4f14c9bd16 [llvm-exegesis] Revert accidentally commited code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332231 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-14 11:35:37 +00:00
Clement Courbet a0b75d92d7 [llvm-exegesis] Fix a warning in r332221
comparison of integers of different signs: 'const unsigned long' and 'const int' [-Werror,-Wsign-compare]

unittests/tools/llvm-exegesis/BenchmarkResultTest.cpp:60:5: note: in instantiation of function template specialization 'testing::internal::EqHelper<false>::Compare<unsigned long, int>' requested here
    ASSERT_EQ(FromDiskVector.size(), 1);

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332230 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-14 11:31:02 +00:00
Clement Courbet 6cf914db39 [llvm-exegesis] Allow lists of BenchmarkResults to be parsed as std::vector<BenchmarkResult>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332221 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-14 09:01:22 +00:00
Nico Weber e0c7deb8d5 Make CMakeLists.txt formatting more consistent with the rest of LLVM.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331837 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-09 01:15:38 +00:00
Clement Courbet 7b8a8728fb Re-land r331622 "[llvm-exegesis] Add a library to cluster benchmark results."
Add missing move.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331624 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-07 09:09:48 +00:00
Clement Courbet bfa2014b78 Revert r331622 "[llvm-exegesis] Add a library to cluster benchmark results."
Breaks build over llvm::Error copy construction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331623 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-07 08:30:18 +00:00
Clement Courbet 073b5b41a6 [llvm-exegesis] Add a library to cluster benchmark results.
Reviewers: gchatelet

Subscribers: mgorny, tschuett, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331622 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-07 08:20:00 +00:00
Clement Courbet 6bda3ad720 Revert r330027: "[llvm-exegesis] re-enable failing tests after r330026."
The tests are still failing on some bots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@330033 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-13 15:19:16 +00:00
Clement Courbet c70bdbc4be [llvm-exegesis] re-enable failing tests after r330026.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@330027 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-13 14:50:10 +00:00
Clement Courbet 89eb2f7341 [llvm-exegesis][NFC] Add more logging in case target creation fails.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@330020 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-13 14:29:52 +00:00
Clement Courbet a0c1588192 [llvm-exegesis] Create test files in temporary directory.
Currently the test fails in sandboxed environnements.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@330015 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-13 13:37:07 +00:00
Clement Courbet 7f6ed30360 Partially revert r330008.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@330010 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-13 12:43:55 +00:00
Clement Courbet 982445c2a2 [llvm-exegesis] Run unit tests on more platforms.
Summary:
 - Target-independent tests are run all the time.
 - Tests that codegen X86 code are run when X86 is in build targets.
 - Tests that run X86 jitted code are run only on X86 hosts.

Reviewers: gchatelet

Subscribers: mgorny, llvm-commits, tschuett

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@330008 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-13 12:20:30 +00:00
Clement Courbet a59739cda1 [llvm-exegesis] Add a flag to disable libpfm even if present.
Summary: Fixes PR37053.

Reviewers: uabelho, gchatelet

Subscribers: mgorny, tschuett, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329781 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-11 07:32:43 +00:00
Konstantin Zhuravlyov 8947d93c99 llvm-exegesis: Fix unittests include dirs when llvm is a part of another project
When llvm is a part of another project (i.e. opencl),
CMAKE_SOURCE_DIR and CMAKE_BINARY_DIR are pointing to
the parent project, which lead to build failures.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329325 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-05 18:16:02 +00:00
Clement Courbet f73cdf9fe2 [llvm-exegesis] Temporarily disable a few tests.
These are failing on clang-ppc64le-linux-lnt, though the subdirectory is
not even supposed to be built in CMakeLists. Disable the tests until we
understand what's going on.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329200 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-04 14:32:09 +00:00
Clement Courbet 4171cb34e0 [llvm-exegesis] Temporarily disable some tests.
The tests fail on clang-x86-windows-msvc2015:
unknown file: error: SEH exception with code 0x3221225477 thrown in the test body.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329195 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-04 13:33:21 +00:00
Clement Courbet 5b50e479b0 [llvm-exegesis] Only run unit tests on x86_64 hosts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329193 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-04 13:30:23 +00:00
Clement Courbet 527bfb075c [llvm-exegesis][NFC] Fix a few warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329174 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-04 12:01:38 +00:00
Clement Courbet 215782466a [llvm-exegesis] Fix build when libpfm is not available.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329172 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-04 11:48:15 +00:00
Clement Courbet fd68be2418 Re-land r329156 "Add llvm-exegesis tool."
Fixed to depend on and initialize the native target instead of X86.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329169 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-04 11:37:06 +00:00
Clement Courbet fb12c072df Revert r329156 "Add llvm-exegesis tool."
Breaks a bunch of bots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329157 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-04 08:22:54 +00:00
Clement Courbet 780c045964 Add llvm-exegesis tool.
Summary:
[llvm-exegesis][RFC] Automatic Measurement of Instruction Latency/Uops

This is the code corresponding to the RFC "llvm-exegesis Automatic Measurement of Instruction Latency/Uops".

The RFC is available on the LLVM mailing lists as well as the following document
for easier reading:
https://docs.google.com/document/d/1QidaJMJUyQdRrFKD66vE1_N55whe0coQ3h1GpFzz27M/edit?usp=sharing

Subscribers: mgorny, gchatelet, orwant, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329156 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-04 08:13:32 +00:00