summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support
Commit message (Collapse)AuthorAgeFilesLines
...
* [ADT] Rewrite the StringRef::find implementation to be simpler, clearer,Chandler Carruth2015-09-101-16/+23
| | | | | | | | | | | | | | | | and tremendously less reliant on the optimizer to fix things. The code is always necessarily looking for the entire length of the string when doing the equality tests in this find implementation, but it previously was needlessly re-checking the size each time among other annoyances. By writing this so simply an ddirectly in terms of memcmp, it also is about 8x faster in a debug build, which in turn makes FileCheck about 2x faster in 'ninja check-llvm'. This saves about 8% of the time for FileCheck-heavy parts of the test suite like the x86 backend tests. llvm-svn: 247269
* [ADT] Micro-optimize the Triple constructor by doing a single split andChandler Carruth2015-09-101-8/+21
| | | | | | | | | | | | re-using the resulting components rather than repeatedly splitting and re-splitting to compute each component as part of the initializer list. This is more work on PR23676. Sadly, it doesn't help much. It removes the constructor from my profile, but doesn't make a sufficient dent in the total time. But it should play together nicely with subsequent changes. llvm-svn: 247250
* [ADT] Fix a confusing interface spec and some annoying peculiaritiesChandler Carruth2015-09-101-31/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | with the StringRef::split method when used with a MaxSplit argument other than '-1' (which nobody really does today, but which should actually work). The spec claimed both to split up to MaxSplit times, but also to append <= MaxSplit strings to the vector. One of these doesn't make sense. Given the name "MaxSplit", let's go with it being a max over how many *splits* occur, which means the max on how many strings get appended is MaxSplit+1. I'm not actually sure the implementation correctly provided this logic either, as it used a really opaque loop structure. The implementation was also playing weird games with nullptr in the data field to try to rely on a totally opaque hidden property of the split method that returns a pair. Nasty IMO. Replace all of this with what is (IMO) simpler code that doesn't use the pair returning split method, and instead just finds each separator and appends directly. I think this is a lot easier to read, and it most definitely matches the spec. Added some tests that exercise the corner cases around StringRef() and StringRef("") that all now pass. I'll start using this in code in the next commit. llvm-svn: 247249
* [ADT] Switch a bunch of places in LLVM that were doing single-characterChandler Carruth2015-09-102-3/+3
| | | | | | | splits to actually use the single character split routine which does less work, and in a debug build is *substantially* faster. llvm-svn: 247245
* [ADT] Add a single-character version of the small vector split routineChandler Carruth2015-09-102-1/+21
| | | | | | | | | | | on StringRef. Finding and splitting on a single character is substantially faster than doing it on even a single character StringRef -- we immediately get to a *very* tuned memchr call this way. Even nicer, we get to this even in a debug build, shaving 18% off the runtime of TripleTest.Normalization, helping PR23676 some more. llvm-svn: 247244
* Added arch extensions and default target features in TargetParser.Alexandros Lamprineas2015-09-051-5/+30
| | | | | Differential: http://reviews.llvm.org/D11590 llvm-svn: 246930
* Add Myriad into enum VendorTypeDouglas Katzman2015-09-021-0/+2
| | | | | | Differential Revision: http://reviews.llvm.org/D12540 llvm-svn: 246732
* Move twice-repeated clang path operation into a new function.Douglas Katzman2015-09-021-2/+10
| | | | | | And make it more robust in the edge case of exactly "./" as input. llvm-svn: 246711
* [MC] Add support for generating COFF CRCsDavid Majnemer2015-09-012-0/+97
| | | | | | | | | | | | | | | | | | COFF sections are accompanied with an auxiliary symbol which includes a checksum. This checksum used to be filled with just zero but this seems to upset LINK.exe when it is processing a /INCREMENTAL link job. Instead, fill the CheckSum field with the JamCRC of the section contents. This matches MSVC's behavior. This fixes PR19666. N.B. A rather simple implementation of JamCRC is given. It implements a byte-wise calculation using the method given by Sarwate. There are implementations with higher throughput like slice-by-eight and making use of PCLMULQDQ. We can switch to one of those techniques if it turns out to be a significant use of time. llvm-svn: 246590
* Stop calling the flat out insane ARM target parsing code unless theChandler Carruth2015-08-301-8/+20
| | | | | | | | | | | | | | | | | | | | | | | architecture string is something quite weird. Similarly delay calling the BPF parsing code, although that is more reasonable. To understand why I was motivated to make this change, it cuts the time for running the ADT TripleTest unittests by a factor of two in non-optimized builds (the developer default) and reduces my 'check-llvm' time by a full 15 seconds. The implementation of parseARMArch is *that* slow. I tried to fix it in the prior series of commits, but frankly, I have no idea how to finish fixing it. The entire premise of the function (to allow 'v7a-unknown-linux' or some such to parse as an 'arm-unknown-linux' triple) seems completely insane to me, but I'll let the ARM folks sort that out. At least it is now out of the critical path of every developer working on LLVM. It also will likely make some other folks' code significantly faster as I've heard reports of 2% of time spent in triple parsing even in optimized builds! I'm not done making this code faster, but I am done trying to improve the ARM target parsing code. llvm-svn: 246378
* Remove a linear walk to find the default FPU for a given CPU by directlyChandler Carruth2015-08-301-7/+6
| | | | | | expanding the .def file within a StringSwitch. llvm-svn: 246377
* Teach the target parsing framework to directly compute the length of allChandler Carruth2015-08-302-45/+72
| | | | | | | | | | of its strings when expanding the string literals from the macros, and push all of the APIs to be StringRef instead of C-string APIs. This (remarkably) removes a very non-trivial number of strlen calls. It even deletes code and complexity from one of the primary users -- Clang. llvm-svn: 246374
* Refactor the ARM target parsing to use a def file with macros to expandChandler Carruth2015-08-301-164/+14
| | | | | | | | | | | | | | the necessary tables. This will allow me to restructure the code and structures using this to be significantly more efficient. It also removes the duplication of the list of several enumerators. It also enshrines that the order of enumerators match the order of the entries in the tables, something the implementation code actually uses. No functionality changed (yet). llvm-svn: 246370
* [Triple] Use clang-format to normalize the formatting of the ARM targetChandler Carruth2015-08-301-36/+35
| | | | | | | | | | | | | parsing logic prior to making substantial changes to it. This parsing logic is incredibly wasteful, so I'm planning to rewrite it. Just unittesting the triple parsing logic spends well over 80% of its time in the ARM parsing logic, and others have measured significant time spent here in real production compiles. Stay tuned... llvm-svn: 246369
* [Triple] Stop abusing a class to have only static methods and just useChandler Carruth2015-08-302-36/+36
| | | | | | | the namespace that we are already using for the enums that are produced by the parsing. llvm-svn: 246367
* Expose more properties of llvm::fltSemanticsJF Bastien2015-08-261-0/+15
| | | | | | | | | | | Summary: Adds accessor functions for all the fields in llvm::fltSemantics. This will be used in MergeFunctions to order two APFloats with different semanatics. Author: jrkoenig Reviewers: jfb Subscribers: dschuff, llvm-commits Differential revision: http://reviews.llvm.org/D12253 llvm-svn: 245999
* [ARM] Fix MachO CPU Subtype selectionVedant Kumar2015-08-211-1/+3
| | | | | | Differential Revision: http://reviews.llvm.org/D12040 llvm-svn: 245744
* [APFloat] Remove else after return and replace loop with std::equal. NFC.Benjamin Kramer2015-08-211-11/+5
| | | | llvm-svn: 245707
* Support: Clean up TSan annotations.Peter Collingbourne2015-08-183-20/+2
| | | | | | | | | | | Remove support for Valgrind-based TSan, which hasn't been maintained for a few years. We now use the TSan annotations only if LLVM is compiled with -fsanitize=thread. We no longer need the weak function definitions as we are guaranteed that our program is linked directly with the TSan runtime. Differential Revision: http://reviews.llvm.org/D12121 llvm-svn: 245374
* [Support] On Windows, generate PDF files for graphs and open with associated ↵Michael Kruse2015-08-181-23/+49
| | | | | | | | | | | | | | viewer Summary: Windows system rarely have good PostScript viewers installed, but PDF viewers are common. So for viewing graphs, generate PDF files and open with the associated PDF viewer using cmd.exe's start command. Reviewers: Bigcheese, aaron.ballman Subscribers: aaron.ballman, JakeVanAdrighem, dwiberg, llvm-commits Differential Revision: http://reviews.llvm.org/D11877 llvm-svn: 245290
* [Support] Always wait for GraphViz before opening the viewerMichael Kruse2015-08-181-1/+1
| | | | | | | | | | | | | | | Summary: When calling DisplayGraph and a PS viewer is chosen, two programs are executed: The GraphViz generator and the PostScript viewer. Always for the generator to finish to ensure that the .ps file is written before opening the viewer for that file. DisplayGraph's wait parameter refers to whether to wait until the user closes the viewer. This happened on Windows and if none of the options to open the .dot file directly applies, also on Linux. Reviewers: Bigcheese, chandlerc, aaron.ballman Subscribers: dwiberg, aaron.ballman, llvm-commits Differential Revision: http://reviews.llvm.org/D11876 llvm-svn: 245289
* [WebAssembly] Don't default to ELF in the triple.Dan Gohman2015-08-171-0/+5
| | | | | | | | WebAssembly doesn't yet have a specified binary format, and it may not end up being ELF, so we don't want the Triple class defaulting to ELF for it at this time. llvm-svn: 245254
* [WebAssembly] Make getArchTypePrefix return "wasm".Dan Gohman2015-08-171-2/+2
| | | | | | | | The arch prefix string isn't currently being used for anything on WebAssembly, but if it were to be used, it makes sense to use the same arch prefix string for wasm32 and wasm64. llvm-svn: 245252
* [ADT] Teach FoldingSet to be movable.Chandler Carruth2015-08-161-0/+20
| | | | | | | | | | This is a very minimal move support - it leaves the moved-from object in a zombie state that is only valid for destruction and move assignment. This seems fine to me, and leaving it in the default constructed state would require adding more state to the object and potentially allocating memory (!!!) and so seems like a Bad Idea. llvm-svn: 245192
* Add a target environment for CoreCLR.Pat Gavlin2015-08-141-0/+2
| | | | | | | | | | Although targeting CoreCLR is similar to targeting MSVC, there are certain important differences that the backend must be aware of (e.g. differences in stack probes, EH, and library calls). Differential Revision: http://reviews.llvm.org/D11012 llvm-svn: 245115
* Revert "[ARM] Fix MachO CPU Subtype selection"Renato Golin2015-08-141-2/+0
| | | | | | This reverts commit r245081, as it breaks many builds. llvm-svn: 245086
* [ARM] Fix MachO CPU Subtype selectionVedant Kumar2015-08-141-0/+2
| | | | | | | | | | This patch makes the Darwin ARM backend take advantage of TargetParser. It also teaches TargetParser about ARMV7K for the first time. This makes target triple parsing more consistent across llvm. Differential Revision: http://reviews.llvm.org/D11996 llvm-svn: 245081
* Fix GCC warning: extra `;' [-Wpedantic].Nick Lewycky2015-08-131-1/+1
| | | | llvm-svn: 244924
* Modify raw_svector_ostream to use its SmallString without additional buffering.Yaron Keren2015-08-131-62/+5
| | | | | | | | | This is faster and avoids the stream and SmallString state synchronization issue. resync() is a no-op and may be safely deleted. I'll do so in a follow-up commit. Reviewed by Rafael Espindola. llvm-svn: 244870
* There is only one saver of strings.Rafael Espindola2015-08-132-3/+3
| | | | llvm-svn: 244854
* Return ErrorOr from FileOutputBuffer::create. NFC.Rafael Espindola2015-08-131-7/+4
| | | | llvm-svn: 244848
* Add model numbers for Skylake CPUs and an additional Broadwell model.Craig Topper2015-08-081-0/+6
| | | | llvm-svn: 244385
* Add Intel family 6 model 93 as Silvermont.Craig Topper2015-08-081-0/+1
| | | | llvm-svn: 244384
* Add Intel family 6 model 90 as Silvermont. Fixes PR24392.Craig Topper2015-08-071-0/+1
| | | | llvm-svn: 244352
* Add functions to save and restore the PrettyStackTrace state.Nico Weber2015-08-071-0/+14
| | | | | | | | | | | | | | | | PrettyStackTraceHead is a LLVM_THREAD_LOCAL, which means it's just a global in LLVM_ENABLE_THREADS=NO builds. If a CrashRecoveryContext is used with code that uses PrettyStackEntries, and a crash happens, PrettyStackTraceHead is currently not reset to its pre-crash value. These functions make it possible to add a cleanup to such code that does this. (Not reseting the value then causes the assert in ~PrettyStackTraceEntry() to fire if the code outside of the CrashRecoveryContext also uses PrettyStackEntries -- for example, clang when building a module.) Part of PR11974. llvm-svn: 244338
* Add a comment.Nico Weber2015-08-071-0/+4
| | | | llvm-svn: 244337
* Thread premissions through sys::fs::create_director{y|ies}Frederic Riss2015-08-063-7/+10
| | | | llvm-svn: 244268
* Fix nested CrashRecoveryContexts with LLVM_ENABLE_THREADS=OFF, allow them.Nico Weber2015-08-061-6/+14
| | | | | | | | | | | | | | | | | | libclang uses a CrashRecoveryContext, and building a module does too. If a module gets built through libclang, nested CrashRecoveryContexts are used. They work fine with threads as things are stored in ThreadLocal variables, but in LLVM_ENABLE_THREADS=OFF builds the two recovery contexts would write to the same globals. To fix, keep active CrashRecoveryContextImpls in a list and have the global point to the innermost one, and do something similar for tlIsRecoveringFromCrash. Necessary (but not sufficient) for PR11974 and PR20325 http://reviews.llvm.org/D11770 llvm-svn: 244251
* [YAMLTraits] Use StringRef::copy. No functionality change.Benjamin Kramer2015-08-051-12/+4
| | | | llvm-svn: 244044
* Windows/COM.inc: Fix emacs mode in the first line.NAKAMURA Takumi2015-08-051-1/+1
| | | | llvm-svn: 244016
* Remove the configure and cmake checks for sys/wait.hJustin Bogner2015-08-042-19/+1
| | | | | | | | | | If we don't have sys/wait.h and we're on a unix system there's no way that several of the llvm tools work at all. This includes clang. Just remove the configure and cmake checks entirely - we'll get a build error instead of building something broken now. llvm-svn: 243957
* [UB] Fix yet another use of memcpy with a null pointer argument. I thinkChandler Carruth2015-08-041-1/+2
| | | | | | | | this is the last of them in my build of LLVM. Haven't tried Clang yet. Found via UBSan. llvm-svn: 243934
* Add amdopencl environment to tripleMatt Arsenault2015-07-301-0/+2
| | | | | | | This is used by the AMD x86 OpenCL implementation to change some ABI details on Windows and Linux. llvm-svn: 243627
* - Added support for parsing HWDiv features using Target Parser.Alexandros Lamprineas2015-07-271-18/+76
| | | | | | | - Architecture extensions are represented as a bitmap. Phabricator: http://reviews.llvm.org/D11457 llvm-svn: 243335
* Remove unnecessary in C++11 c_str() callsYaron Keren2015-07-231-18/+1
| | | | | | | | While theoratically required in pre-C++11 to avoid re-allocation upon call, C++11 guarantees that c_str() returns a pointer to the internal array so pre-calling c_str() is no longer required. llvm-svn: 242983
* Rename RunCallBacksToRun to llvm::sys::RunSignalHandlersYaron Keren2015-07-223-3/+3
| | | | | | | | | | | | And expose it in Signals.h, allowing clients to call it directly, possibly LLVMErrorHandler which currently calls RunInterruptHandlers but not RunSignalHandlers, thus for example not printing the stack backtrace on Unixish OSes. On Windows it does happen because RunInterruptHandlers ends up calling the callbacks as well via Cleanup(). This difference in behaviour and code structures in */Signals.inc should be patched in the future. llvm-svn: 242936
* De-duplicate Unix & Windows CallBacksToRunYaron Keren2015-07-223-20/+17
| | | | | | | | | Move CallBacksToRun into the common Signals.cpp, create RunCallBacksToRun() and use these in both Unix/Signals.inc and Windows/Signals.inc. Lots of potential code to be merged here. llvm-svn: 242925
* Identify thin archives as archives.Rafael Espindola2015-07-221-1/+2
| | | | llvm-svn: 242921
* Remove C++98 workaround in llvm::sys::DontRemoveFileOnSignal()Yaron Keren2015-07-221-7/+0
| | | | llvm-svn: 242920
* Edited the CPUNames table of TargetParserAlexandros Lamprineas2015-07-171-3/+1
| | | | | | | | | - Changed the default FPU of cortex-m4. - Removed "cortex-m4f" entry. Currently not supported. Change-Id: I73121e358aa9e7ba68eb001c2143df390ff2352a Phabricator: http://reviews.llvm.org/D11100 llvm-svn: 242528
OpenPOWER on IntegriCloud