summaryrefslogtreecommitdiffstats
path: root/llvm/utils
Commit message (Collapse)AuthorAgeFilesLines
* [TableGen] Change std::sort to llvm::sort in response to r327219Mandeep Singh Grang2018-04-0611-58/+59
| | | | | | | | | | | | | | | | | | | | | | Summary: r327219 added wrappers to std::sort which randomly shuffle the container before sorting. This will help in uncovering non-determinism caused due to undefined sorting order of objects having the same key. To make use of that infrastructure we need to invoke llvm::sort instead of std::sort. Note: This patch is one of a series of patches to replace *all* std::sort to llvm::sort. Refer the comments section in D44363 for a list of all the required patches. Reviewers: stoklund, kparzysz, dsanders Reviewed By: dsanders Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D45144 llvm-svn: 329451
* [UpdateTestChecks] Add update_analyze_test_checks.py for cost model analysis ↵Simon Pilgrim2018-04-063-6/+213
| | | | | | | | | | | | | | generation The script allows the auto-generation of checks for cost model tests to speed up their creation and help improve coverage, which will help a lot with PR36550. If the need arises we can add support for other analyze passes as well, but the cost models was the one I needed to get done - at the moment it just warns that any other analysis mode is unsupported. I've regenerated a couple of x86 test files to show the effect. Differential Revision: https://reviews.llvm.org/D45272 llvm-svn: 329390
* [X86] Disassembler support for having an ADSIZE prefix affect instructions ↵Craig Topper2018-04-052-2/+23
| | | | | | | | with 0xf2 and 0xf3 prefixes. Needed to support umonitor from D45253. llvm-svn: 329327
* Fix the buildbots after r329304.Andrea Di Biagio2018-04-051-1/+1
| | | | llvm-svn: 329306
* [MC][Tablegen] Allow models to describe the retire control unit for llvm-mca. Andrea Di Biagio2018-04-053-3/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds the ability to describe properties of the hardware retire control unit. Tablegen class RetireControlUnit has been added for this purpose (see TargetSchedule.td). A RetireControlUnit specifies the size of the reorder buffer, as well as the maximum number of opcodes that can be retired every cycle. A zero (or negative) value for the reorder buffer size means: "the size is unknown". If the size is unknown, then llvm-mca defaults it to the value of field SchedMachineModel::MicroOpBufferSize. A zero or negative number of opcodes retired per cycle means: "there is no restriction on the number of instructions that can be retired every cycle". Models can optionally specify an instance of RetireControlUnit. There can only be up-to one RetireControlUnit definition per scheduling model. Information related to the RCU (RetireControlUnit) is stored in (two new fields of) MCExtraProcessorInfo. llvm-mca loads that information when it initializes the DispatchUnit / RetireControlUnit (see Dispatch.h/Dispatch.cpp). This patch fixes PR36661. Differential Revision: https://reviews.llvm.org/D45259 llvm-svn: 329304
* [MC] Fix spaces between values printed by EmitRegisterFileInfo.Andrea Di Biagio2018-04-051-2/+2
| | | | llvm-svn: 329284
* [SchedModel] Complete models shouldn't match against itineraries when they ↵Simon Pilgrim2018-04-051-1/+2
| | | | | | | | | | | | don't use them (PR35639) For schedule models that don't use itineraries, checkCompleteness still checks that an instruction has a matching itinerary instead of skipping and going straight to matching the InstRWs. That doesn't seem to match what happens in TargetSchedule.cpp This patch causes problems for a number of models that had been incorrectly flagged as complete. Differential Revision: https://reviews.llvm.org/D43235 llvm-svn: 329280
* [UpdateTestChecks] Moved core functionality of add_asm_checks into add_checksSimon Pilgrim2018-04-052-27/+13
| | | | | | As discussed on D45272 llvm-svn: 329270
* [UpdateTestChecks] Split core functionality of add_ir_checks into add_checksSimon Pilgrim2018-04-051-7/+13
| | | | | | Cherry picked from D45272, also added some setup for add_asm_checks to use add_checks as well. llvm-svn: 329266
* [UpdateTestChecks] Make add_asm_checks more like add_ir_checksSimon Pilgrim2018-04-051-5/+8
| | | | | | Towards merging them as mentioned on D45272 llvm-svn: 329265
* [UpdateTestChecks] Remove unnecessary return from add_ir_checksSimon Pilgrim2018-04-052-2/+1
| | | | llvm-svn: 329262
* Remove llvm-build's --write-make-fragment which looks like a remnant from ↵Nico Weber2018-04-041-101/+0
| | | | | | the autoconf build. llvm-svn: 329191
* [Tablegen] Slightly refactor method SubtargetEmitter::EmitExtraProcessorInfo.Andrea Di Biagio2018-04-041-10/+41
| | | | | | | This patch moves most of the logic from EmitExtraProcessorInfo to a couple of helper functions. No functional change intended. llvm-svn: 329173
* 'cat' command for internal shell - Support Python 3Reid Kleckner2018-04-031-4/+12
| | | | | | | | | | | | | | | LLVM Bug Id : 36449 Revision 328563 caused tests to fail under python 3. This patch modified cat.py file to support both python 2 and 3. This patch also fixes CRLF issues on Windows. Patch by Chamal de Silva Differential Revision: https://reviews.llvm.org/D45077 llvm-svn: 329123
* Remove a stale comment cut and pasted from another file.Eric Christopher2018-04-031-1/+0
| | | | llvm-svn: 329084
* [MC][Tablegen] Allow the definition of processor register files in the ↵Andrea Di Biagio2018-04-033-2/+134
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | scheduling model for llvm-mca This patch allows the description of register files in processor scheduling models. This addresses PR36662. A new tablegen class named 'RegisterFile' has been added to TargetSchedule.td. Targets can optionally describe register files for their processors using that class. In particular, class RegisterFile allows to specify: - The total number of physical registers. - Which target registers are accessible through the register file. - The cost of allocating a register at register renaming stage. Example (from this patch - see file X86/X86ScheduleBtVer2.td) def FpuPRF : RegisterFile<72, [VR64, VR128, VR256], [1, 1, 2]> Here, FpuPRF describes a register file for MMX/XMM/YMM registers. On Jaguar (btver2), a YMM register definition consumes 2 physical registers, while MMX/XMM register definitions only cost 1 physical register. The syntax allows to specify an empty set of register classes. An empty set of register classes means: this register file models all the registers specified by the Target. For each register class, users can specify an optional register cost. By default, register costs default to 1. A value of 0 for the number of physical registers means: "this register file has an unbounded number of physical registers". This patch is structured in two parts. * Part 1 - MC/Tablegen * A first part adds the tablegen definition of RegisterFile, and teaches the SubtargetEmitter how to emit information related to register files. Information about register files is accessible through an instance of MCExtraProcessorInfo. The idea behind this design is to logically partition the processor description which is only used by external tools (like llvm-mca) from the processor information used by the llvm machine schedulers. I think that this design would make easier for targets to get rid of the extra processor information if they don't want it. * Part 2 - llvm-mca related * The second part of this patch is related to changes to llvm-mca. The main differences are: 1) class RegisterFile now needs to take into account the "cost of a register" when allocating physical registers at register renaming stage. 2) Point 1. triggered a minor refactoring which lef to the removal of the "maximum 32 register files" restriction. 3) The BackendStatistics view has been updated so that we can print out extra details related to each register file implemented by the processor. The effect of point 3. is also visible in tests register-files-[1..5].s. Differential Revision: https://reviews.llvm.org/D44980 llvm-svn: 329067
* [x86] Fix a pretty obvious think-o with my asm scrubbing. You have to inChandler Carruth2018-04-031-1/+1
| | | | | | | | | | fact use regular expression syntax to use regular expressions. Should restore the bots. Sorry for the noise on this test. Thanks to Philip for spotting the bug! llvm-svn: 329057
* [x86] Extend my goofy SP offset scrubbing for llc test cases to actuallyChandler Carruth2018-04-031-0/+7
| | | | | | | | | | | | | | | do explicit scrubbing of the offsets of stack spills and reloads. You can always turn this off in order to test specific stack slot usage. We were already hiding most of this, but the new logic hides it more generically. Notably, we should effectively hide stack slot churn in functions that have a frame pointer now, and should also hide it when changing a function from stack pointer to frame pointer. That transition already changes enough to be clearly noticed in the test case diff, showing *every* spill and reload is really noisy without benefit. See the test case I ran this on as a classic example. llvm-svn: 329055
* Add a wrapper around llvm-objdump to look for indirect calls/jmps in x86 ↵Eric Christopher2018-04-031-0/+49
| | | | | | | | | | | assembly. Useful when looking for indirect calls/jmps the need mitigation via retpoline or other mitigations for Spectre v2. Feedback, extension, additional patches welcome. llvm-svn: 329050
* [X86] Reduce number of OpPrefix bits in TSFlags to 2. NFCICraig Topper2018-04-031-1/+1
| | | | | | TSFlag doesn't need to disambiguate NoPrfx from PS. So shift the encodings so PS is NoPrfx|0x4. llvm-svn: 329049
* [X86][TableGen] Add a missing error check to make sure EVEX instructions use ↵Craig Topper2018-04-031-1/+5
| | | | | | one PS/PD/XS/XD prefixes. llvm-svn: 329048
* [TableGen] Use llvm::cast instead of static_cast so that the cast will be ↵Craig Topper2018-04-031-1/+1
| | | | | | checked. NFC llvm-svn: 329045
* Remove utils/makellvm; it doesn't look like it works with cmake builds.Nico Weber2018-04-031-145/+0
| | | | llvm-svn: 329041
* [lit] Prefer opening files with open (Python 2) rather than io.open which ↵Aaron Smith2018-04-031-7/+9
| | | | | | | | | | | requires io. Only rely on Python 3 (io.open) when necessary. This puts TestRunnyer.py closer to how it behaved before the changes introduced in D43165 and silences a few Windows build bot failures. Thanks to Stella Stamenova for the patch! llvm-svn: 329037
* [lit] One more try at fixing TestRunner.py for D43165Aaron Smith2018-04-021-0/+3
| | | | llvm-svn: 329026
* [lit] Attempt to fix builtin diff code for Python 2Reid Kleckner2018-04-021-0/+3
| | | | llvm-svn: 329024
* [lit] Fix problem in how Python versions open files with different encodingsAaron Smith2018-04-021-1/+41
| | | | | | | | | Reapply D43165 which was reverted because of different versions of python failing. The one line fix for the different python versions was commited at the same time that D43165 was reverted. If this change is giving you issues then get in touch with your python version and we will fix it. llvm-svn: 329022
* [lit] Use io.open to compare two files since it supports different encodings ↵Aaron Smith2018-04-021-1/+1
| | | | | | while older versions of open do not llvm-svn: 329020
* Revert r329012 "[lit] Fix problem in how Python versions open files with ↵Reid Kleckner2018-04-021-44/+1
| | | | | | | | | different encodings" This doesn't work with Python 2. See this build-in-progress: http://lab.llvm.org:8011/builders/clang-x86-windows-msvc2015/builds/11105 llvm-svn: 329017
* [lit] Fix problem in how Python versions open files with different encodingsAaron Smith2018-04-021-1/+44
| | | | | | | | | | | | | | | | | | | Summary: This issue was found when running the clang unit test on Windows. Python 3.x cannot open some of the files that the tests are using with a simple open because of their encoding. Python 2.7+ and Python 3.x both support io.open which allows for an encoding to be specified. This change will determine whether two files being compared should be opened (and then compared) as text or binary and whether to use utf-8 or the default encoding before proceeding with a line-by-line comparison. Patch by Stella Stamenova! Reviewers: zturner, llvm-commits, rnk, MaggieYi Reviewed By: zturner Subscribers: asmith, MatzeB, stella.stamenova, delcypher, llvm-commits Differential Revision: https://reviews.llvm.org/D43165 llvm-svn: 329012
* TableGen: Support Intrinsic values in SearchableTableNicolai Haehnle2018-04-011-4/+37
| | | | | | | | | | | | | | | | | | | | | Summary: We will use this in the AMDGPU backend in a subsequent patch in the stack to lookup target-specific per-intrinsic information. The generic CodeGenIntrinsic machinery is used to ensure that, even though we don't calculate actual enum values here, we do get the intrinsics in the right order for the binary search index. Change-Id: If61cd5587963a4c5a1cc53df1e59c5e4dec1f9dc Reviewers: arsenm, rampitec, b-sumner Subscribers: wdng, tpr, llvm-commits Differential Revision: https://reviews.llvm.org/D44935 llvm-svn: 328937
* TableGen: More helpful error messagesNicolai Haehnle2018-04-011-2/+6
| | | | | | | | | | | | | Summary: Change-Id: I3c23f6f6597912423762780cd8c5315870412bbe Reviewers: arsenm, rampitec, b-sumner Subscribers: wdng, llvm-commits Differential Revision: https://reviews.llvm.org/D44936 Change-Id: Ie62614a3e2d7774f46e4034478b28f57100a2c92 llvm-svn: 328936
* Fix a bunch of typoes. NFCFangrui Song2018-03-302-2/+2
| | | | llvm-svn: 328907
* Add missing dependency (headers are included from MC, so a link dependency ↵David Blaikie2018-03-291-1/+1
| | | | | | could exist easily enough) llvm-svn: 328743
* Revert "[lit] Temporarily disable shtest-timeout.py on darwin"Dan Liew2018-03-281-4/+1
| | | | | | | | | | This reverts commit 771829b640a5494ab65c810dd6b4330522bf3a33 (rr328598) Hopefully the test will now pass on the bots. rdar://problem/38774530 llvm-svn: 328703
* [lit] Remove a timing senstive part of `shtest-timeout.py`Dan Liew2018-03-282-52/+2
| | | | | | | | | | | | | | | | | | | | | | | The `shtest-timeout.py` test was failing intermittently. It looks like the issue is that on a resource constrained system lit is unable to run `quick_then_slow.py` twice and print out the messages the tests expects within the one second timeout. The underlying issue is that the test is dependent on the performance of the host machine is a rather fragile way. This is due to hardcoding timeout values and having assumptions that the host machine is able to perform a certain amount of work within the hardcoded timeout values. We could increase the timeout values but that doesn't really fix the underlying issue. Instead this patch removes one of fragile assumptions in the hope that this will be enough to fix the bots. There are other fragile assumptions in this test (e.g. `quick.py` can be executed in less than 1 second). If the bots continue to fail we'll have to revisit this. rdar://problem/38774530 llvm-svn: 328702
* [MachineScheduler] Add itinerary to schedcover.py. Make default work in the ↵Craig Topper2018-03-271-7/+16
| | | | | | | | | | | | | | | | | | | | | command line filter Summary: This patch adds itinerary support to the schedcover.py script. I've been trying to use this script to figure out why SSE and AVX instructions are ending up in separate tablegen scheduler classes and sometimes its because we are using different itineraries. Rather than using None to indicate the default scheduler model, I now use the string "default". I had to hack around the sorting a little to keep "default" at the beginning. But this also makes it so you can specify "default" on the command line to just get the defaults I also fixed the regular expression code so that the no_default wasn't evaluated twice. Reviewers: RKSimon, atrick, jmolloy, javed.absar Reviewed By: javed.absar Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D44834 llvm-svn: 328608
* Revert "Revert "[lit] Generalized /dev/null support on Windows.""Mircea Trofin2018-03-273-3/+32
| | | | | | | | | | | | | | | | | Summary: This reverts commit r328596. Checking if the arguments are strings before testing if they contain "/dev/null". Reviewers: rnk Reviewed By: rnk Subscribers: delcypher, llvm-commits Differential Revision: https://reviews.llvm.org/D44914 llvm-svn: 328603
* [lit] Temporarily disable shtest-timeout.py on darwinJan Korous2018-03-271-1/+4
| | | | | | | | Disabled until fixed in order to avoid random failures on green dragon. rdar://problem/38774530 llvm-svn: 328598
* Revert "[lit] Generalized /dev/null support on Windows."Mircea Trofin2018-03-263-32/+3
| | | | | | This reverts commit ca7fdbb974384ce5a05528b22a41d46b1cc13e92. llvm-svn: 328596
* [lit] Generalized /dev/null support on Windows.Mircea Trofin2018-03-263-3/+32
| | | | | | | | | | | | | | Generalized /dev/null remapping on Windows, and added test. Reviewers: rnk Reviewed By: rnk Subscribers: amccarth, zturner, delcypher, llvm-commits Differential Revision: https://reviews.llvm.org/D44771 llvm-svn: 328589
* [lit] Implement 'cat' command for internal shellReid Kleckner2018-03-268-12/+183
| | | | | | | | | | Fixes PR36449 Patch by Chamal de Silva Differential Revision: https://reviews.llvm.org/D43501 llvm-svn: 328563
* Migrate dockerfiles to use multi-stage builds.Ilya Biryukov2018-03-268-119/+48
| | | | | | | | | | | | | | | | | | | | Summary: We previously emulated multi-staged builds using two dockerfiles, native support from Docker allows us to merge them into one, simplifying our scripts. For more details about multi-stage builds, see: https://docs.docker.com/develop/develop-images/multistage-build/ Reviewers: mehdi_amini, klimek, sammccall Reviewed By: sammccall Subscribers: llvm-commits, ioeric, cfe-commits Differential Revision: https://reviews.llvm.org/D44787 llvm-svn: 328503
* [SchedModel] Remove instregex entries that don't match any instructionsSimon Pilgrim2018-03-251-2/+11
| | | | | | | | | | This patch throws a fatal error if an instregex entry doesn't actually match any instructions. This is part of the work to reduce the compile time impact of increased instregex usage (PR35955), although the x86 models seem to be relatively clean. All the cases I encountered have now been fixed in trunk and this will ensure they don't get reintroduced. Differential Revision: https://reviews.llvm.org/D44687 llvm-svn: 328459
* [SchedModel] Remove an unneeded temporary vector.Craig Topper2018-03-241-3/+2
| | | | llvm-svn: 328442
* [SchedModel] Use std::move in a couple places to reduce copyingCraig Topper2018-03-241-2/+3
| | | | llvm-svn: 328441
* [SchedModel] Use std::move to replace a vector instead of vector::swapCraig Topper2018-03-241-1/+1
| | | | | | We don't really care about the old vector value so we don't care to swap it. llvm-svn: 328440
* [SchedModel] Remove std::vectors that were created with 1 element and then ↵Craig Topper2018-03-241-8/+5
| | | | | | | | passed to an ArrayRef parameter. ArrayRef can capture a single element. We don't need a vector for that. llvm-svn: 328438
* [SchedModel] Record::getName() returns StringRef - avoid std::string ↵Simon Pilgrim2018-03-241-2/+2
| | | | | | creation. NFCI. llvm-svn: 328437
* [SchedModel] Avoid std::string creation for instregex patterns that don't ↵Simon Pilgrim2018-03-241-2/+3
| | | | | | contain regex metas. NFCI. llvm-svn: 328436
OpenPOWER on IntegriCloud