summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support
Commit message (Collapse)AuthorAgeFilesLines
...
* [Support][Windows] Unify dialog box suppression and print stack traces on abort.Michael J. Spencer2015-01-292-20/+30
| | | | llvm-svn: 227470
* CommandLineParser: Avoid non-static member nitializer(s).NAKAMURA Takumi2015-01-291-2/+4
| | | | llvm-svn: 227428
* Fix the preprocessor checks used to determine if backtraces have been enabled.Owen Anderson2015-01-291-6/+6
| | | | llvm-svn: 227424
* Use the existing build configuration parameter ENABLE_BACKTRACE to compile ↵Owen Anderson2015-01-291-0/+16
| | | | | | | | | | out all pretty stack trace support when backtraces are disabled. This has the nice secondary effect of allowing LLVM to continue to build for targets without __thread or thread_local support to continue to work so long as they build without support for backtraces. llvm-svn: 227423
* [LPM] Clean up the use of TLS in pretty stack trace and disable itChandler Carruth2015-01-291-20/+2
| | | | | | | | | | | | | | | | | | | | | entirely when threads are not enabled. This should allow anyone who needs to bootstrap or cope with a host loader without TLS support to limp along without threading support. There is still some bug in the PPC TLS stuff that is not worked around. I'm getting access to a machine to reproduce and debug this further. There is some chance that I'll have to add a terrible workaround for PPC. There is also some problem with iOS, but I have no ability to really evaluate what the issue is there. I'm leaving it to folks maintaining that platform to suggest a path forward -- personally I don't see any useful path forward that supports threading in LLVM but does so without support for *very basic* TLS. Note that we don't need more than some pointers, and we don't need constructors, destructors, or any of the other fanciness which remains widely unimplemented. llvm-svn: 227411
* [LPM] Fix the PPC attribute to be spelled 'global-dynamic'. This shouldChandler Carruth2015-01-281-2/+2
| | | | | | let the build bot make finish compiling stage2. llvm-svn: 227391
* Build fix for Visual Studio. NFC.Chris Bieneman2015-01-281-5/+2
| | | | llvm-svn: 227385
* [LPM] Try to work around a bug with local-dynamic TLS on PowerPC 64.Chandler Carruth2015-01-281-5/+18
| | | | | | | | | | | | | | | | Sadly, this precludes optimizing it down to initial-exec or local-exec when statically linking, and in general makes the code slower on PPC 64, but there's nothing else for it until we can arrange to produce the correct bits for the linker. Lots of thanks to Ulirch for tracking this down and Bill for working on the long-term fix to LLVM so that we can relegate this to old host clang versions. I'll be watching the PPC build bots to make sure this effectively revives them. llvm-svn: 227352
* Refactoring llvm command line parsing and option registration.Chris Bieneman2015-01-281-170/+158
| | | | | | | | | | | | | | | | | | | | | Summary: The primary goal of this patch is to remove the need for MarkOptionsChanged(). That goal is accomplished by having addOption and removeOption properly sort the options. This patch puts the new add and remove functionality on a CommandLineParser class that is a placeholder. Some of the functionality in this class will need to be merged into the OptionRegistry, and other bits can hopefully be in a better abstraction. This patch also removes the RegisteredOptionList global, and the need for cl::Option objects to be linked list nodes. The changes in CommandLineTest.cpp are required because these changes shift when we validate that options are not duplicated. Before this change duplicate options were only found during certain cl API calls (like cl::ParseCommandLine). With this change duplicate options are found during option construction. Reviewers: dexonsmith, chandlerc, pete Reviewed By: pete Subscribers: pete, majnemer, llvm-commits Differential Revision: http://reviews.llvm.org/D7132 llvm-svn: 227345
* [Hexagon] Replacing intrinsics for halfword adds and max/min word/dword.Colin LeMahieu2015-01-281-8/+0
| | | | llvm-svn: 227322
* [LPM] Rip all of ManagedStatic and ThreadLocal out of the pretty stackChandler Carruth2015-01-281-21/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | tracing code. Managed static was just insane overhead for this. We took memory fences and external function calls in every path that pushed a pretty stack frame. This includes a multitude of layers setting up and tearing down passes, the parser in Clang, everywhere. For the regression test suite or low-overhead JITs, this was contributing to really significant overhead. Even the LLVM ThreadLocal is really overkill here because it uses pthread_{set,get}_specific logic, and has careful code to both allocate and delete the thread local data. We don't actually want any of that, and this code in particular has problems coping with deallocation. What we want is a single TLS pointer that is valid to use during global construction and during global destruction, any time we want. That is exactly what every host compiler and OS we use has implemented for a long time, and what was standardized in C++11. Even though not all of our host compilers support the thread_local keyword, we can directly use the platform-specific keywords to get the minimal functionality needed. Provided this limited trial survives the build bots, I will move this to Compiler.h so it is more widely available as a light weight if limited alternative to the ThreadLocal class. Many thanks to David Majnemer for helping me think through the implications across platforms and craft the MSVC-compatible syntax. The end result is *substantially* faster. When running llc in a tight loop over a small IR file targeting the aarch64 backend, this improves its performance by over 10% for me. It also seems likely to fix the remaining regressions seen by JIT users with threading enabled. This may actually have more impact on real-world compile times due to the use of the pretty stack tracing utility throughout the rest of Clang or LLVM, but I've not collected any detailed measurements. llvm-svn: 227300
* [mips] Use __clear_cache builtin instead of cacheflush()Petar Jovanovic2015-01-271-13/+2
| | | | | | | | | Use __clear_cache builtin instead of cacheflush() in Unix Memory::InvalidateInstructionCache(). Differential Revision: http://reviews.llvm.org/D7198 llvm-svn: 227269
* Re-landing changes to use ArrayRef instead of SmallVectorImpl, and new API test.Chris Bieneman2015-01-271-2/+1
| | | | | | This contains the changes from r227148 & r227154, and also fixes to the test case to properly clean up the stack options. llvm-svn: 227255
* Revert r227148 & r227154 which added a test which infinitely loops.Richard Trieu2015-01-271-1/+2
| | | | | | | | | | | | r227148 added test CommandLineTest.HideUnrelatedOptionsMulti which repeatedly outputs two following lines: -tool: CommandLine Error: Option 'test-option-1' registered more than once! -tool: CommandLine Error: Option 'test-option-2' registered more than once! r227154 depends on changes from r227148 llvm-svn: 227167
* One more fix to the new API to fix const-correctness.Chris Bieneman2015-01-271-1/+1
| | | | llvm-svn: 227154
* Pete Cooper suggested the new API should use ArrayRef instead of ↵Chris Bieneman2015-01-261-2/+1
| | | | | | SmallVectorImpl. Also adding a test case. llvm-svn: 227148
* Have the UTF conversion wrappers append a null terminator.Zachary Turner2015-01-261-4/+11
| | | | | | | | | | | This is especially useful for the UTF8 -> UTF16 direction, since there is no equivalent of llvm::SmallString<> for wide characters. This means that anyone who wants a null terminated string is forced to manually push and pop their own null terminator. Reviewed by: Reid Kleckner. llvm-svn: 227143
* Add new HideUnrelatedOptions API that takes a SmallVectorImpl.Chris Bieneman2015-01-261-0/+14
| | | | | | Need a new API for clang-modernize that allows specifying a list of option categories to remain visible. This will allow clang-modernize to move off getRegisteredOptions. llvm-svn: 227140
* Add a UTF8 to UTF16 conversion wrapper for use in the pdb dumperReid Kleckner2015-01-261-0/+31
| | | | | | | | | This can also be used instead of the WindowsSupport.h ConvertUTF8ToUTF16 helpers, but that will require massaging some character types. The Windows support routines want wchar_t output, but wchar_t is often 32 bits on non-Windows OSs. llvm-svn: 227122
* Teach raw_ostream to support hex formatting without a prefix '0x'.Zachary Turner2015-01-261-2/+5
| | | | | | | | | | Previously using format_hex() would always print a 0x prior to the hex characters. This allows this to be optional, so that one can choose to print (e.g.) 255 as either 0xFF or just FF. Differential Revision: http://reviews.llvm.org/D7151 llvm-svn: 227108
* Remove trailing whitespace. NFC ®Alex Rosenberg2015-01-261-1/+1
| | | | llvm-svn: 227105
* [Support][Windows] Disable error dialog boxes when stack trace printing is ↵Michael J. Spencer2015-01-261-0/+8
| | | | | | enabled. llvm-svn: 227094
* Putting all the standard tool options into a "Generic" category.Chris Bieneman2015-01-261-9/+16
| | | | | | | | | | | | | | | Summary: This puts all the options that CommandLine.cpp implements into a category so that the APIs to hide options can not hide based on the generic category instead of string matching a partial list of argument strings. This patch is pretty simple and straight forward but it does impact the -help output of all tools using cl::opt. Specifically the options implemented in CommandLine.cpp (help, help-list, help-hidden, help-list-hidden, print-options, print-all-options, version) are all grouped together into an Option category, and these options are never hidden by the cl::HideUnrelatedOptions API. Reviewers: dexonsmith, chandlerc, majnemer Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D7150 llvm-svn: 227093
* The canonical CPU variant for ARM according to config.guess uses aJoerg Sonnenberger2015-01-261-5/+21
| | | | | | | | | | | | | | | | suffix it seems: # ./config.guess earmv7hfeb-unknown-netbsd7.99.4 Extend the triple parsing to support this. Avoid running the ARM parser multiple times because StringSwitch is not lazy. Reviewers: Renato Golin, Tim Northover Differential Revision: http://reviews.llvm.org/D7166 llvm-svn: 227085
* Add the triple for the Sony Playstation®4.Alex Rosenberg2015-01-251-0/+2
| | | | | | Lots more to follow. llvm-svn: 227060
* BPF backendAlexei Starovoitov2015-01-241-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: V8->V9: - cleanup tests V7->V8: - addressed feedback from David: - switched to range-based 'for' loops - fixed formatting of tests V6->V7: - rebased and adjusted AsmPrinter args - CamelCased .td, fixed formatting, cleaned up names, removed unused patterns - diffstat: 3 files changed, 203 insertions(+), 227 deletions(-) V5->V6: - addressed feedback from Chandler: - reinstated full verbose standard banner in all files - fixed variables that were not in CamelCase - fixed names of #ifdef in header files - removed redundant braces in if/else chains with single statements - fixed comments - removed trailing empty line - dropped debug annotations from tests - diffstat of these changes: 46 files changed, 456 insertions(+), 469 deletions(-) V4->V5: - fix setLoadExtAction() interface - clang-formated all where it made sense V3->V4: - added CODE_OWNERS entry for BPF backend V2->V3: - fix metadata in tests V1->V2: - addressed feedback from Tom and Matt - removed top level change to configure (now everything via 'experimental-backend') - reworked error reporting via DiagnosticInfo (similar to R600) - added few more tests - added cmake build - added Triple::bpf - tested on linux and darwin V1 cover letter: --------------------- recently linux gained "universal in-kernel virtual machine" which is called eBPF or extended BPF. The name comes from "Berkeley Packet Filter", since new instruction set is based on it. This patch adds a new backend that emits extended BPF instruction set. The concept and development are covered by the following articles: http://lwn.net/Articles/599755/ http://lwn.net/Articles/575531/ http://lwn.net/Articles/603983/ http://lwn.net/Articles/606089/ http://lwn.net/Articles/612878/ One of use cases: dtrace/systemtap alternative. bpf syscall manpage: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=b4fc1a460f3017e958e6a8ea560ea0afd91bf6fe instruction set description and differences vs classic BPF: http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/networking/filter.txt Short summary of instruction set: - 64-bit registers R0 - return value from in-kernel function, and exit value for BPF program R1 - R5 - arguments from BPF program to in-kernel function R6 - R9 - callee saved registers that in-kernel function will preserve R10 - read-only frame pointer to access stack - two-operand instructions like +, -, *, mov, load/store - implicit prologue/epilogue (invisible stack pointer) - no floating point, no simd Short history of extended BPF in kernel: interpreter in 3.15, x64 JIT in 3.16, arm64 JIT, verifier, bpf syscall in 3.18, more to come in the future. It's a very small and simple backend. There is no support for global variables, arbitrary function calls, floating point, varargs, exceptions, indirect jumps, arbitrary pointer arithmetic, alloca, etc. From C front-end point of view it's very restricted. It's done on purpose, since kernel rejects all programs that it cannot prove safe. It rejects programs with loops and with memory accesses via arbitrary pointers. When kernel accepts the program it is guaranteed that program will terminate and will not crash the kernel. This patch implements all 'must have' bits. There are several things on TODO list, so this is not the end of development. Most of the code is a boiler plate code, copy-pasted from other backends. Only odd things are lack or < and <= instructions, specialized load_byte intrinsics and 'compare and goto' as single instruction. Current instruction set is fixed, but more instructions can be added in the future. Signed-off-by: Alexei Starovoitov <alexei.starovoitov@gmail.com> Subscribers: majnemer, chandlerc, echristo, joerg, pete, rengolin, kristof.beyls, arsenm, t.p.northover, tstellarAMD, aemerson, llvm-commits Differential Revision: http://reviews.llvm.org/D6494 llvm-svn: 227008
* If we see UTF-8 BOM sequence at the beginning of a response file, we shallYunzhong Gao2015-01-241-0/+12
| | | | | | | | remove these bytes before parsing. Phabricator Revision: http://reviews.llvm.org/D7156 llvm-svn: 226988
* [Object][ELF] Test unknown type.Michael J. Spencer2015-01-231-1/+1
| | | | llvm-svn: 226943
* [YAMLIO] Add support for numeric values in enums.Michael J. Spencer2015-01-231-0/+14
| | | | llvm-svn: 226942
* Adding a new cl::HideUnrelatedOptions API to allow clang to migrate off ↵Chris Bieneman2015-01-211-1/+11
| | | | | | | | | | | | | | | | cl::getRegisteredOptions. Summary: cl::getRegisteredOptions really exposes some of the innards of how command line parsing is implemented. Exposing new APIs that allow us to disentangle client code from implementation details will allow us to make more extensive changes to command line parsing. Reviewers: chandlerc, dexonsmith, beanz Reviewed By: dexonsmith Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D7100 llvm-svn: 226729
* Add missing include guards to WindowsSupport.h.Yaron Keren2015-01-211-0/+5
| | | | llvm-svn: 226669
* Remove std::move that was preventing return value optimization.Richard Trieu2015-01-171-3/+3
| | | | llvm-svn: 226356
* [cleanup] Re-sort all the #include lines in LLVM usingChandler Carruth2015-01-148-11/+10
| | | | | | | | | | | utils/sort_includes.py. I clearly haven't done this in a while, so more changed than usual. This even uncovered a missing include from the InstrProf library that I've added. No functionality changed here, just mechanical cleanup of the include order. llvm-svn: 225974
* Running clang-format on CommandLine.h and CommandLine.cpp.Chris Bieneman2015-01-131-273/+262
| | | | | | No functional changes, I'm just going to be doing a lot of work in these files and it would be helpful if they had more current LLVM style. llvm-svn: 225817
* Triple: Add amdgcn tripleTom Stellard2015-01-061-1/+8
| | | | | | | This will be used for AMD GPUs with the Graphics Core Next architecture, which are currently using by the r600 triple. llvm-svn: 225276
* [APFloat][ADT] Fix sign handling logic for FMA results that truncate to zero.Lang Hames2015-01-041-1/+1
| | | | | | | | | | | | | | This patch adds a check for underflow when truncating results back to lower precision at the end of an FMA. The additional sign handling logic in APFloat::fusedMultiplyAdd should only be performed when the result of the addition step of the FMA (in full precision) is exactly zero, not when the result underflows to zero. Unit tests for this case and related signed zero FMA results are included. Fixes <rdar://problem/18925551>. llvm-svn: 225123
* Remove unnecessary StringRef->std::string conversion.Alexey Samsonov2014-12-291-1/+1
| | | | llvm-svn: 224953
* Add missing implementation of 'sys::path::is_other' to the support library.Juergen Ributzka2014-12-181-0/+8
| | | | | | | The header claims that this function exists, but the linker wasn't too happy about it not being in the library. llvm-svn: 224527
* Random Number Generator Refactoring (removing from Module)JF Bastien2014-12-171-18/+12
| | | | | | | | | | This patch removes the RNG from Module. Passes should instead create a new RNG for their use as needed. Patch by Stephen Crane @rinon. Differential revision: http://reviews.llvm.org/D4377 llvm-svn: 224444
* Remove a debugging assert.Rafael Espindola2014-12-171-1/+0
| | | | | | Sorry for the noise, I have no idea how it survived to the final version. llvm-svn: 224414
* Fix the windows build.Rafael Espindola2014-12-171-0/+2
| | | | llvm-svn: 224412
* Refactor and simplify the code reading /proc/cpuinfo. NFC.Rafael Espindola2014-12-171-47/+32
| | | | llvm-svn: 224410
* Remove the last unnecessary member variable of mapped_file_region. NFC.Rafael Espindola2014-12-161-11/+6
| | | | llvm-svn: 224312
* Convert a member variable to a local variable. NFC.Rafael Espindola2014-12-161-3/+3
| | | | llvm-svn: 224311
* Remove unused member and simplify. NFC.Rafael Espindola2014-12-161-22/+3
| | | | llvm-svn: 224309
* ThreadLocal: Move Unix-specific code out of Support/ThreadLocal.cppDavid Majnemer2014-12-152-45/+43
| | | | | | Just a cleanup, no functionality change is intended. llvm-svn: 224227
* ThreadLocal: Return a mutable pointer if templated with a non-const typeDavid Majnemer2014-12-153-4/+4
| | | | | | | It makes more sense for ThreadLocal<const T>::get to return a const T* and ThreadLocal<T>::get to return a T*. llvm-svn: 224225
* APInt: udivrem should use machine instructions for single-word APIntsDavid Majnemer2014-12-141-0/+12
| | | | | | | | This mirrors the behavior of APInt::udiv and APInt::urem. Some architectures, like X86, have a single instruction which can compute both division and remainder. llvm-svn: 224217
* Pass EC by reference to MemoryBufferMMapFile to return error code.Yaron Keren2014-12-121-1/+1
| | | | | | Patch by Kim Grasman! llvm-svn: 224159
* Clean up static analyzer warnings.Michael Ilseman2014-12-122-2/+2
| | | | | | | | | Clang's static analyzer found several potential cases of undefined behavior, use of un-initialized values, and potentially null pointer dereferences in tablegen, Support, MC, and ADT. This cleans them up with specific assertions on the assumptions of the code. llvm-svn: 224154
OpenPOWER on IntegriCloud