summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [test] Fix a typo in a test case [NFCI]Tobias Grosser2018-06-131-2/+2
| | | | | | Also remove an undef value that does not add any value to the test case. llvm-svn: 334661
* [Sanitizers] Make sanitizer allocator linker-initialize compliant.Alex Shlyapnikov2018-06-133-4/+7
| | | | | | | | | | | | | | | | | | | | | Summary: These four SpinMutex ctors was the only code executed in the ctor for the static __asan::Allocator instance (same for the other sanitizers allocators), which is supposed to be fully linker-initialized. Also, when the global ctor for this allocator instance is executed, this instance might already be initialized by __asan_init called from .preinit_array. Issue: https://github.com/google/sanitizers/issues/194 Reviewers: morehouse, eugenis, cryptoad Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D48142 llvm-svn: 334660
* Disable MSan tests of prlimit on FreeBSDDimitry Andric2018-06-131-1/+1
| | | | | | | Like NetBSD, FreeBSD does not have prlimit(2), so do not attempt to use it during the MSan tests. llvm-svn: 334659
* Revert "Enable ThreadPool to queue tasks that return values."Zachary Turner2018-06-133-65/+26
| | | | | | | | This is failing to compile when LLVM_ENABLE_THREADS is false, and the fix is not immediately obvious, so reverting while I look into it. llvm-svn: 334658
* Reland: [Timers] Use the pass argument name for JSON keys in time-passesFrancis Visoiu Mistrih2018-06-132-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using clang --save-stats -mllvm -time-passes, both timers and stats end up in the same json file. We could end up with things like: { "asm-printer.EmittedInsts": 1, "time.pass.Virtual Register Map.wall": 2.9015541076660156e-04, "time.pass.Virtual Register Map.user": 2.0500000000000379e-04, "time.pass.Virtual Register Map.sys": 8.5000000000001741e-05, } This patch makes use of the pass argument name (if available) in the JSON key to end up with things like: { "asm-printer.EmittedInsts": 1, "time.pass.virtregmap.wall": 2.9015541076660156e-04, "time.pass.virtregmap.user": 2.0500000000000379e-04, "time.pass.virtregmap.sys": 8.5000000000001741e-05, } This also helps avoiding to write another JSON printer to handle all the cases that we could have in our pass names. Fixed test instead of adding a new one originally from r334649. Differential Revision: https://reviews.llvm.org/D48109 llvm-svn: 334657
* [TableGen] Make getOnlyTree return a const ref (NFC)Florian Hahn2018-06-132-9/+11
| | | | | | | This avoids some unnecessary copies of shared_ptrs. Those changes were suggested post-commit for D47463. llvm-svn: 334656
* Update comments of CheckedArithmetic API based on Philip Reames feedback.George Karpenkov2018-06-131-11/+17
| | | | llvm-svn: 334655
* [compiler-rt] Use CMAKE_LINKER instead of hardcoding ldShoaib Meenai2018-06-131-1/+1
| | | | | | | Respect a custom linker path provided by the user if one is present (otherwise CMAKE_LINKER will have been set to the right value by CMake). llvm-svn: 334654
* [WinASan] Don't instrument globals in sections containing '$'Reid Kleckner2018-06-132-5/+62
| | | | | | | | | | | | | Such globals are very likely to be part of a sorted section array, such the .CRT sections used for dynamic initialization. The uses its own sorted sections called ATL$__a, ATL$__m, and ATL$__z. Instead of special casing them, just look for the dollar sign, which is what invokes linker section sorting for COFF. Avoids issues with ASan and the ATL uncovered after we started instrumenting comdat globals on COFF. llvm-svn: 334653
* Simplify test from r334650Erich Keane2018-06-131-12/+6
| | | | | | | No reason to have the 'bool' as an intermediary value, simply use the fact that curley braces enforce eval order. llvm-svn: 334652
* Revert r334649 "[Timers] Use the pass argument name for JSON keys in ↵Francis Visoiu Mistrih2018-06-132-19/+1
| | | | | | | | | | time-passes" This reverts commit r334649. This breaks a test. llvm-svn: 334651
* Implement constexpr __builtin_*_overflowErich Keane2018-06-132-0/+202
| | | | | | | | | As requested here:https://bugs.llvm.org/show_bug.cgi?id=37633 permit the __builtin_*_overflow builtins in constexpr functions. Differential Revision: https://reviews.llvm.org/D48040 llvm-svn: 334650
* [Timers] Use the pass argument name for JSON keys in time-passesFrancis Visoiu Mistrih2018-06-132-1/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using clang --save-stats -mllvm -time-passes, both timers and stats end up in the same json file. We could end up with things like: { "asm-printer.EmittedInsts": 1, "time.pass.Virtual Register Map.wall": 2.9015541076660156e-04, "time.pass.Virtual Register Map.user": 2.0500000000000379e-04, "time.pass.Virtual Register Map.sys": 8.5000000000001741e-05, } This patch makes use of the pass argument name (if available) in the JSON key to end up with things like: { "asm-printer.EmittedInsts": 1, "time.pass.virtregmap.wall": 2.9015541076660156e-04, "time.pass.virtregmap.user": 2.0500000000000379e-04, "time.pass.virtregmap.sys": 8.5000000000001741e-05, } This also helps avoiding to write another JSON printer to handle all the cases that we could have in our pass names. Differential Revision: https://reviews.llvm.org/D48109 llvm-svn: 334649
* [X86] Move RCPSSr_Int, RSQRTSSr_Int, SQRTSDr_Int, SQRTSSr_Int to the correct ↵Craig Topper2018-06-132-9/+45
| | | | | | | | load folding table. They were in the operand 1 folding table, but their foldable operand is operand 2. llvm-svn: 334648
* Remove needless bitwise-AND.Rui Ueyama2018-06-131-1/+1
| | | | | | Because applyMask ignores upper bits, we don't need to mask them. llvm-svn: 334647
* Make a function non-member because it doesn't depend on any class.Rui Ueyama2018-06-131-2/+1
| | | | llvm-svn: 334646
* Apply clang-format.Rui Ueyama2018-06-131-4/+2
| | | | llvm-svn: 334645
* Add missing #include.Zachary Turner2018-06-131-0/+1
| | | | llvm-svn: 334644
* Enable ThreadPool to support tasks that return values.Zachary Turner2018-06-133-26/+64
| | | | | | | | | | | | | | | | | | | | | Previously ThreadPool could only queue async "jobs", i.e. work that was done for its side effects and not for its result. It's useful occasionally to queue async work that returns a value. From an API perspective, this is very intuitive. The previous API just returned a shared_future<void>, so all we need to do is make it return a shared_future<T>, where T is the type of value that the operation returns. Making this work required a little magic, but ultimately it's not too bad. Instead of keeping a shared queue<packaged_task<void()>> we just keep a shared queue<unique_ptr<TaskBase>>, where TaskBase is a class with a pure virtual execute() method, then have a templated derived class that stores a packaged_task<T()>. Everything else works out pretty cleanly. Differential Revision: https://reviews.llvm.org/D48115 llvm-svn: 334643
* [lit] Split test_set_working_dir TestProcessLaunch into two tests and fix it ↵Stella Stamenova2018-06-135-20/+60
| | | | | | | | | | | | | | | | | | | | | | on Windows Summary: test_set_working_dir was testing two scenario: failure to set the working dir because of a non existent directory and succeeding to set the working directory. Since the negative case fails on both Linux and Windows, the positive case was never tested. I split the test into two which allows us to always run both the negative and positive cases. The positive case now succeeds on Linux and the negative case still fails. During the investigation, it turned out that lldbtest.py will try to execute a process launch command up to 3 times if the command failed. This means that we could be covering up intermittent failures by running any test that does process launch multiple times without ever realizing it. I've changed the counter to 1 (though it can still be overwritten with the environment variable). This change also fixes both the positive and negative cases on Windows. There were a few issues: 1) In ProcessLauncherWindows::LaunchProcess, the error was not retrieved until CloseHandle was possibly called. Since CloseHandle is also a system API, its success would overwrite any existing error that could be retrieved using GetLastError. So by the time the error was retrieved, it was now a success. 2) In DebuggerThread::StopDebugging TerminateProcess was called on the process handle regardless of whether it was a valid handle. This was causing the process to crash when the handle was LLDB_INVALID_PROCESS (0xFFFFFFFF). 3) In ProcessWindows::DoLaunch we need to check that the working directory exists before launching the process to have the same behavior as other platforms which first check the directory and then launch process. This way we also control the exact error string. Reviewers: labath, zturner, asmith, jingham Reviewed By: labath Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D48050 llvm-svn: 334642
* [Darwin] Do not error on '-lto_library' optionBrian Gesiak2018-06-132-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Any invocation of `clang -fuse-ld=lld` that results in a link command on a macOS host currently fails, because the Darwin lld driver does not recognize the `-lto_library` option that Clang passes it. Fix the error by having the Darwin driver ignore the option. The Clang driver's macOS toolchain is written such that it will always pass the `-lto_library` option to the linker invocation on a macOS host. And although the DarwinLdDriver is written to ignore any unknown arguments, because `-lto_library` begins with `-l`, the DarwinLdDriver interprets it as a library search command, for a library named "to_library". When the DarwinLdDriver is unable to find a library specified via `-l`, it exits with a hard error. This causes any invocation of `clang -fuse-ld=lld` that results in a link command on a macOS host to fail with an error. To fix the issue, I considered two alternatives: 1. Modify the Clang Darwin toolchain to only pass `-lto_library` if lld is *not* being used. lld doesn't support LTO on Darwin anyway, so it can't use the option. However, I opted against this because, if and when lld *does* support LTO on Darwin, I'll have to make another commit to Clang in order to get it to pass the option to lld again. 2. Modify the Darwin lld driver to ignore the `-lto_library` option. Just in case users may take this to mean LTO is supported, I also added a warning. If and when lld supports LTO on Darwin, the same commit that adds support for this option can remove the warning. Option (2) seemed better to me, and is the rationale behind this commit. Test Plan: check-lld Reviewers: ruiu, smeenai, pcc Reviewed By: smeenai Subscribers: JDevlieghere, pcc, mehdi_amini, inglorion, steven_wu, llvm-commits Differential Revision: https://reviews.llvm.org/D47994 llvm-svn: 334641
* [AMDGPU] Corrected computeKnownBits for V_PERM_B32Stanislav Mekhanoshin2018-06-132-7/+30
| | | | | | Differential Revision: https://reviews.llvm.org/D48133 llvm-svn: 334640
* [COFF] Add ARM64 intrinsics: __yield, __wfe, __wfi, __sev, __sevlMandeep Singh Grang2018-06-133-0/+46
| | | | | | | | | | | | | | Summary: These intrinsics result in hint instructions. They are provided here for MSVC ARM64 compatibility. Reviewers: mstorsjo, compnerd, javed.absar Reviewed By: mstorsjo Subscribers: kristof.beyls, chrib, cfe-commits Differential Revision: https://reviews.llvm.org/D48132 llvm-svn: 334639
* [ObjC] Add dataformatter for NSDecimalNumberJonas Devlieghere2018-06-135-1/+72
| | | | | | | | | | This patch adds a data formatter for NSDecimalNumber. The latter is a Foundation object used for representing and performing arithmetic on base-10 numbers that bridges to Decimal. Differential revision: https://reviews.llvm.org/D48114 llvm-svn: 334638
* Add Hexagon SupportSid Manning2018-06-137-0/+104
| | | | | | Differential Revision: https://reviews.llvm.org/D47791 llvm-svn: 334637
* [analyzer] Fix offset overflow check in MemRegionGeorge Karpenkov2018-06-132-43/+14
| | | | | | | | | rdar://39593879 https://bugs.llvm.org/show_bug.cgi?id=37142 Differential Revision: https://reviews.llvm.org/D48139 llvm-svn: 334636
* Add checkMulAdd helper function to CheckedArithmeticGeorge Karpenkov2018-06-132-0/+45
| | | | | | | | | | Multiplication followed by addition (https://en.wikipedia.org/wiki/Multiply–accumulate_operation) is a sufficiently common use-case to warrant a separate helper. Differential Revision: https://reviews.llvm.org/D48138 llvm-svn: 334635
* Change checked arithmetic functions API to return OptionalGeorge Karpenkov2018-06-132-67/+50
| | | | | | | | | | Returning optional is much safer. The previous API had potential to cause use of undefined variables, if the value passed by pointer was accidentally read afterwards. Differential Revision: https://reviews.llvm.org/D48137 llvm-svn: 334634
* [llvm-mca] Fixed a bug in the logic that checks if a memory operation is ↵Andrea Di Biagio2018-06-132-8/+53
| | | | | | | | | | | | | | | ready to execute. Fixes PR37790. In some (very rare) cases, the LSUnit (Load/Store unit) was wrongly marking a load (or store) as "ready to execute" effectively bypassing older memory barrier instructions. To reproduce this bug, the memory barrier must be the first instruction in the input assembly sequence, and it doesn't have to perform any register writes. llvm-svn: 334633
* [CMake] Handle 'libtool' being at a path with spaces in it.Jordan Rose2018-06-131-1/+1
| | | | | | This can happen on macOS if the user's Xcode is at a path with spaces in it. llvm-svn: 334632
* [ObjC] Use llvm::StringRef in summary providersJonas Devlieghere2018-06-131-20/+19
| | | | | | | Replace const char pointers with llvm::StringRef and use its equality operator for string comparisons. llvm-svn: 334631
* LTO: Keep file handles open for memory mapped files.Peter Collingbourne2018-06-137-105/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On Windows we've observed that if you open a file, write to it, map it into memory and close the file handle, the contents of the memory mapping can sometimes be incorrect. That was what we did when adding an entry to the ThinLTO cache using the TempFile and MemoryBuffer classes, and it was causing intermittent build failures on Chromium's ThinLTO bots on Windows. More details are in the associated Chromium bug (crbug.com/786127). We can prevent this from happening by keeping a handle to the file open while the mapping is active. So this patch changes the mapped_file_region class to duplicate the file handle when mapping the file and close it upon unmapping it. One gotcha is that the file handle that we keep open must not have been created with FILE_FLAG_DELETE_ON_CLOSE, as otherwise the operating system will prevent other processes from opening the file. We can achieve this by avoiding the use of FILE_FLAG_DELETE_ON_CLOSE altogether. Instead, we use SetFileInformationByHandle with FileDispositionInfo to manage the delete-on-close bit. This lets us remove the hack that we used to use to clear the delete-on-close bit on a file opened with FILE_FLAG_DELETE_ON_CLOSE. A downside of using SetFileInformationByHandle/FileDispositionInfo as opposed to FILE_FLAG_DELETE_ON_CLOSE is that it prevents us from using CreateFile to open the file while the flag is set, even within the same process. This doesn't seem to matter for almost every client of TempFile, except for LockFileManager, which calls sys::fs::create_link to create a hard link from the lock file, and in the process of doing so tries to open the file. To prevent this change from breaking LockFileManager I changed it to stop using TempFile by effectively reverting r318550. Differential Revision: https://reviews.llvm.org/D48051 llvm-svn: 334630
* [X86] Add one more intrinsic and test cases to avx512-cvttp2i.ll.Craig Topper2018-06-131-0/+22
| | | | | | spatel noticed it was missing in D47993. llvm-svn: 334629
* [CodeGen] make nan builtins pure rather than const (PR37778)Sanjay Patel2018-06-132-25/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | https://bugs.llvm.org/show_bug.cgi?id=37778 ...shows a miscompile resulting from marking nan builtins as 'const'. The nan libcalls/builtins take a pointer argument: http://www.cplusplus.com/reference/cmath/nan-function/ ...and the chars dereferenced by that arg are used to fill in the NaN constant payload bits. "const" means that the pointer argument isn't dereferenced. That's translated to "readnone" in LLVM. "pure" means that the pointer argument may be dereferenced. That's translated to "readonly" in LLVM. This change prevents the IR optimizer from killing the lead-up to the nan call here: double a() { char buf[4]; buf[0] = buf[1] = buf[2] = '9'; buf[3] = '\0'; return __builtin_nan(buf); } ...the optimizer isn't currently able to simplify this to a constant as we might hope, but this patch should solve the miscompile. Differential Revision: https://reviews.llvm.org/D48134 llvm-svn: 334628
* IR: fix documentation markupSaleem Abdulrasool2018-06-131-2/+2
| | | | | | Use `\brief` instead of `\Brief`. NFC. llvm-svn: 334627
* [ASAN] Re-enable fgets_fputs test for darwin.Ahmed Bougacha2018-06-131-1/+1
| | | | | | It seems to be passing, at least on the bots I've seen. llvm-svn: 334626
* [AMDGPU] Change enqueue kernel handle typeYaxun Liu2018-06-132-6/+7
| | | | | | | | | | Currently the handle type is a global pointer which holds 8 bytes. We need a larger type which hold 16 bytes, therefore change it to [i64 x 2]. Differential Revision: https://reviews.llvm.org/D48094 llvm-svn: 334625
* [TSan] Fix madvise(MADV_NOHUGEPAGE) for meta shadow memoryAlex Shlyapnikov2018-06-134-18/+40
| | | | | | | | | | | | | | | | Summary: Move madvise(MADV_NOHUGEPAGE) for the meta shadow memory after the meta shadow memory is mapped (currently it silently fails with ENOMEM). Add a diagnostic message to detect similar problems in the future. Reviewers: dvyukov Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D48097 llvm-svn: 334624
* [CostModel][X86] Test showing failure to recognise REVERSE shuffle mask if ↵Simon Pilgrim2018-06-131-0/+47
| | | | | | the elements come from the second src llvm-svn: 334623
* [AMDGPU][MC] Enabled parsing of relocations on VALU instructionsDmitry Preobrazhensky2018-06-133-2/+20
| | | | | | | | | | See bug 37566: https://bugs.llvm.org/show_bug.cgi?id=37566 Reviewers: artem.tamazov, arsenm, nhaehnle Differential Revision: https://reviews.llvm.org/D47884 llvm-svn: 334622
* [CostModel] Recognise BROADCAST shuffle mask if the elements come from the ↵Simon Pilgrim2018-06-132-11/+18
| | | | | | second src llvm-svn: 334620
* [Basic] Fix -Wreorder warningBenjamin Kramer2018-06-131-15/+12
| | | | | | Just use field initializers that don't suffer from this problem llvm-svn: 334619
* [FileSpec] Simplify getting extension and stem.Jonas Devlieghere2018-06-131-8/+3
| | | | | | | As noted by Pavel on lldb-commits, we don't need the temp path, we can just pass the filename directly into extension() and path(). llvm-svn: 334618
* Revert: [llvm-mca] Flush the output stream before we start the analysis of a ↵Andrea Di Biagio2018-06-131-1/+0
| | | | | | | | | new code region. NFC Not sure why, but it breaks buildbot clang-cmake-armv8-full. It causes a failure in TEST 'Xray-armhf-linux :: TestCases/Posix/profiling-single-threaded.cc'. llvm-svn: 334617
* [CostModel][X86] Test showing failure to recognise BROADCAST shuffle mask if ↵Simon Pilgrim2018-06-131-0/+47
| | | | | | the elements come from the second src llvm-svn: 334616
* [FileSpec] Delegate common operations to llvm::sys::pathJonas Devlieghere2018-06-139-79/+69
| | | | | | | | | | | | | | | With the recent changes in FileSpec to use LLVM's path style, it is possible to delegate a bunch of common path operations to LLVM's path helpers. This means we only have to maintain a single implementation and at the same time can benefit from the efforts made by the rest of the LLVM community. This is part one of a set of patches. There was no obvious way to split this so I just worked from top to bottom. Differential revision: https://reviews.llvm.org/D48084 llvm-svn: 334615
* Fix/unify the spelling of Objective-C.Adrian Prantl2018-06-1319-25/+25
| | | | llvm-svn: 334614
* [PowerPC] The __float128 type should only be available on Power9Stefan Pintilie2018-06-135-116/+127
| | | | | | | | | | | | Diasble the use of the type __float128 for PPC machines older than Power9. The use of -mfloat128 for PPC machine older than Power9 will result in an error. Differential Revision: https://reviews.llvm.org/D48088 llvm-svn: 334613
* [libclang] Make c-index-test.c ISO C90 compliant.Matt Morehouse2018-06-131-1/+1
| | | | | | Fixes a build bot breakage caused by r334593. llvm-svn: 334612
* Add modules support for lldb headers in include/Raphael Isemann2018-06-1310-7/+200
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch adds a modulemap which allows compiling the lldb headers into C++ modules (for example in builds with LLVM_ENABLE_MODULES=On). Even though most of the affected code has been cleaned up to work with the more strict C++ module semantics, there are still some workarounds left in the current modulemap (the most obvious one is the big `lldb` wrapper module). It also moves the Obj-C++ files in lldb to their own subdirectories. This was necessary because we need to filter out the modules flags for this code. Note: With the latest clang and libstdc++ it seems necessary to have a STL C++ module to get a working LLVM_ENABLE_MODULES build for lldb. Otherwise clang will falsely detect ODR violations in the textually included STL code inside the lldb modules. Reviewers: aprantl, bruno Reviewed By: aprantl, bruno Subscribers: mgorny, yamaguchi, v.g.vassilev, lldb-commits Differential Revision: https://reviews.llvm.org/D47929 llvm-svn: 334611
OpenPOWER on IntegriCloud