summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-exegesis
Commit message (Collapse)AuthorAgeFilesLines
* [llvm-exegesis] Initialize const bitvector memberJonas Devlieghere2020-01-131-1/+1
| | | | | | This causes an error with older versions of clang: constructor for 'llvm::exegesis::InstructionsCache' must explicitly initialize the const member 'BVC'
* [llvm-exegesis] Remove unneeded std::move()Miloš Stojanović2020-01-131-1/+1
| | | | | | | | | | | Caught by buildbot breakage: /home/docker/worker_env/ppc64le-clang-rhel-test/clang-ppc64le-rhel/llvm/llvm/tools/llvm-exegesis/lib/Mips/Target.cpp:89:12: error: moving a local object in a return statement prevents copy elision [-Werror,-Wpessimizing-move] return std::move(Instructions); ^ /home/docker/worker_env/ppc64le-clang-rhel-test/clang-ppc64le-rhel/llvm/llvm/tools/llvm-exegesis/lib/Mips/Target.cpp:89:12: note: remove std::move call here return std::move(Instructions); ^~~~~~~~~~ ~
* [llvm-exegesis][mips] Expand loadImmediate()Miloš Stojanović2020-01-131-13/+62
| | | | | | | Add support for loading 32-bit immediates and enable the use of GPR64 registers. Differential Revision: https://reviews.llvm.org/D71873
* [Disassembler] Delete the VStream parameter of MCDisassembler::getInstruction()Fangrui Song2020-01-111-1/+1
| | | | | | | | | | The argument is llvm::null() everywhere except llvm::errs() in llvm-objdump in -DLLVM_ENABLE_ASSERTIONS=On builds. It is used by no target but X86 in -DLLVM_ENABLE_ASSERTIONS=On builds. If we ever have the needs to add verbose log to disassemblers, we can record log with a member function, instead of passing it around as an argument.
* [MC] Add parameter `Address` to MCInstPrinter::printInstFangrui Song2020-01-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | printInst prints a branch/call instruction as `b offset` (there are many variants on various targets) instead of `b address`. It is a convention to use address instead of offset in most external symbolizers/disassemblers. This difference makes `llvm-objdump -d` output unsatisfactory. Add `uint64_t Address` to printInst(), so that it can pass the argument to printInstruction(). `raw_ostream &OS` is moved to the last to be consistent with other print* methods. The next step is to pass `Address` to printInstruction() (generated by tablegen from the instruction set description). We can gradually migrate targets to print addresses instead of offsets. In any case, downstream projects which don't know `Address` can pass 0 as the argument. Reviewed By: jhenderson Differential Revision: https://reviews.llvm.org/D72172
* [llvm-exegesis] Check counters before runningMiloš Stojanović2019-12-313-8/+18
| | | | | | | Check if the appropriate counters for the specified mode are defined on the target. This is checked before any other work is done. Differential Revision: https://reviews.llvm.org/D71927
* [Tools] Fixes -Wrange-loop-analysis warningsMark de Wever2019-12-223-5/+5
| | | | | | This avoids new warnings due to D68912 adds -Wrange-loop-analysis to -Wall. Differential Revision: https://reviews.llvm.org/D71808
* [llvm-exegesis][NFC] internal changesGuillaume Chatelet2019-12-189-94/+148
| | | | | | | | | | | | | | Summary: BitVectors are now cached to lower memory utilization. Instructions have reference semantics. Reviewers: courbet Subscribers: sdardis, tschuett, jrtc27, atanasyan, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D71653
* [llvm-exegesis] Set up AsmTargetStreamer in readSnippetsGuillaume Chatelet2019-12-161-0/+16
| | | | | | | | | | | | Summary: This is a follow up on D71137 properly setting up the AsmTargetStreamer prior to AsmParser::Run call. Reviewers: courbet, mstojanovic Subscribers: tschuett, mikhail.ramalho, llvm-commits, petarj, atanasyan Tags: #llvm Differential Revision: https://reviews.llvm.org/D71468
* [llvm-exegesis] Fix 44b9942898c7.Clement Courbet2019-12-021-0/+1
| | | | | | | | | | | | | | Summary: Add missing stack release instructions in loadImplicitRegAndFinalize. Reviewers: pengfei, gchatelet Subscribers: tschuett, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D70903
* [X86] Add initialization of FPCW in llvm-exegesisWang, Pengfei2019-12-021-5/+11
| | | | | | | | | | | | Summary: This is a following up to D70874. It adds the initialization of FPCW in llvm-exegesis. Reviewers: craig.topper, RKSimon, courbet, gchatelet Subscribers: tschuett, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D70891
* [X86] Add initialization of MXCSR in llvm-exegesisWang, Pengfei2019-12-021-0/+17
| | | | | | | | | | | | Summary: This patch is used to initialize the new added register MXCSR. Reviewers: craig.topper, RKSimon Subscribers: tschuett, courbet, llvm-commits, LiuChen3 Tags: #llvm Differential Revision: https://reviews.llvm.org/D70874
* Move CodeGenFileType enum to Support/CodeGen.hReid Kleckner2019-11-131-1/+1
| | | | | | | Avoids the need to include TargetMachine.h from various places just for an enum. Various other enums live here, such as the optimization level, TLS model, etc. Data suggests that this change probably doesn't matter, but it seems nice to have anyway.
* llvm-exegesis - fix shadow variable warnings. NFCI.Simon Pilgrim2019-11-092-5/+5
|
* [Mips] Use appropriate private label prefix based on Mips ABIMirko Brkusanin2019-10-231-1/+4
| | | | | | | | | | MipsMCAsmInfo was using '$' prefix for Mips32 and '.L' for Mips64 regardless of -target-abi option. By passing MCTargetOptions to MCAsmInfo we can find out Mips ABI and pick appropriate prefix. Tags: #llvm, #clang, #lldb Differential Revision: https://reviews.llvm.org/D66795
* Move endian constant from Host.h to SwapByteOrder.h, prune includeReid Kleckner2019-10-191-0/+1
| | | | | | | | | | | | | | Works on this dependency chain: ArrayRef.h -> Hashing.h -> --CUT-- Host.h -> StringMap.h / StringRef.h ArrayRef is very popular, but Host.h is rarely needed. Move the IsBigEndianHost constant to SwapByteOrder.h. Clients of that header are more likely to need it. llvm-svn: 375316
* Prune two MachineInstr.h includes, fix up depsReid Kleckner2019-10-191-0/+1
| | | | | | | | | | MachineInstr.h included AliasAnalysis.h, which includes a world of IR constructs mostly unneeded in CodeGen. Prune it. Same for DebugInfoMetadata.h. Noticed with -ftime-trace. llvm-svn: 375311
* [Mips][llvm-exegesis] Add a Mips targetSimon Atanasyan2019-10-115-1/+113
| | | | | | | | | | | The target does just enough to be able to run llvm-exegesis in latency mode for at least some opcodes. Patch by Miloš Stojanović. Differential Revision: https://reviews.llvm.org/D68649 llvm-svn: 374590
* [llvm-exegesis] Show noise cluster in analysis output.Clement Courbet2019-10-112-19/+68
| | | | | | | | | | | | Reviewers: gchatelet Subscribers: tschuett, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D68780 llvm-svn: 374533
* [llvm-exegesis] Ensure that ExecutableFunction are aligned.Clement Courbet2019-10-091-6/+10
| | | | | | | | | | | | | | Summary: Experiments show that this is the alignment we get (for ELF+Linux), but let's ensure that we have it. Reviewers: gchatelet Subscribers: tschuett, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D68703 llvm-svn: 374170
* [llvm-exegesis] Fix r374158Clement Courbet2019-10-092-16/+16
| | | | | | | | | Some bots complain about missing 'class': LlvmState.h:70:40: error: declaration of ‘std::unique_ptr<const llvm::TargetMachine> llvm::exegesis::LLVMState::TargetMachine’ [-fpermissive] std::unique_ptr<const TargetMachine> TargetMachine; llvm-svn: 374162
* [llvm-exegesis][NFC] Remove extra `llvm::` qualifications.Clement Courbet2019-10-0937-905/+822
| | | | | | | | | | | | | | Summary: Second patch: in the lib. Reviewers: gchatelet Subscribers: nemanjai, tschuett, MaskRay, mgrang, jsji, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D68692 llvm-svn: 374158
* [llvm-exegesis] Add missing std::move in rL374146.Clement Courbet2019-10-091-2/+2
| | | | | | | | | | | | This was breaking some bots: /home/buildbots/ppc64le-clang-lnt-test/clang-ppc64le-lnt/llvm/include/llvm/Support/Error.h:483:5: required from ‘llvm::Expected<T>::Expected(OtherT&&, typename std::enable_if<std::is_convertible<_Rep2, _Rep>::value>::type*) [with OtherT = std::vector<llvm::exegesis::CodeTemplate>&; T = std::vector<llvm::exegesis::CodeTemplate>; typename std::enable_if<std::is_convertible<_Rep2, _Rep>::value>::type = void]’ /home/buildbots/ppc64le-clang-lnt-test/clang-ppc64le-lnt/llvm/tools/llvm-exegesis/lib/X86/Target.cpp:238:20: required from here /usr/include/c++/6/bits/stl_construct.h:75:7: error: use of deleted function ‘llvm::exegesis::CodeTemplate::CodeTemplate(const llvm::exegesis::CodeTemplate&)’ { ::new(static_cast<void*>(__p)) _T1(std::forward<_Args>(__args)...); } ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ llvm-svn: 374149
* [llvm-exegesis][NFC] Fix rL374146.Clement Courbet2019-10-091-1/+1
| | | | | | Remove extra semicolon: Target.cpp:187:2: warning: extra ‘;’ [-Wpedantic] llvm-svn: 374147
* [llvm-exegesis] Explore LEA addressing modes.Clement Courbet2019-10-093-17/+113
| | | | | | | | | | | | | | | | | Summary: This will help for PR32326. This shows the well-known issue with `RBP` and `R13` as base registers. Reviewers: gchatelet Subscribers: tschuett, llvm-commits, RKSimon, andreadb Tags: #llvm Differential Revision: https://reviews.llvm.org/D68646 llvm-svn: 374146
* [llvm-exegesis] Add options to SnippetGenerator.Clement Courbet2019-10-088-25/+46
| | | | | | | | | | | | | | | | Summary: This adds a `-max-configs-per-opcode` option to limit the number of configs per opcode. Reviewers: gchatelet Subscribers: tschuett, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D68642 llvm-svn: 374054
* [llvm-exegesis] Finish plumbing the `Config` field.Clement Courbet2019-10-087-50/+46
| | | | | | | | | | | | | | | | | | | | | | Summary: Right now there are no snippet generators that emit the `Config` Field, but I plan to add it to investigate LEA operands for PR32326. What was broken was: - `Config` Was not propagated up until the BenchmarkResult::Key. - Clustering should really consider different configs as measuring different things, so we should stabilize on (Opcode, Config) instead of just Opcode. Reviewers: gchatelet Subscribers: tschuett, llvm-commits, lebedev.ri Tags: #llvm Differential Revision: https://reviews.llvm.org/D68629 llvm-svn: 374031
* [llvm-exegesis][NFC] Rename ExegesisTarget::decrementLoopCounterAndLoop()Clement Courbet2019-10-033-6/+10
| | | | | | | | | | | | | | Summary: To decrementLoopCounterAndJump, and explicitely take the jump target. Reviewers: gchatelet Subscribers: tschuett, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D68375 llvm-svn: 373571
* [llvm-exegesis/lib] Fix missing linkage to MCParserMichal Gorny2019-10-011-0/+1
| | | | | | | | | | | Otherwise, shared-lib build fails with: lib64/libLLVMExegesis.a(SnippetFile.cpp.o): In function `llvm::exegesis::readSnippets(llvm::exegesis::LLVMState const&, llvm::StringRef)': SnippetFile.cpp:(.text._ZN4llvm8exegesis12readSnippetsERKNS0_9LLVMStateENS_9StringRefE+0x31f): undefined reference to `llvm::createMCAsmParser(llvm::SourceMgr&, llvm::MCContext&, llvm::MCStreamer&, llvm::MCAsmInfo const&, unsigned int)' SnippetFile.cpp:(.text._ZN4llvm8exegesis12readSnippetsERKNS0_9LLVMStateENS_9StringRefE+0x41c): undefined reference to `llvm::MCAsmParser::setTargetParser(llvm::MCTargetAsmParser&)' collect2: error: ld returned 1 exit status llvm-svn: 373332
* [NewPM] Port MachineModuleInfo to the new pass manager.Yuanfang Chen2019-09-301-11/+11
| | | | | | | | | | | | | Existing clients are converted to use MachineModuleInfoWrapperPass. The new interface is for defining a new pass manager API in CodeGen. Reviewers: fedor.sergeev, philip.pfaffe, chandlerc, arsenm Reviewed By: arsenm, fedor.sergeev Differential Revision: https://reviews.llvm.org/D64183 llvm-svn: 373240
* [llvm-exegesis][NFC] Move BenchmarkFailure to own file.Clement Courbet2019-09-3010-46/+66
| | | | | | | | | | | | | | Summary: And rename to exegesis::Failure, as it's used everytwhere. Reviewers: gchatelet Subscribers: tschuett, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D68217 llvm-svn: 373209
* [llvm-exegesis][NFC] Refactor snippet file reading out of tool main.Clement Courbet2019-09-304-144/+201
| | | | | | | | | | | | | | Summary: Add unit tests. Reviewers: gchatelet Subscribers: mgorny, tschuett, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D68212 llvm-svn: 373202
* Fix MSVC "not all control paths return a value" warning. NFCI.Simon Pilgrim2019-09-271-0/+1
| | | | llvm-svn: 373100
* [llvm-exegesis] Add loop mode for repeating the snippet.Clement Courbet2019-09-2713-81/+376
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Before this change the Executable function was made by duplicating the snippet. This change adds a --repetion-mode={loop|duplicate} flag that allows choosing between this behaviour and wrapping the snippet instructions in a loop. The new mode can help measurements when the snippet fits in the DSB by short-cirtcuiting decoding. The loop adds a dec + jmp to the measurements, but since these are not part of the critical path, they execute in parallel with the measured code and do not impact measurements in practice. Overview of the change: - New SnippetRepetitor abstraction that handles repeating the snippet. The assembler delegates repeating the instructions to this class. - ExegesisTarget learns how to decrement loop counter and jump. - Some refactoring of the assembler into FunctionFiller/BasicBlockFiller. Reviewers: gchatelet Subscribers: mgorny, tschuett, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D68125 llvm-svn: 373083
* [llvm-exegesis] Refactor how forbidden registers are computed.Clement Courbet2019-09-279-72/+102
| | | | | | | | | | | | | | | | | | | | Summary: Right now latency generation can incorrectly select the scratch register as a dependency-carrying register. - Move the logic for preventing register selection from Uops implementation to common SnippetGenerator class. - Aliasing detection now takes a set of forbidden registers just like random register assignment does. Reviewers: gchatelet Subscribers: tschuett, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D68084 llvm-svn: 373048
* [llvm-exegesis][NFC] Remove dead code.Clement Courbet2019-09-262-10/+0
| | | | | | | | | | | | | | Summary: `hasAliasingImplicitRegistersThrough()` is no longer used. Reviewers: gchatelet Subscribers: tschuett, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D68078 llvm-svn: 372968
* [llvm] Migrate llvm::make_unique to std::make_uniqueJonas Devlieghere2019-08-156-16/+16
| | | | | | | | Now that we've moved to C++14, we no longer need the llvm::make_unique implementation from STLExtras.h. This patch is a mechanical replacement of (hopefully) all the llvm::make_unique instances across the monorepo. llvm-svn: 369013
* Rename F_{None,Text,Append} to OF_{None,Text,Append}. NFCFangrui Song2019-08-051-1/+1
| | | | | | F_{None,Text,Append} are kept for compatibility since r334221. llvm-svn: 367800
* fix a typo unavaliable=>unavailableSylvestre Ledru2019-06-081-1/+1
| | | | llvm-svn: 362878
* [llvm-exegesis] Move native target initialization code to a separate file.Clement Courbet2019-05-222-7/+42
| | | | | | | | | | | | | | Summary: This helps building internal tools on top of the library. Reviewers: gchatelet Subscribers: tschuett, llvm-commits, bdb, ondrasej Tags: #llvm Differential Revision: https://reviews.llvm.org/D62239 llvm-svn: 361385
* [llvm-exegesis] BenchmarkRunner::runConfiguration(): write small snippet to ↵Roman Lebedev2019-05-071-7/+6
| | | | | | | | | | | | | memory It was previously writing this temporary snippet to file, then reading it back, but leaving the tmp file in place. This is both unefficient, and results in huge garbage pileup in /tmp. One would have thought it would have been caught during D60317.. llvm-svn: 360138
* [llvm-exegesis] InstructionBenchmark::writeYamlTo(): don't forget to flush()Roman Lebedev2019-05-071-0/+2
| | | | | | | | | | | | This *APPEARS* to fix a *very* infuriating issue of Yaml's being corrupted, partially written, truncated. Or at least i'm not seeing the issue on a new benchmark sweep. The issue is somewhat rare, happens maybe once in 1000 benchmarks. Which means there are up to hundreds of broken benchmarks for a full x86 sweep in a single mode. llvm-svn: 360124
* Revert "Use llvm::lower_bound. NFC"Ali Tamur2019-04-111-7/+14
| | | | | | | | | This reverts commit rL358161. This patch have broken the test: llvm/test/tools/llvm-exegesis/X86/uops-CMOV16rm-noreg.s llvm-svn: 358199
* Use llvm::lower_bound. NFCFangrui Song2019-04-111-14/+7
| | | | llvm-svn: 358161
* [llvm-exegesis] Fix serialization/deserialization of special NoRegister ↵Roman Lebedev2019-04-111-7/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | register (PR41448) Summary: A *lot* of instructions have this special register. It seems this never really worked, but i finally noticed it only because it happened to break for `CMOV16rm` instruction. We serialized that register as "" (empty string), which is naturally 'ignored' during deserialization, so we re-create a `MCInst` with too few operands. And when we then happened to try to resolve variant sched class for this mis-serialized instruction, and the variant predicate tried to read an operand that was out of bounds since we got less operands, we crashed. Fixes [[ https://bugs.llvm.org/show_bug.cgi?id=41448 | PR41448 ]]. Reviewers: craig.topper, courbet Reviewed By: courbet Subscribers: tschuett, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D60517 llvm-svn: 358153
* [llvm-exegesis] Pacify bots - don't std::move() - prevents copy elisionRoman Lebedev2019-04-101-2/+2
| | | | llvm-svn: 358079
* [llvm-exegesis] YamlContext: fix some missing spaces/quotes/newlines in ↵Roman Lebedev2019-04-101-6/+6
| | | | | | error strings llvm-svn: 358077
* [llvm-exegesis] Fix error propagation from yaml writing (from serialization)Roman Lebedev2019-04-102-8/+17
| | | | | | Investigating https://bugs.llvm.org/show_bug.cgi?id=41448 llvm-svn: 358076
* [llvm-exegesis] benchmarkMain(): less cryptic error if built w/o libpfmRoman Lebedev2019-04-081-0/+5
| | | | | | | | | | | Wanted to check if inablility to measure latency of CMOV32rm is a regression from D60041 / D60138, but unable to do that because the llvm-exegesis-{8,9} from debian sid fails with that cryptic, unhelpful error. I suspect this will be a better error. llvm-svn: 357900
* [llvm-exegesis][X86] Randomize CMOVcc/SETcc OPERAND_COND_CODE CondCodesRoman Lebedev2019-04-083-7/+12
| | | | | | | | | | | | | | Reviewers: courbet, gchatelet Reviewed By: gchatelet Subscribers: tschuett, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D60066 llvm-svn: 357898
OpenPOWER on IntegriCloud