summaryrefslogtreecommitdiffstats
path: root/llvm/utils
Commit message (Collapse)AuthorAgeFilesLines
* Fix ubsan failures in lane mask shiftsKrzysztof Parzyszek2016-12-151-4/+8
| | | | llvm-svn: 289826
* Extract LaneBitmask into a separate typeKrzysztof Parzyszek2016-12-153-66/+73
| | | | | | | | | | | | Specifically avoid implicit conversions from/to integral types to avoid potential errors when changing the underlying type. For example, a typical initialization of a "full" mask was "LaneMask = ~0u", which would result in a value of 0x00000000FFFFFFFF if the type was extended to uint64_t. Differential Revision: https://reviews.llvm.org/D27454 llvm-svn: 289820
* [AVR] Whitelist the avrlit config environment variablesDylan McKay2016-12-151-1/+1
| | | | | | This allows us to use `lit` to run on-target execution tests. llvm-svn: 289769
* Revert "[AVR] Add the very first on-target test"Renato Golin2016-12-141-1/+1
| | | | | | | This reverts commit r289648, as it's an execution test and relies on the emulator/dispatcher being available on all builders. llvm-svn: 289651
* [AVR] Add the very first on-target testDylan McKay2016-12-141-1/+1
| | | | | | This test runs on actual AVR hardware. llvm-svn: 289648
* [AMDGPU, PowerPC, TableGen] Fix some Clang-tidy modernize and Include What ↵Eugene Zelenko2016-12-121-10/+14
| | | | | | You Use warnings; other minor fixes (NFC). llvm-svn: 289475
* [FileCheck] Re-implement the logic to find each check prefix in theChandler Carruth2016-12-111-93/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | check file to not be unreasonably slow in the face of multiple check prefixes. The previous logic would repeatedly scan potentially large portions of the check file looking for alternative prefixes. In the worst case this would scan most of the file looking for a rare prefix between every single occurance of a common prefix. Even if we bounded the scan, this would do bad things if the order of the prefixes was "unlucky" and the distant prefix was scanned for first. None of this is necessary. It is straightforward to build a state machine that recognizes the first, longest of the set of alternative prefixes. That is in fact exactly whan a regular expression does. This patch builds a regular expression once for the set of prefixes and then uses it to search incrementally for the next prefix. This requires some threading of state but actually makes the code dramatically simpler. I've also added a big comment describing the algorithm as it was not at all obvious to me when I started. With this patch, several previously pathological test cases in test/CodeGen/X86 are 5x and more faster. Overall, running all tests under test/CodeGen/X86 uses 10% less CPU after this, and because all the slowest tests were hitting this, finishes in 40% less wall time on my system (going from just over 5.38s to just over 3.23s) on a release build! This patch substantially improves the time of all 7 X86 tests that were in the top 20 reported by --time-tests, 5 of them are completely off the list and the remaining 2 are much lower. (Sadly, the new tests on the list include 2 new X86 ones that are slow for unrelated reasons, so the count stays at 4 of the top 20.) It isn't clear how much this helps debug builds in aggregate in part because of the noise, but it again makes mane of the slowest x86 tests significantly faster (10% or more improvement). llvm-svn: 289382
* [FileCheck] Remove a parameter that was simply always set toChandler Carruth2016-12-111-9/+4
| | | | | | | | a commandline flag and test the flag directly. NFC. If we ever need this generality it can be added back. llvm-svn: 289381
* [FileCheck] Clean up doxygen comments throughout. NFC.Chandler Carruth2016-12-111-70/+62
| | | | llvm-svn: 289380
* [FileCheck] Run clang-format over this code. NFC.Chandler Carruth2016-12-111-118/+108
| | | | | | | | | | This fixes one formatting goof I left in my previous commit and *many* other inconsistencies. I'm planning to make substantial changes here and so wanted to get to a clean baseline. llvm-svn: 289379
* Refactor FileCheck some to reduce memory allocation and copying. AlsoChandler Carruth2016-12-111-87/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | make some readability improvements. Both the check file and input file have to be fully buffered to normalize their whitespace. But previously this would be done in a stack SmallString and then copied into a heap allocated MemoryBuffer. That seems pretty wasteful, especially for something like FileCheck where there are only ever two such entities. This just rearranges the code so that we can keep the canonicalized buffers on the stack of the main function, use reasonably large stack buffers to reduce allocation. A rough estimate seems to show that about 80% of LLVM's .ll and .s files will fit into a 4k buffer, so this should completely avoid heap allocation for the buffer in those cases. My system's malloc is fast enough that the allocations don't directly show up in timings. However, on some very slow test cases, this saves 1% - 2% by avoiding the copy into the heap allocated buffer. This also splits out the code which checks the input into a helper much like the code to build the checks as that made the code much more readable to me. Nit picks and suggestions welcome here. It has really exposed a *bunch* of stuff that could be cleaned up though, so I'm probably going to go and spring clean all of this code as I have more changes coming to speed things up. llvm-svn: 289378
* [AMDGPU, PowerPC, TableGen] Fix some Clang-tidy modernize and Include What ↵Eugene Zelenko2016-12-091-13/+14
| | | | | | You Use warnings; other minor fixes (NFC). llvm-svn: 289282
* Summary: Currently there is no way to disable deprecated warning from asm ↵Weiming Zhao2016-12-051-1/+3
| | | | | | | | | | | | | | | | | | | | like this clang -target arm deprecated-asm.s -c deprecated-asm.s:30:9: warning: use of SP or PC in the list is deprecated stmia r4!, {r12-r14} We have to have an option what can disable it. Patched by Yin Ma! Reviewers: joey, echristo, weimingz Subscribers: llvm-commits, aemerson Differential Revision: https://reviews.llvm.org/D27219 llvm-svn: 288734
* [lit] Support custom parsers in parseIntegratedTestScriptEric Fiselier2016-12-054-50/+298
| | | | | | | | | | | | | | | | | | | | | | | Summary: Libc++ frequently has the need to parse more than just the builtin *test keywords* (`RUN`, `REQUIRES`, `XFAIL`, ect). For example libc++ currently needs a new keyword `MODULES-DEFINES: macro list...`. Instead of re-implementing the script parsing in libc++ this patch allows `parseIntegratedTestScript` to take custom parsers. This patch introduces a new class `IntegratedTestKeywordParser` which implements the logic to parse/process a test keyword. Parsing of various keyword "kinds" are supported out of the box, including 'TAG', 'COMMAND', and 'LIST', which parse keywords such as `END.`, `RUN:` and `XFAIL:` respectively. As an example after this change libc++ can implement the `MODULES-DEFINES` simply using: ``` mparser = IntegratedTestKeywordParser('MODULES-DEFINES:', ParserKind.LIST) parseIntegratedTestScript(test, additional_parsers=[mparser]) macro_list = mparser.getValue() ``` Reviewers: ddunbar, modocache, rnk, danalbert, jroelofs Subscribers: mgrang, llvm-commits, cfe-commits Differential Revision: https://reviews.llvm.org/D27005 llvm-svn: 288694
* TableGen/AsmMatcherEmitter: Bring sorting check back under EXPENSIVE_CHECKSMatthias Braun2016-12-051-3/+13
| | | | | | | | | | | Bring the sorting check back that I removed in r288655 but put it under EXPENSIVE_CHECKS this time. Also document that this the check isn't purely about having a sorted list but also about operator < having the correct transitive behavior. Apply the same to the other check in the file. llvm-svn: 288693
* TableGen/AsmMatcherEmitter: Trust that stable_sort worksMatthias Braun2016-12-051-10/+0
| | | | | | | | | A debug build of AsmMatcherEmitter would use a quadratic algorithm to check whether std::stable_sort() actually sorted. Let's hope the authors of our C++ standard library did that testing for us. Removing the check gives a 3x speedup in the X86 case. llvm-svn: 288655
* TableGen: Use StringInit instead of std::string for DagInit arg namesMatthias Braun2016-12-054-30/+34
| | | | llvm-svn: 288644
* TableGen: Use StringInit instead of std::string for DagInit nameMatthias Braun2016-12-051-4/+4
| | | | llvm-svn: 288643
* TableGen: Use StringRef instead of const std::string& in return vals.Matthias Braun2016-12-0418-37/+40
| | | | | | | This will allow to switch to a different string storage in an upcoming commit. llvm-svn: 288612
* [tablegen] Delete duplicates from a vector without skipping elementsVedant Kumar2016-12-011-0/+1
| | | | | | | | | | | | | | Tablegen's -gen-instr-info pass has a bug in its emitEnums() routine. The function intends for values in a vector to be deduplicated, but it accidentally skips over elements after performing a deletion. I think there are smarter ways of doing this deduplication, but we can do that in a follow-up commit if there's interest. See the thread: [PATCH] TableGen InstrMapping Bug fix. Patch by Tyler Kenney! llvm-svn: 288408
* Remove unused header, NFC.Vedant Kumar2016-12-011-1/+0
| | | | llvm-svn: 288407
* Recommit r287403 (reverted in r287804): [lit] When setting SDKROOT on ↵Kuba Mracek2016-12-011-1/+1
| | | | | | | | Darwin, use '--sdk macosx' to find the right SDK path. This shouls now be safe and not break any more bots. It's strictly better to use '--sdk macosx', otherwise xcrun can return weird things for example when you have Command Line Tools or the SDK installed into '/'. llvm-svn: 288385
* [git-llvm] Use --force-interactive when commiting to enable SVN to prompt ↵Mehdi Amini2016-11-301-1/+1
| | | | | | | | | | | | | password When svn does not know the password and it has to prompt, it needs to query. However it won't when invoked from the Python script and instead fails with: svn: E215004: Authentication failed and interactive prompting is disabled; see the --force-interactive option Differential Revision: https://reviews.llvm.org/D27274 llvm-svn: 288266
* Fix some Clang-tidy and Include What You Use warnings; other minor fixes (NFC).Eugene Zelenko2016-11-307-132/+219
| | | | | | This preparation to remove SetVector.h dependency on SmallSet.h. llvm-svn: 288256
* Apply clang-tidy's 'performance-faster-string-find' check to LLVM.Benjamin Kramer2016-11-301-1/+1
| | | | | | No functionality change intended. llvm-svn: 288235
* TableGen: Allow signed immediates for instruction aliasesJacob Baungard Hansen2016-11-241-1/+1
| | | | | | | | | | | | Patch by Daniel Cederman. Reviewers: stoklund, arsenm Subscribers: arsenm, llvm-commits Differential Revision: https://reviews.llvm.org/D27046 llvm-svn: 287856
* Revert "[lit] When setting SDKROOT on Darwin, use '--sdk macosx' to find the ↵Vedant Kumar2016-11-231-1/+1
| | | | | | | | | right SDK path." This reverts commit r287403. It breaks an internal asan bot. According to Kuba, a fix is up for review here: https://reviews.llvm.org/D26929 llvm-svn: 287804
* Add IntrInaccessibleMemOnly property for intrinsicsAndrew Kaylor2016-11-223-7/+60
| | | | | | Differential Revision: https://reviews.llvm.org/D26485 llvm-svn: 287680
* [TableGen][ISel] When factoring ScopeMatcher, if the child of the ↵Craig Topper2016-11-221-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ScopeMatcher we're working on is also a ScopeMatcher, merge all its children into the one we're working on. There were several cases in X86 where we were unable to fully factor a ScopeMatcher but created nested ScopeMatchers for some portions of it. Then we created a SwitchType that split it up and further factored it so that we ended up with something like this: SwitchType Scope Scope Sequence of matchers Some other sequence of matchers EndScope Another sequence of matchers EndScope ...Next type This change turns it into this: SwitchType Scope Sequence of matchers Some other sequence of matchers Another sequence of matchers EndScope ...Next type Several other in-tree targets had similar nested scopes like this. Overall this doesn't save many bytes, but makes the isel output a little more regular. llvm-svn: 287624
* [Sparc] Use target name instead of namespace as prefix for MCRegisterClasses ↵Jacob Baungard Hansen2016-11-211-1/+1
| | | | | | | | | | | | | | | | | | | array Summary: For Sparc the namespace (SP) is different from the target name (Sparc), which causes the name of the array in this declaration to differ from the name used in the definition. Patch by Daniel Cederman. Reviewers: jyknight Subscribers: llvm-commits, jyknight Differential Revision: https://reviews.llvm.org/D23650 llvm-svn: 287528
* [TableGen][ISel] Do a better job of factoring ScopeMatchers created during ↵Craig Topper2016-11-211-3/+11
| | | | | | | | | | creation of SwitchTypeMatcher. Previously we were factoring when the ScopeMatcher was initially created, but it might get more Matchers added to it later. Delay factoring until we have fully created/populated the ScopeMatchers. This reduces X86 isel tables by 154 bytes. llvm-svn: 287520
* Try again to fix unused variable warning on lld-x86_64-darwin13 after r287439.Daniel Sanders2016-11-191-1/+6
| | | | | | | The previous attempt didn't work. I assume LLVM_ATTRIBUTE_UNUSED isn't available on that machine. llvm-svn: 287442
* Check that emitted instructions meet their predicates on all targets except ↵Daniel Sanders2016-11-196-30/+122
| | | | | | | | | | | | | | | | | | | | | | | | | | ARM, Mips, and X86. Summary: * ARM is omitted from this patch because this check appears to expose bugs in this target. * Mips is omitted from this patch because this check either detects bugs or deliberate emission of instructions that don't satisfy their predicates. One deliberate use is the SYNC instruction where the version with an operand is correctly defined as requiring MIPS32 while the version without an operand is defined as an alias of 'SYNC 0' and requires MIPS2. * X86 is omitted from this patch because it doesn't use the tablegen-erated MCCodeEmitter infrastructure. Patches for ARM and Mips will follow. Depends on D25617 Reviewers: tstellarAMD, jmolloy Subscribers: wdng, jmolloy, aemerson, rengolin, arsenm, jyknight, nemanjai, nhaehnle, tstellarAMD, llvm-commits Differential Revision: https://reviews.llvm.org/D25618 llvm-svn: 287439
* [tablegen] Merge duplicate definitions of getMinimalTypeForRange. NFC.Daniel Sanders2016-11-196-37/+72
| | | | | | | | | | | | Summary: Depends on D25614 Reviewers: qcolombet Subscribers: qcolombet, beanz, mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D25617 llvm-svn: 287438
* [lit] When setting SDKROOT on Darwin, use '--sdk macosx' to find the right ↵Kuba Mracek2016-11-181-1/+1
| | | | | | | | SDK path. This will make sure that we find an actual path in case you have Command Line Tools installed. llvm-svn: 287403
* Timer: Track name and description.Matthias Braun2016-11-181-12/+16
| | | | | | | | | | | | | The previously used "names" are rather descriptions (they use multiple words and contain spaces), use short programming language identifier like strings for the "names" which should be used when exporting to machine parseable formats. Also removed a unused TimerGroup from Hexxagon. Differential Revision: https://reviews.llvm.org/D25583 llvm-svn: 287369
* Fix -Wunused introduced in r286945 for release builds.Daniel Sanders2016-11-151-0/+2
| | | | llvm-svn: 286946
* [tablegen] Extract portions of AsmMatcherEmitter for re-use by another ↵Daniel Sanders2016-11-154-89/+158
| | | | | | | | | | | | | | | | | | | generator. NFC. Summary: This change is preparation for a change that will allow targets to verify that the instructions they emit meet the predicates they specify. This is useful to ensure that C++ legalization/lowering/instruction-selection doesn't incorrectly select code for a different subtarget than intended. Such cases are not caught by the integrated assembler when emitting instructions directly to an object file. Reviewers: qcolombet Subscribers: qcolombet, beanz, mgorny, llvm-commits, modocache Differential Revision: https://reviews.llvm.org/D25614 llvm-svn: 286945
* [opt-viewer] Add support for libYAML for faster parsingAdam Nemet2016-11-151-2/+12
| | | | | | | | | | | | | | | | | | | | | | This results in a speed-up of over 6x on sqlite3. Before: $ time -p /org/llvm/utils/opt-viewer/opt-viewer.py ./MultiSource/Applications/sqlite3/CMakeFiles/sqlite3.dir/sqlite3.c.opt.yaml html real 415.07 user 410.00 sys 4.66 After with libYAML: $ time -p /org/llvm/utils/opt-viewer/opt-viewer.py ./MultiSource/Applications/sqlite3/CMakeFiles/sqlite3.dir/sqlite3.c.opt.yaml html real 63.96 user 60.03 sys 3.67 I followed these steps to get libYAML working with PyYAML: http://rmcgibbo.github.io/blog/2013/05/23/faster-yaml-parsing-with-libyaml/ llvm-svn: 286942
* [opt-viewer] Don't fail with remarks without debug locationAdam Nemet2016-11-141-2/+2
| | | | llvm-svn: 286861
* Handle non-inlined clang::Type::getAs specializations in extract_symbols.pyStephan Bergmann2016-11-141-4/+12
| | | | | | | | | | | | | The existing logic was to discard any symbols representing function template instantiations, as the definitions were assumed to be inline. But there are three explicit specializations of clang::Type::getAs that are only defined in Clang's lib/AST/Type.cpp, and at least the plugin used by the LibreOffice build (https://wiki.documentfoundation.org/Development/Clang_plugins) uses those functions. Differential Revision: https://reviews.llvm.org/D26455 llvm-svn: 286841
* Improve `git llvm push` to suggest `git pull` when applying patch failsMehdi Amini2016-11-121-4/+13
| | | | | | Differential Revision: https://reviews.llvm.org/D26565 llvm-svn: 286695
* Print correct directory in merge script.Richard Trieu2016-11-111-1/+1
| | | | | | | When providing the project directory to the merge script, print it out in the commit instructions instead of the default project directory. llvm-svn: 286675
* [opt-viewer] Make it work in the absence of hotness informationAdam Nemet2016-11-111-12/+30
| | | | | | In this case the index page is sorted by the source location. llvm-svn: 286572
* [opt-viewer] PEPify opt-viewer.pyMandeep Singh Grang2016-11-111-5/+18
| | | | | | | | | | Reviewers: anemet Subscribers: fhahn Differential Revision: https://reviews.llvm.org/D26535 llvm-svn: 286564
* [opt-viewer] Add column number supportAdam Nemet2016-11-111-3/+8
| | | | | | | With this the yellow (bubble) part of the remark shows up under the corresponding expression. llvm-svn: 286545
* [opt-viewer] Display inlining contextAdam Nemet2016-11-111-0/+18
| | | | | | | | | | | When a function is inlined, each instance is optimized in their own inlining context. This can produce different remarks all pointing to the same source line. This adds a new column on the source view to display the inlining context. llvm-svn: 286537
* [opt-viewer] Add option to set source directoryAdam Nemet2016-11-111-1/+22
| | | | llvm-svn: 286536
* [opt-viewer] Mention Pygments in the descriptionAdam Nemet2016-11-111-1/+1
| | | | llvm-svn: 286535
* [opt-viewer] Add syntax highlightingAdam Nemet2016-11-112-1/+74
| | | | | | Uses pygments. llvm-svn: 286532
OpenPOWER on IntegriCloud