summaryrefslogtreecommitdiffstats
path: root/llvm/utils
Commit message (Collapse)AuthorAgeFilesLines
...
* [TableGen] Fix a bug that MCSchedClassDesc is interfered between different ↵QingShan Zhang2019-10-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SchedModel Assume that, ModelA has scheduling resource for InstA and ModelB has scheduling resource for InstB. This is what the llvm::MCSchedClassDesc looks like: llvm::MCSchedClassDesc ModelASchedClasses[] = { ... InstA, 0, ... InstB, -1,... }; llvm::MCSchedClassDesc ModelBSchedClasses[] = { ... InstA, -1,... InstB, 0,... }; The -1 means invalid num of macro ops, while it is valid if it is >=0. This is what we look like now: llvm::MCSchedClassDesc ModelASchedClasses[] = { ... InstA, 0, ... InstB, 0,... }; llvm::MCSchedClassDesc ModelBSchedClasses[] = { ... InstA, 0,... InstB, 0,... }; And compiler hit the assertion here because the SCDesc is valid now for both InstA and InstB. Differential Revision: https://reviews.llvm.org/D67950 llvm-svn: 374524
* gn build: Merge r374476GN Sync Bot2019-10-101-0/+1
| | | | llvm-svn: 374482
* [lit] Break main into smaller functionsJulian Lettner2019-10-101-181/+199
| | | | | | | | | | | This change is purely mechanical. I will do further cleanups of parameter usages. Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D68830 llvm-svn: 374452
* [lit] Add comment explaining the LIT_OPTS env var overrides command line optionsJulian Lettner2019-10-101-2/+4
| | | | | | | Normally, command line options override environment variables. Add comment to state that we are doing the reverse on purpose. llvm-svn: 374441
* [lit] Bring back `--threads` option aliasJulian Lettner2019-10-101-1/+1
| | | | | | | | Bring back `--threads` option which was lost in the move of the command line argument parsing code to cl_arguments.py. Update docs since `--workers` is preferred. llvm-svn: 374432
* Revert r374388: "[lit] Make internal diff work in pipelines"Joel E. Denny2019-10-105-276/+241
| | | | | | This breaks a Windows bot. llvm-svn: 374429
* Revert r374389: "[lit] Clean up internal diff's encoding handling"Joel E. Denny2019-10-107-86/+33
| | | | | | This breaks a Windows bot. llvm-svn: 374427
* Revert r374390: "[lit] Extend internal diff to support `-` argument"Joel E. Denny2019-10-107-146/+5
| | | | | | This breaks a Windows bot. llvm-svn: 374426
* Revert r374392: "[lit] Extend internal diff to support -U"Joel E. Denny2019-10-104-136/+6
| | | | | | This breaks a Windows bot. llvm-svn: 374425
* [lit] Leverage argparse features to remove some codeJulian Lettner2019-10-103-34/+28
| | | | | | | | Reviewed By: rnk, serge-sans-paille Differential Revision: https://reviews.llvm.org/D68589 llvm-svn: 374405
* [lit] Move argument parsing/validation to separate fileJulian Lettner2019-10-102-159/+228
| | | | | | | | Reviewed By: serge-sans-paille Differential Revision: https://reviews.llvm.org/D68529 llvm-svn: 374400
* gn build: restore tablegen restat optimization after r373664Nico Weber2019-10-101-0/+2
| | | | llvm-svn: 374395
* [lit] Extend internal diff to support -UJoel E. Denny2019-10-104-6/+136
| | | | | | | | | | | | | | | | | | | | | | When using lit's internal shell, RUN lines like the following accidentally execute an external `diff` instead of lit's internal `diff`: ``` # RUN: program | diff -U1 file - ``` Such cases exist now, in `clang/test/Analysis` for example. We are preparing patches to ensure lit's internal `diff` is called in such cases, which will then fail because lit's internal `diff` doesn't recognize `-U` as a command-line option. This patch adds `-U` support. Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D68668 llvm-svn: 374392
* gn build: merge r374381 more (effectively a no-op)Nico Weber2019-10-101-0/+1
| | | | llvm-svn: 374391
* [lit] Extend internal diff to support `-` argumentJoel E. Denny2019-10-107-5/+146
| | | | | | | | | | | | | | | | | | | | | | When using lit's internal shell, RUN lines like the following accidentally execute an external `diff` instead of lit's internal `diff`: ``` # RUN: program | diff file - ``` Such cases exist now, in `clang/test/Analysis` for example. We are preparing patches to ensure lit's internal `diff` is called in such cases, which will then fail because lit's internal `diff` doesn't recognize `-` as a command-line option. This patch adds support for `-` to mean stdin. Reviewed By: probinson, rnk Differential Revision: https://reviews.llvm.org/D67643 llvm-svn: 374390
* [lit] Clean up internal diff's encoding handlingJoel E. Denny2019-10-107-33/+86
| | | | | | | | | | | | | | | | | As suggested by rnk at D67643#1673043, instead of reading files multiple times until an appropriate encoding is found, read them once as binary, and then try to decode what was read. For python >= 3.5, don't fail when attempting to decode the `diff_bytes` output in order to print it. Finally, add some tests for encoding handling. Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D68664 llvm-svn: 374389
* [lit] Make internal diff work in pipelinesJoel E. Denny2019-10-105-241/+276
| | | | | | | | | | | | | | | | | | | | | | | | | | | When using lit's internal shell, RUN lines like the following accidentally execute an external `diff` instead of lit's internal `diff`: ``` # RUN: program | diff file - # RUN: not diff file1 file2 | FileCheck %s ``` Such cases exist now, in `clang/test/Analysis` for example. We are preparing patches to ensure lit's internal `diff` is called in such cases, which will then fail because lit's internal `diff` cannot currently be used in pipelines and doesn't recognize `-` as a command-line option. To enable pipelines, this patch moves lit's `diff` implementation into an out-of-process script, similar to lit's `cat` implementation. A follow-up patch will implement `-` to mean stdin. Reviewed By: probinson, stella.stamenova Differential Revision: https://reviews.llvm.org/D66574 llvm-svn: 374388
* gn build: Merge r374381GN Sync Bot2019-10-101-0/+2
| | | | llvm-svn: 374383
* Revert "[FileCheck] Implement --ignore-case option."Dmitri Gribenko2019-10-101-656/+651
| | | | | | | This reverts commit r374339. It broke tests: http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/19066 llvm-svn: 374359
* [FileCheck] Implement --ignore-case option.Kai Nacke2019-10-101-651/+656
| | | | | | | | | | | | The FileCheck utility is enhanced to support a `--ignore-case` option. This is useful in cases where the output of Unix tools differs in case (e.g. case not specified by Posix). Reviewers: Bigcheese, jakehehrlich, rupprecht, espindola, alexshap, jhenderson, MaskRay Differential Revision: https://reviews.llvm.org/D68146 llvm-svn: 374339
* [update_cc_test_checks] Support 'clang | opt | FileCheck'Simon Tatham2019-10-101-6/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some clang lit tests use a pipeline of the form // RUN: %clang [args] -O0 %s | opt [specific optimizations] | FileCheck %s to make the expected test output depend on as few optimization phases as possible, for stability. But when you write a RUN line of this form, you lose the ability to use update_cc_test_checks.py to automatically generate the expected output, because it only supports two-stage pipelines consisting of '%clang | FileCheck' (or %clang_cc1). This change extends the set of supported RUN lines so that pipelines with an invocation of `opt` in the middle can still be automatically handled. To implement it, I've adjusted `get_function_body()` so that it can cope with an arbitrary sequence of intermediate pipeline commands. But the code that decides which RUN lines to consider is more conservative: it only adds clang | opt | FileCheck to the set of supported lines, because I didn't want to accidentally include some other kind of line that doesn't output IR at all. (Also in this commit is the minimal change to make this script work at all, after r373912 added an extra parameter to `add_ir_checks`.) Reviewers: MaskRay, xbolva00 Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D68406 llvm-svn: 374287
* gn build: Merge r374277GN Sync Bot2019-10-101-0/+1
| | | | llvm-svn: 374278
* gn build: (manually) merge r374271Nico Weber2019-10-105-7/+23
| | | | llvm-svn: 374272
* gn build: Merge r374245GN Sync Bot2019-10-091-0/+1
| | | | llvm-svn: 374260
* gn build: (manually) merge r374219Nico Weber2019-10-092-0/+14
| | | | llvm-svn: 374249
* [lit] Refactor ProgressDisplayJulian Lettner2019-10-095-119/+124
| | | | | | | | | | | | Move progress display to separate file. Simplify some code paths. Decouple from other components via progress callback. Remove unused `_Display` class. Reviewed By: serge-sans-paille Differential Revision: https://reviews.llvm.org/D68525 llvm-svn: 374194
* [TableGen] Fix crash when using HwModes in CodeEmitterGenJames Molloy2019-10-091-1/+2
| | | | | | | | When an instruction has an encoding definition for only a subset of the available HwModes, ensure we just avoid generating an encoding rather than crash. llvm-svn: 374150
* Unify the two CRC implementationsHans Wennborg2019-10-091-1/+0
| | | | | | | | | | | | | | | | | | | | | David added the JamCRC implementation in r246590. More recently, Eugene added a CRC-32 implementation in r357901, which falls back to zlib's crc32 function if present. These checksums are essentially the same, so having multiple implementations seems unnecessary. This replaces the CRC-32 implementation with the simpler one from JamCRC, and implements the JamCRC interface in terms of CRC-32 since this means it can use zlib's implementation when available, saving a few bytes and potentially making it faster. JamCRC took an ArrayRef<char> argument, and CRC-32 took a StringRef. This patch changes it to ArrayRef<uint8_t> which I think is the best choice, and simplifies a few of the callers nicely. Differential revision: https://reviews.llvm.org/D68570 llvm-svn: 374148
* gn build: unbreak libcxx build after r374116 by restoring gen_link_script.py ↵Nico Weber2019-10-082-1/+51
| | | | | | for gn llvm-svn: 374129
* [tblgen] Add getOperatorAsDef() to RecordDaniel Sanders2019-10-082-13/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: While working with DagInit's, it's often the case that you expect the operator to be a reference to a def. This patch adds a wrapper for this common case to reduce the amount of boilerplate callers need to duplicate repeatedly. getOperatorAsDef() returns the record if the DagInit has an operator that is a DefInit. Otherwise, it prints a fatal error. There's only a few pre-existing examples in LLVM at the moment and I've left a few instances of the code this simplifies as they had more specific error messages than the generic one this produces. I'm going to be using this a fair bit in my subsequent patches. Reviewers: bogner, volkan, nhaehnle Reviewed By: nhaehnle Subscribers: nhaehnle, hiraditya, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, lenary, s.egerton, pzheng, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D68424 llvm-svn: 374101
* [UpdateCCTestChecks] Detect function mangled name on separate lineDavid Greene2019-10-081-6/+20
| | | | | | | | | | | | Sometimes functions with large comment blocks in front of them have their declarations output on several lines by c-index-test. Hence the one-line function name/line/mangled pattern will not work to detect them. Break the pattern up into two patterns and keep state after seeing the name/line information until we finally see the mangled name. Differential Revision: https://reviews.llvm.org/D68272 llvm-svn: 374078
* gn build: Merge r374062GN Sync Bot2019-10-081-1/+0
| | | | llvm-svn: 374065
* gn build: Merge r374061GN Sync Bot2019-10-081-0/+1
| | | | llvm-svn: 374064
* gn build: Merge r374058GN Sync Bot2019-10-081-0/+1
| | | | llvm-svn: 374059
* [LitConfig] Silenced notes/warnings on quiet.Andrew Trick2019-10-081-2/+4
| | | | | | | | | | | | | | | | | | | | Lit has a "quiet" option, -q, which is documented to "suppress no error output". Previously, LitConfig displayed notes and warnings when the quiet option was specified. The result was that it was not possible to get only pertinent file/line information to be used by an editor to jump to the location where checks were failing without passing a number of unhelpful locations first. Here, the implementations of LitConfig.note and LitConfig.warning are modified to account for the quiet flag and avoid displaying if the flag has indeed been set. Patch by Nate Chandler Reviewed by yln Differential Revision: https://reviews.llvm.org/D68044 llvm-svn: 374009
* [X86] Add new calling convention that guarantees tail call optimizationReid Kleckner2019-10-071-0/+1
| | | | | | | | | | | | | | | | | When the target option GuaranteedTailCallOpt is specified, calls with the fastcc calling convention will be transformed into tail calls if they are in tail position. This diff adds a new calling convention, tailcc, currently supported only on X86, which behaves the same way as fastcc, except that the GuaranteedTailCallOpt flag does not need to enabled in order to enable tail call optimization. Patch by Dwight Guth <dwight.guth@runtimeverification.com>! Reviewed By: lebedev.ri, paquette, rnk Differential Revision: https://reviews.llvm.org/D67855 llvm-svn: 373976
* gn build: try to make system-libs.windows.test passNico Weber2019-10-071-1/+1
| | | | llvm-svn: 373948
* GlobalISel: Add target pre-isel instructionsMatt Arsenault2019-10-073-0/+3
| | | | | | | | | | | | | | Allows targets to introduce regbankselectable pseudo-instructions. Currently the closet feature to this is an intrinsic. However this requires creating a public intrinsic declaration. This litters the public intrinsic namespace with operations we don't necessarily want to expose to IR producers, and would rather leave as private to the backend. Use a new instruction bit. A previous attempt tried to keep using enum value ranges, but it turned into a mess. llvm-svn: 373937
* Allow update_test_checks.py to not scrub names.David Greene2019-10-072-3/+8
| | | | | | | | | | Add a --preserve-names option to tell the script not to replace IR names. Sometimes tests want those names. For example if a test is looking for a modification to an existing instruction we'll want to make the names. Differential Revision: https://reviews.llvm.org/D68081 llvm-svn: 373912
* gn build: use better triple on windowsNico Weber2019-10-071-1/+1
| | | | | | | | | | | The CMake build uses "x86_64-pc-windows-msvc". The "-msvc" suffix is important because e.g. clang/test/lit.cfg.py matches against the suffix "windows-msvc" to compute the presence of the "ms-sdk" and the absence of the "LP64" feature. Differential Revision: https://reviews.llvm.org/D68572 llvm-svn: 373899
* [TableGen] Pacify gcc-5.4 moreJames Molloy2019-10-071-2/+2
| | | | | | | Followup to a previous pacification, this performs the same workaround to the TableGen generated code for tuple automata. llvm-svn: 373883
* gn build: no-op style tweak in sync scriptNico Weber2019-10-071-1/+0
| | | | llvm-svn: 373873
* gn build: make windows build less brokenNico Weber2019-10-061-0/+3
| | | | llvm-svn: 373858
* [lit] Use better name for "test in parallel" conceptJulian Lettner2019-10-044-25/+22
| | | | | | | | | | | | In the past, lit used threads to run tests in parallel. Today we use `multiprocessing.Pool`, which uses processes. Let's stay more abstract and use "worker" everywhere. Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D68475 llvm-svn: 373794
* [utils] Fix incompatibility of bisect[-skip-count] with Python 3Mikhail Maltsev2019-10-042-6/+8
| | | | | | | | | | | | | | | | | | | | Summary: This change replaces the print statements with print function calls and also replaces the '/' operator (which is integer division in Py2, but becomes floating point division in Py3) with the '//' operator which has the same semantics in Py2 and Py3. Reviewers: greened, michaelplatings, gottesmm Reviewed By: greened Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D68138 llvm-svn: 373759
* gn build: (manually) merge r373718Nico Weber2019-10-042-0/+17
| | | | llvm-svn: 373726
* [TableGen] Introduce a generic automaton (DFA) backendJames Molloy2019-10-045-1/+510
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch introduces -gen-automata, a backend for generating deterministic finite-state automata. DFAs are already generated by the -gen-dfa-packetizer backend. This backend is more generic and will hopefully be used to implement the DFA generation (and determinization) for the packetizer in the future. This backend allows not only generation of a DFA from an NFA (nondeterministic finite-state automaton), it also emits sidetables that allow a path through the DFA under a sequence of inputs to be analyzed, and the equivalent set of all possible NFA transitions extracted. This allows a user to not just answer "can my problem be solved?" but also "what is the solution?". Clearly this analysis is more expensive than just playing a DFA forwards so is opt-in. The DFAPacketizer has this behaviour already but this is a more compact and generic representation. Examples are bundled in unittests/TableGen/Automata.td. Some are trivial, but the BinPacking example is a stripped-down version of the original target problem I set out to solve, where we pack values (actually immediates) into bins (an immediate pool in a VLIW bundle) subject to a set of esoteric constraints. Reviewers: t.p.northover Subscribers: mgorny, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D67968 llvm-svn: 373718
* gn build: Merge r373689GN Sync Bot2019-10-041-1/+1
| | | | llvm-svn: 373690
* Reland r349624: Let TableGen write output only if it changed, instead of ↵Nico Weber2019-10-031-5/+0
| | | | | | | | | | | doing so in cmake Move the write-if-changed logic behind a flag and don't pass it with the MSVC generator. msbuild doesn't have a restat optimization, so not doing write-if-change there doesn't have a cost, and it should fix whatever causes PR43385. llvm-svn: 373664
* gn build: (manually) merge 373651 betterNico Weber2019-10-031-1/+1
| | | | | | | | The reland uses a static library, not an object library. Doesn't really matter for the gn build, but it's probalby nice to have the same semantics for the target type. llvm-svn: 373660
OpenPOWER on IntegriCloud