summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/tools
Commit message (Collapse)AuthorAgeFilesLines
...
* [llvm-exegesis] Improve Register Setup.Guillaume Chatelet2018-09-186-42/+69
| | | | | | | | | | | | | | Summary: Added function to set a register to a particular value + tests. Add EFLAGS test, use new setRegTo instead of setRegToConstant. Reviewers: courbet, javed.absar Subscribers: mgorny, tschuett, llvm-commits Differential Revision: https://reviews.llvm.org/D51856 llvm-svn: 342466
* Added function to set a register to a particular value + tests.Guillaume Chatelet2018-09-181-165/+245
| | | | llvm-svn: 342465
* Improve Register SetupGuillaume Chatelet2018-09-182-8/+71
| | | | llvm-svn: 342464
* [llvm-exegesis] Add predefined floating point values so we can test impact ↵Guillaume Chatelet2018-09-172-0/+72
| | | | | | | | | | | | | | of special values on latency. Summary: This will be useful to generate many configurations and test instruction regimes (NaN, Inf, subnormal, normal). Reviewers: courbet Subscribers: mgorny, tschuett, llvm-commits Differential Revision: https://reviews.llvm.org/D51858 llvm-svn: 342369
* Revert r342148 (and follow-on fix attempts r342154, r342180, r342182, r342193)Nico Weber2018-09-152-2/+0
| | | | | | | Many bots buildling with make have been broken for several days, e.g. http://lab.llvm.org:8011/builders/lld-x86_64-darwin13 llvm-svn: 342336
* [NFC] Link LLVMCore into LLVMExegesisARMTests.Richard Diamond2018-09-131-0/+1
| | | | | | | Fixes missing `llvm::LLVMContext::~LLVMContext()` symbols w/ `BUILD_SHARED_LIBS`. llvm-svn: 342193
* LLVMExegesisX86Tests: link to LLVMCore, too.Roman Lebedev2018-09-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes build for me. Refs. D52054 [215/217] Linking CXX executable unittests/tools/llvm-exegesis/X86/LLVMExegesisX86Tests FAILED: unittests/tools/llvm-exegesis/X86/LLVMExegesisX86Tests : && /usr/bin/g++ -pipe -O2 -g0 -UNDEBUG -fPIC -fvisibility-inlines-hidden -Werror=date-time -std=c++11 -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wno-class-memaccess -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -fdiagnostics-color -ffunction-sections -fdata-sections -pipe -O2 -g0 -UNDEBUG -fuse-ld=lld -Wl,--color-diagnostics -Wl,-allow-shlib-undefined -Wl,-O3 -Wl,--gc-sections unittests/tools/llvm-exegesis/X86/CMakeFiles/LLVMExegesisX86Tests.dir/AssemblerTest.cpp.o unittests/tools/llvm-exegesis/X86/CMakeFiles/LLVMExegesisX86Tests.dir/AnalysisTest.cpp.o unittests/tools/llvm-exegesis/X86/CMakeFiles/LLVMExegesisX86Tests.dir/SnippetGeneratorTest.cpp.o unittests/tools/llvm-exegesis/X86/CMakeFiles/LLVMExegesisX86Tests.dir/RegisterAliasingTest.cpp.o unittests/tools/llvm-exegesis/X86/CMakeFiles/LLVMExegesisX86Tests.dir/TargetTest.cpp.o -o unittests/tools/llvm-exegesis/X86/LLVMExegesisX86Tests -Wl,-rpath,/build/llvm-build-GCC-release/lib lib/libLLVMMC.so.8svn lib/libLLVMMCParser.so.8svn lib/libLLVMObject.so.8svn lib/libLLVMSymbolize.so.8svn lib/libLLVMX86CodeGen.so.8svn lib/libLLVMX86AsmParser.so.8svn lib/libLLVMX86AsmPrinter.so.8svn lib/libLLVMX86Desc.so.8svn lib/libLLVMX86Disassembler.so.8svn lib/libLLVMX86Info.so.8svn lib/libLLVMX86Utils.so.8svn lib/libLLVMSupport.so.8svn -lpthread lib/libgtest_main.so.8svn lib/libgtest.so.8svn -lpthread lib/libLLVMExegesis.so.8svn lib/libLLVMExegesisX86.so.8svn && : ld.lld: error: undefined symbol: llvm::LLVMContext::~LLVMContext() >>> referenced by AssemblerTest.cpp >>> unittests/tools/llvm-exegesis/X86/CMakeFiles/LLVMExegesisX86Tests.dir/AssemblerTest.cpp.o:(exegesis::(anonymous namespace)::X86MachineFunctionGeneratorTest_DISABLED_JitFunction_Test::TestBody()) ld.lld: error: undefined symbol: llvm::LLVMContext::~LLVMContext() >>> referenced by AssemblerTest.cpp >>> unittests/tools/llvm-exegesis/X86/CMakeFiles/LLVMExegesisX86Tests.dir/AssemblerTest.cpp.o:(exegesis::(anonymous namespace)::X86MachineFunctionGeneratorTest_DISABLED_JitFunctionXOR32rr_Default_Test::TestBody()) ld.lld: error: undefined symbol: llvm::LLVMContext::~LLVMContext() >>> referenced by AssemblerTest.cpp >>> unittests/tools/llvm-exegesis/X86/CMakeFiles/LLVMExegesisX86Tests.dir/AssemblerTest.cpp.o:(void exegesis::MachineFunctionGeneratorBaseTest::Check<int, int, int, int, int, int, int, int>(exegesis::ExegesisTarget const&, llvm::ArrayRef<unsigned int>, llvm::MCInst, int, int, int, int, int, int, int, int)) ld.lld: error: undefined symbol: llvm::LLVMContext::~LLVMContext() >>> referenced by AssemblerTest.cpp >>> unittests/tools/llvm-exegesis/X86/CMakeFiles/LLVMExegesisX86Tests.dir/AssemblerTest.cpp.o:(exegesis::(anonymous namespace)::X86MachineFunctionGeneratorTest_DISABLED_JitFunctionMOV32ri_Test::TestBody()) collect2: error: ld returned 1 exit status ninja: build stopped: subcommand failed. llvm-svn: 342182
* [llvm-exegesis][NFC] Split BenchmarkRunner classClement Courbet2018-09-131-33/+27
| | | | | | | | | | | | | | | Summary: The snippet-generation part goes to the SnippetGenerator class. This will allow benchmarking arbitrary code (see PR38437). Reviewers: gchatelet Subscribers: mgorny, tschuett, llvm-commits Differential Revision: https://reviews.llvm.org/D51979 llvm-svn: 342117
* Add header guards to some headers that are missing themArgyrios Kyrtzidis2018-09-031-0/+5
| | | | | | | Also adjust some of dsymutil's headers to put the header guards at the top, otherwise the compiler will not recognize them as header guards. llvm-svn: 341323
* [llvm-exegesis] Renaming classes and functions.Guillaume Chatelet2018-08-031-57/+56
| | | | | | | | | | | | Summary: Functional No Op. Reviewers: gchatelet Subscribers: tschuett, courbet, llvm-commits Differential Revision: https://reviews.llvm.org/D50231 llvm-svn: 338836
* [llvm-exegesis] Rename InstructionInstance into InstructionBuilder.Guillaume Chatelet2018-08-021-47/+47
| | | | | | | | | | Summary: Non functional change. Subscribers: tschuett, courbet, llvm-commits Differential Revision: https://reviews.llvm.org/D50176 llvm-svn: 338701
* [llvm-exegesis] Provide a way to handle memory instructions.Guillaume Chatelet2018-08-016-18/+97
| | | | | | | | | | | | | | | | | Summary: And implement memory instructions on X86. This fixes PR36906. Reviewers: gchatelet Reviewed By: gchatelet Subscribers: lebedev.ri, filcab, mgorny, tschuett, RKSimon, llvm-commits Differential Revision: https://reviews.llvm.org/D48935 llvm-svn: 338567
* [cfi-verify] Support AArch64.Joel Galenson2018-07-131-27/+276
| | | | | | | | | | | | This patch adds support for AArch64 to cfi-verify. This required three changes to cfi-verify. First, it generalizes checking if an instruction is a trap by adding a new isTrap flag to TableGen (and defining it for x86 and AArch64). Second, the code that ensures that the operand register is not clobbered between the CFI check and the indirect call needs to allow a single dereference (in x86 this happens as part of the jump instruction). Third, we needed to ensure that return instructions are not counted as indirect branches. Technically, returns are indirect branches and can be covered by CFI, but LLVM's forward-edge CFI does not protect them, and x86 does not consider them, so we keep that behavior. In addition, we had to improve AArch64's code to evaluate the branch target of a MCInst to handle calls where the destination is not the first operand (which it often is not). Differential Revision: https://reviews.llvm.org/D48836 llvm-svn: 337007
* [llvm-exegesis] Adjust AArch64 unit testJohn Brawn2018-07-031-4/+19
| | | | | | | The signature of setRegToConstant changed in r336171, so adjust the AArch64 unit test in a similar way to how the X86 unit test was changed in that commit. llvm-svn: 336188
* [llvm-exegesis] Add an AArch64 targetJohn Brawn2018-07-033-0/+62
| | | | | | | | | The target does just enough to be able to run llvm-exegesis in latency mode for at least some opcodes. Differential Revision: https://reviews.llvm.org/D48780 llvm-svn: 336187
* [llvm-exegesis] ExegisX86Target::setRegToConstant() should depend on the ↵Clement Courbet2018-07-031-7/+133
| | | | | | | | | | | | | | subtarget features. Summary: This fixes PR38008. Reviewers: gchatelet, RKSimon Subscribers: tschuett, craig.topper, llvm-commits Differential Revision: https://reviews.llvm.org/D48820 llvm-svn: 336171
* [llvm-exegesis] Get the BenchmarkRunner from the ExegesisTarget.Clement Courbet2018-06-262-8/+6
| | | | | | | | | | | | | | | Summary: This allows targets to override code generation for some instructions. As an example of override, this also moves ad-hoc instruction filtering for X86 into the X86 ExegesisTarget. Reviewers: gchatelet Subscribers: mgorny, tschuett, llvm-commits Differential Revision: https://reviews.llvm.org/D48587 llvm-svn: 335582
* Fix unsigned/signed comparison failure in unittest.Eric Christopher2018-06-251-1/+1
| | | | llvm-svn: 335547
* [llvm-exegesis][NFC] Remove unnecessary member variables.Clement Courbet2018-06-251-1/+1
| | | | llvm-svn: 335470
* [llvm-exegesis] Generate snippet setup code.Clement Courbet2018-06-253-8/+104
| | | | | | | | | | | | | | | Summary: This ensures that the snippet always sees the same values for registers, making measurements reproducible. This will also allow exploring different values. Reviewers: gchatelet Subscribers: tschuett, llvm-commits Differential Revision: https://reviews.llvm.org/D48542 llvm-svn: 335465
* [llvm-exegesis] Add mechanism to add target-specific passes.Clement Courbet2018-06-201-1/+2
| | | | | | | | | | | | | | Summary: createX86FloatingPointStackifierPass is disabled until we handle TracksLiveness correctly. Reviewers: gchatelet Subscribers: mgorny, tschuett, llvm-commits Differential Revision: https://reviews.llvm.org/D48360 llvm-svn: 335117
* [llvm-exegesis] Fix failing test.Guillaume Chatelet2018-06-201-2/+4
| | | | | | | | | | Reviewers: courbet Subscribers: tschuett, llvm-commits Differential Revision: https://reviews.llvm.org/D48358 llvm-svn: 335115
* [llvm-exegesis] Use a Prototype to defer picking a value for free vars.Guillaume Chatelet2018-06-201-77/+82
| | | | | | | | | | | | Summary: Introducing a Prototype object to capture Variables that must be set but keeps degrees of freedom as Invalid. This allows exploring non constraint variables later on. Reviewers: courbet Subscribers: tschuett, llvm-commits Differential Revision: https://reviews.llvm.org/D48316 llvm-svn: 335105
* Re-land r335038 "[llvm-exegesis] A mechanism to add target-specific ↵Clement Courbet2018-06-192-1/+31
| | | | | | | | functionality."" Fix typo: LLVM_NATIVE_ARCH -> LLVM_EXEGESIS_NATIVE_ARCH. llvm-svn: 335041
* Revert r335038 "[llvm-exegesis] A mechanism to add target-specific ↵Clement Courbet2018-06-192-31/+1
| | | | | | | | functionality." Breaks buildbots. llvm-svn: 335040
* [llvm-exegesis] A mechanism to add target-specific functionality.Clement Courbet2018-06-192-1/+31
| | | | | | | | | | | | 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 llvm-svn: 335038
* [llvm-exegesis] Use BenchmarkResult::Instructions instead of OpcodeNameClement Courbet2018-06-141-3/+0
| | | | | | | | | | | | | | | | | | 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 llvm-svn: 334691
* [llvm-exegesis] Fix buildbot - power was using native target for X86.Guillaume Chatelet2018-06-131-1/+2
| | | | | | | | | | | | Reviewers: courbet Reviewed By: courbet Subscribers: tschuett, llvm-commits Differential Revision: https://reviews.llvm.org/D48125 llvm-svn: 334601
* [llvm-exegesis] Fix failing assert when creating Snippet for LAHF.Guillaume Chatelet2018-06-131-1/+12
| | | | | | | | | | Reviewers: courbet Subscribers: tschuett, llvm-commits Differential Revision: https://reviews.llvm.org/D48123 llvm-svn: 334599
* [llvm-exegesis] Cleaner design without mutable data.Guillaume Chatelet2018-06-132-1/+201
| | | | | | | | | | | | 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 llvm-svn: 334596
* [llvm-exegesis] Move libpfm linking to LLVMExegesis.Guillaume Chatelet2018-06-121-4/+0
| | | | | | | | | | | | 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 llvm-svn: 334499
* [llvm-exegesis] Improve error reporting.Guillaume Chatelet2018-06-071-3/+5
| | | | | | | | | | | | 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 llvm-svn: 334167
* [llvm-exegesis] Serializes instruction's operand in BenchmarkResult's key.Guillaume Chatelet2018-06-071-2/+25
| | | | | | | | | | | | Summary: Follow up patch to https://reviews.llvm.org/D47764. Reviewers: courbet Subscribers: tschuett, llvm-commits Differential Revision: https://reviews.llvm.org/D47785 llvm-svn: 334165
* [llvm-exegesis] move Mode from Key to BenchmarResult.Clement Courbet2018-06-061-3/+3
| | | | | | | | | | | | | | | | | | 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 llvm-svn: 334079
* [llvm-exegesis] Add instructions to BenchmarkResult Key.Clement Courbet2018-06-051-4/+25
| | | | | | | | | | 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 llvm-svn: 334008
* [llvm-exegesis][NFC] Use an enum instead of a string for benchmark mode.Clement Courbet2018-06-041-1/+1
| | | | | | | | | | | | Summary: YAML encoding is backwards-compatible. Reviewers: gchatelet Subscribers: tschuett, llvm-commits Differential Revision: https://reviews.llvm.org/D47705 llvm-svn: 333886
* [llvm-exegesis] Analysis: Display idealized sched class port pressure.Clement Courbet2018-06-012-0/+103
| | | | | | | | | | | | Summary: Screenshot in phabricator diff. Reviewers: gchatelet Subscribers: mgorny, tschuett, mgrang, llvm-commits Differential Revision: https://reviews.llvm.org/D47329 llvm-svn: 333753
* [llvm-exegesis] Analysis: Show value extents.Clement Courbet2018-05-241-0/+10
| | | | | | | | | | | | Summary: Screenshot attached in phabricator. Reviewers: gchatelet Subscribers: tschuett, llvm-commits Differential Revision: https://reviews.llvm.org/D47318 llvm-svn: 333181
* [llvm-exegesis] Analysis output uses HTML.Clement Courbet2018-05-221-0/+14
| | | | | | | | | | | | 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 llvm-svn: 332979
* [llvm-exegesis] Fix compile error on VS.Clement Courbet2018-05-181-3/+3
| | | | | | | | | | | | | | | 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 ] llvm-svn: 332697
* [llvm-exegesis] Disable failing ARM assembler tests.Clement Courbet2018-05-171-2/+2
| | | | llvm-svn: 332604
* [llvm-exegesis] Disable the tests failing on buildbots while we investigate.Clement Courbet2018-05-171-4/+4
| | | | llvm-svn: 332600
* [llvm-exegesis][NFC] Remove dead function.Clement Courbet2018-05-171-5/+0
| | | | llvm-svn: 332597
* Fix r332592 : X86 tests should use the X86 target, not the native targets.Clement Courbet2018-05-171-5/+14
| | | | llvm-svn: 332594
* reland r332579: [llvm-exegesis] Update to cover latency through another opcode.Clement Courbet2018-05-1711-562/+271
| | | | | | | | | | | | | | 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 llvm-svn: 332592
* Revert r332579 "[llvm-exegesis] Update to cover latency through another opcode."Clement Courbet2018-05-176-120/+389
| | | | | | The revision failed to update the ARM tests. llvm-svn: 332580
* [llvm-exegesis] Update to cover latency through another opcode.Clement Courbet2018-05-176-389/+120
| | | | | | | | | | | | 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 llvm-svn: 332579
* [llvm-exegesis] Split AsmTemplate.Name into components.Clement Courbet2018-05-151-3/+12
| | | | | | | | | | | | | | 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 llvm-svn: 332348
* [llvm-exegesis] InMemoryAssembler: handle return-less targets (e.g. arm).Clement Courbet2018-05-153-3/+103
| | | | | | | | | | | | 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 llvm-svn: 332331
* Re-land r332230 "[llvm-exegesis]Fix a warning in r332221"Clement Courbet2018-05-141-1/+1
| | | | | | | | | 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); llvm-svn: 332235
OpenPOWER on IntegriCloud