summaryrefslogtreecommitdiffstats
path: root/llvm/utils
Commit message (Collapse)AuthorAgeFilesLines
* [X86] movdiri and movdir64b instructionsGabor Buella2018-05-011-0/+4
| | | | | | | | | | Reviewers: spatel, craig.topper, RKSimon Reviewed By: craig.topper, RKSimon Differential Revision: https://reviews.llvm.org/D45983 llvm-svn: 331248
* [X86] Remove 'opaque ptr' from the intel syntax parser and printer.Craig Topper2018-05-011-8/+2
| | | | | | | | Previously for instructions like fxsave we would print "opaque ptr" as part of the memory operand. Now we print nothing. We also no longer accept "opaque ptr" in the parser. We still accept any size to be specified for these instructions, but we may want to consider only parsing when no explicit size is specified. This what gas does. llvm-svn: 331243
* IWYU for llvm-config.h in llvm, additions.Nico Weber2018-04-302-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | See r331124 for how I made a list of files missing the include. I then ran this Python script: for f in open('filelist.txt'): f = f.strip() fl = open(f).readlines() found = False for i in xrange(len(fl)): p = '#include "llvm/' if not fl[i].startswith(p): continue if fl[i][len(p):] > 'Config': fl.insert(i, '#include "llvm/Config/llvm-config.h"\n') found = True break if not found: print 'not found', f else: open(f, 'w').write(''.join(fl)) and then looked through everything with `svn diff | diffstat -l | xargs -n 1000 gvim -p` and tried to fix include ordering and whatnot. No intended behavior change. llvm-svn: 331184
* NFC - Typo fixes lib/VMCore -> lib/IRGabor Buella2018-04-301-1/+1
| | | | llvm-svn: 331166
* [Tablegen] SubtargetEmitter: move the logic that prints predicates for ↵Andrea Di Biagio2018-04-261-21/+47
| | | | | | variant scheduling classes to helper functions. NFC llvm-svn: 330968
* [Tablegen] Simplify code in CodeGenSchedule. NFCIAndrea Di Biagio2018-04-262-144/+117
| | | | llvm-svn: 330935
* [AsmMatcher] Extend PredicateMethod with optional DiagnosticPredicateSander de Smalen2018-04-261-4/+10
| | | | | | | | | | | | | | | | | | An optional, light-weight and backward-compatible mechanism to allow specifying that a diagnostic _only_ applies to a partial mismatch (NearMiss), rather than a full mismatch. Patch [1/2] in a series to improve assembler diagnostics for SVE. - Patch [1/2]: https://reviews.llvm.org/D45879 - Patch [2/2]: https://reviews.llvm.org/D45880 Reviewers: olista01, stoklund, craig.topper, mcrosier, rengolin, echristo, fhahn, SjoerdMeijer, evandro, javed.absar Reviewed By: olista01 Differential Revision: https://reviews.llvm.org/D45879 llvm-svn: 330930
* Revert r330755 "[lit] Report line number for failed RUN command"Reid Kleckner2018-04-2515-153/+16
| | | | | | | It is causing many tests to fail on Windows buildbots: http://lab.llvm.org:8011/builders/clang-x64-ninja-win7/builds/10211 llvm-svn: 330848
* [UpdateTestChecks] Change update_mca_test_checks.py file mode to match the ↵Greg Bedwell2018-04-251-0/+0
| | | | | | other scripts llvm-svn: 330815
* [TableGen] Fix bad indentation in tablegen output file.Craig Topper2018-04-251-2/+2
| | | | llvm-svn: 330801
* [lit] Report line number for failed RUN commandJoel E. Denny2018-04-2415-16/+153
| | | | | | | | | | | | | | | | | | | | | When debugging test failures with -vv (or -v in the case of the internal shell), this makes it easier to locate the RUN line that failed. For example, clang's test/Driver/linux-ld.c has 892 total RUN lines, and clang's test/Driver/arm-cortex-cpus.c has 424 RUN lines after concatenation for line continuations. When reading the generated shell script, this also makes it easier to locate the RUN line that produced each command. To support reporting RUN line numbers in the case of the internal shell, this patch extends the internal shell to support the null command, ":", except pipelines are not supported. Reviewed By: asmith, delcypher Differential Revision: https://reviews.llvm.org/D44598 llvm-svn: 330755
* [lit] Remove spurious `-` in invocation of lit inDan Liew2018-04-241-1/+1
| | | | | | | | | | `shtest-xunit-output.py` test. Although there is no `-` file Jeremy Morse has reported to me that it causes problems in their setup because lit tries to find it and ends up loading an out of tree lit configuration file. llvm-svn: 330728
* Mostly revert r330672.Nico Weber2018-04-241-0/+4
| | | | | | | | | The test is apparently needed e.g. for check-cfi on Windows where we get 'C:/b/slave/sanitizer-windows/build/./bin/clang.exe': command not found without it. Try to fix the problem that was fixed by r330672 by also checking for isabs() instead. llvm-svn: 330673
* Remove code that's almost always dead, and harmful if not.Nico Weber2018-04-241-4/+0
| | | | | | | | | | | | | | lit's util.which() would check if the passed-in path existed directly, and if so return it as-is. This is never the case when running llvm's, clang's, or lld's tests normally. But when running `./llvm-lit path/to/clang/test` with a cwd of llvm-build/bin, this if would detect that clang exists at path 'clang' and return 'clang' as the discovered clang binary -- and then lit would use the " clang " -> "*** Do not use 'clang' in tests, use '%clang'. ***" substitution to replace that with a broken test. By removing this early return, lit ends up with the usual absolute path and everything works even in this uncommon case. llvm-svn: 330672
* [X86] Revert r330638 - accidental commitGabor Buella2018-04-231-4/+0
| | | | llvm-svn: 330640
* [X86] movdiri and movdir64b instructionsGabor Buella2018-04-231-0/+4
| | | | | Reviewers: craig.topper llvm-svn: 330638
* [X86] Remove an unnecessary HANDLE_OPTIONAL line from the disassembler ↵Craig Topper2018-04-221-1/+0
| | | | | | operand processing. llvm-svn: 330534
* [X86] Remove DATA32_PREFIX. Hack the printing for DATA16_PREFIX to print ↵Craig Topper2018-04-221-4/+0
| | | | | | | | | | 'data32' in 16-bit mode. Hack the asm parser to convert 'data32' to 'data16' in 16-bit mode. Improve the error messages to match GNU assembler. This also allows us to remove the hack from the disassembler table building. llvm-svn: 330531
* Remove llvm-build's --configure-target-def-file.Nico Weber2018-04-202-114/+1
| | | | | | | | | | It was added 6.5 years ago in r144345, but was never hooked up and has been unused since. If _you_ do use this, feel free to revert, but add a comment on where it's used. https://reviews.llvm.org/D45262 llvm-svn: 330455
* [utils] improve AArch64 asm parserSanjay Patel2018-04-201-1/+1
| | | | | | | | If we don't mark the cfi line as optional, the script won't work with 'nounwind' code. Without that attr, there may be extra noise in the asm body that we don't want to see. llvm-svn: 330453
* [UpdateTestChecks] Fix update_mca_test_checks.py slowness issueGreg Bedwell2018-04-201-8/+1
| | | | | | | | | The script was using Python's difflib module to calculate the number of lines changed so that it could report it in its status output. It turns out this can be very very slow on large sets of lines (Python bug 6931). It's not worth the cost, so just remove the usage of difflib entirely. llvm-svn: 330419
* [Dockerfiles] Split checkout and build scripts into separate files.Ilya Biryukov2018-04-206-188/+245
| | | | | | | | | | | | | | | | | | | | | Summary: This is a small refactoring to extract the svn checkout code from the build script used inside the docker image. This would give more flexibility if more than a single invocation of cmake is needed inside the docker image. User-facing interface (build_docker_image.sh) hasn't changed, only the internal scripts running inside the build container are affected. Reviewers: ioeric Reviewed By: ioeric Subscribers: mehdi_amini, llvm-commits Differential Revision: https://reviews.llvm.org/D45868 llvm-svn: 330412
* [lit] Fix a bug where UNRESOLVED tests were not handled in the XUnitDan Liew2018-04-202-1/+80
| | | | | | | | | | | XML printer. A test has been added that tries to comprehensively test emitting XUnit XML output for shell tests. Differential Revision: https://reviews.llvm.org/D45567 llvm-svn: 330409
* Add SPARC support to update_llc_test_checks.pyDaniel Cederman2018-04-201-0/+18
| | | | | | | | | | | | Reviewers: spatel, jyknight Reviewed By: spatel Subscribers: fedor.sergeev, llvm-commits Differential Revision: https://reviews.llvm.org/D45809 llvm-svn: 330401
* [X86] Remove non-existant instruction name from X86DisassemblerTables.cpp.Craig Topper2018-04-191-1/+0
| | | | | | This instruction was removed a long time so we don't need to check for it here. llvm-svn: 330363
* [llvm-exegesis] Fix PfmIssueCountersTable creationSimon Pilgrim2018-04-191-6/+11
| | | | | | | | | | | | | | This patch ensures that the pfm issue counter tables are the correct size, accounting for the invalid resource entry at the beginning of the resource tables. It also fixes an issue with pfm failing to match event counters due to a trailing comma added to all the event names. I've also added a counter comment to each entry as it helps locate problems with the tables. Note: I don't have access to a SandyBridge test machine, which is the only model to make use of multiple event counters being mapped to a single resource. I don't know if pfm accepts a comma-seperated list or not, but that is what it was doing. Differential Revision: https://reviews.llvm.org/D45787 llvm-svn: 330317
* [UpdateTestChecks] Add update_mca_test_checks.py scriptGreg Bedwell2018-04-181-0/+368
| | | | | | | | | | | This script can be used to regenerate tests in the test/tools/llvm-mca directory (PR36904). Regenerated a number of tests using the pattern: test/tools/llvm-mca/*/*/*.s Differential Revision: https://reviews.llvm.org/D45369 llvm-svn: 330246
* Define InitLLVM to do common initialization all at once.Rui Ueyama2018-04-131-4/+2
| | | | | | | | | | | We have a few functions that virtually all command wants to run on process startup/shutdown. This patch adds InitLLVM class to do that all at once, so that we don't need to copy-n-paste boilerplate code to each llvm command's main() function. Differential Revision: https://reviews.llvm.org/D45602 llvm-svn: 330046
* [lit] Remove duplicate to_string methodAaron Smith2018-04-121-5/+0
| | | | | | | | | | | | | | | There are two versions of to_string used by TestRunner.py. The one defined in TestRunner.py and the one defined in utils/lit/lit/util.py. The util.py version is superior to the TestRunner.py version. This change removes the duplicate to_string in TestRunner.py in favor of always using the version from util.py. Beside removing duplicate code, this makes it easier to debug TestRunner.py since only one version of to_string is used. Patch by Stella Stamenova! llvm-svn: 329972
* X86FoldTableEntry - avoid unnecessary std::string creation. NFCI.Simon Pilgrim2018-04-111-3/+3
| | | | llvm-svn: 329860
* Don't repeatedly evaluate size() in the for loop. NFCI.Simon Pilgrim2018-04-111-1/+1
| | | | llvm-svn: 329853
* [MC][TableGen] Fix r329675.Clement Courbet2018-04-101-4/+6
| | | | | | Caught by bots with -Wmissing-braces. llvm-svn: 329676
* [MC][TableGen] Add optional libpfm counter names for ProcResUnits.Clement Courbet2018-04-103-4/+90
| | | | | | | | | | | | | | | | Summary: Subtargets can define the libpfm counter names that can be used to measure cycles and uops issued on ProcResUnits. This allows making llvm-exegesis available on more targets. Fixes PR36984. Reviewers: gchatelet, RKSimon, andreadb, craig.topper Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D45360 llvm-svn: 329675
* [unittests] Change std::sort to llvm::sort in response to r327219Mandeep Singh Grang2018-04-071-1/+1
| | | | | | | | | | | | | | | 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. llvm-svn: 329475
* [lit] Fix several Python 2/3 compatibility issues and testsAaron Smith2018-04-071-1/+7
| | | | | | | | | | | | | | | | | | | - In Python 2.x, basestring is the base string type, but in Python 3.x basestring is not defined and instead str includes unicode strings. - When Python is in a path that includes spaces, it needs to be specified with quotes in the test files for it to run. - The cache.ll test relies on files of a specific size being created by Python, but on some versions of Windows the files that are created by the current code are one byte larger than expected. To fix the test, update file creation to always make files of the expected size. Patch by Stella Stamenova! llvm-svn: 329466
* [RISCV] Tablegen-driven Instruction Compression.Sameer AbuAsal2018-04-064-0/+814
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch implements a tablegen-driven Instruction Compression mechanism for generating RISCV compressed instructions (C Extension) from the expanded instruction form. This tablegen backend processes CompressPat declarations in a td file and generates all the compile-time and runtime checks required to validate the declarations, validate the input operands and generate correct instructions. The checks include validating register operands, immediate operands, fixed register operands and fixed immediate operands. Example: class CompressPat<dag input, dag output> { dag Input = input; dag Output = output; list<Predicate> Predicates = []; } let Predicates = [HasStdExtC] in { def : CompressPat<(ADD GPRNoX0:$rs1, GPRNoX0:$rs1, GPRNoX0:$rs2), (C_ADD GPRNoX0:$rs1, GPRNoX0:$rs2)>; } The result is an auto-generated header file 'RISCVGenCompressEmitter.inc' which exports two functions for compressing/uncompressing MCInst instructions, plus some helper functions: bool compressInst(MCInst& OutInst, const MCInst &MI, const MCSubtargetInfo &STI, MCContext &Context); bool uncompressInst(MCInst& OutInst, const MCInst &MI, const MCRegisterInfo &MRI, const MCSubtargetInfo &STI); The clients that include this auto-generated header file and invoke these functions can compress an instruction before emitting it, in the target-specific ASM or ELF streamer, or can uncompress an instruction before printing it, when the expanded instruction format aliases is favored. The following clients were added to implement compression\uncompression for RISCV: 1) RISCVAsmParser::MatchAndEmitInstruction: Inserted a call to compressInst() to compresses instructions parsed by llvm-mc coming from an ASM input. 2) RISCVAsmPrinter::EmitInstruction: Inserted a call to compressInst() to compress instructions that were lowered from Machine Instructions (MachineInstr). 3) RVInstPrinter::printInst: Inserted a call to uncompressInst() to print the expanded version of the instruction instead of the compressed one (e.g, add s0, s0, a5 instead of c.add s0, a5) when -riscv-no-aliases is not passed. This patch squashes D45119, D42780 and D41932. It was reviewed in smaller patches by asb, efriedma, apazos and mgrang. Reviewers: asb, efriedma, apazos, llvm-commits, sabuasal Reviewed By: sabuasal Subscribers: mgorny, eraman, asb, rbar, johnrusso, simoncook, jordy.potman.lists, apazos, niosHD, kito-cheng, shiva0217, zzheng Differential Revision: https://reviews.llvm.org/D45385 llvm-svn: 329455
* [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
OpenPOWER on IntegriCloud