summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* [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
* [llvm-mca] Flush the output stream before we start the analysis of a new ↵Andrea Di Biagio2018-06-131-0/+1
| | | | | | code region. NFC llvm-svn: 334610
* [AMDGPU][MC][GFX8][GFX9] Allow LDS direct reads for BUFFER_LOAD_DWORDX2/X3/X4Dmitry Preobrazhensky2018-06-132-3/+31
| | | | | | | | | | See bug 37653: https://bugs.llvm.org/show_bug.cgi?id=37653 Reviewers: artem.tamazov, arsenm Differential Revision: https://reviews.llvm.org/D47885 llvm-svn: 334609
* [DAGCombiner] remove hasOneUse() check from fadd constants transformSanjay Patel2018-06-133-13/+16
| | | | | | | | | | | We're constant folding here, so we shouldn't check uses. This matches the IR optimizer behavior. The x86 test shows the expected win. The AArch64 test shows something else. This only seems to happen if the "generic" AArch64 CPU model is used by MachineCombiner, so I'll file a bug report to follow-up. llvm-svn: 334608
* AMDGPU: Move isSDNodeSourceOfDivergence() implementation to SITargetLoweringTom Stellard2018-06-134-71/+69
| | | | | | | | | | | | | | | | | | Summary: The code that handles ISD:Register and ISD::CopyFromReg assumes the target is amdgcn, so this is broken on r600. We don't need this analysis on r600 anyway so we can safely move it to SITargetLowering. Reviewers: alex-t, arsenm, nhaehnle Reviewed By: arsenm Subscribers: msearles, kzhuravl, wdng, yaxunl, dstuttard, tpr, t-tye, llvm-commits Differential Revision: https://reviews.llvm.org/D46298 llvm-svn: 334607
* Reverting r334604 due to failing tests.Aaron Ballman2018-06-135-928/+0
| | | | | | http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/31500 llvm-svn: 334606
* [x86] add test for fadd with more than one use; NFCSanjay Patel2018-06-131-0/+19
| | | | | | | | | The equivalent AArch64 test added at rL334556 isn't showing the expected output from the DAGCombiner code change that would fix this example. That's a machine combiner bug from what I see. llvm-svn: 334605
* Add a new class to analyze whether an expression is mutated within a statement.Aaron Ballman2018-06-135-0/+928
| | | | | | | | ExprMutationAnalyzer is a generally useful helper that can be used in different clang-tidy checks for checking whether a given expression is (potentially) mutated within a statement (typically the enclosing compound statement.) This is a more general and more powerful/accurate version of isOnlyUsedAsConst, which is used in ForRangeCopyCheck, UnnecessaryCopyInitialization. Patch by Shuai Wang llvm-svn: 334604
* [FPEnv] Expand constrained FP operationsCameron McInally2018-06-132-8/+414
| | | | | | | | | | Add a helper function to expand constrained FP operations as needed. Note that the Strict POWI operation is not handled in this patch since the format is slightly different from the others. Differential Revision: https://reviews.llvm.org/D47491 llvm-svn: 334603
* Do not enforce absolute path argv0 in windowsHans Wennborg2018-06-132-29/+58
| | | | | | | | | | | | | | | | Even if we support no-canonical-prefix on clang-cl(https://reviews.llvm.org/D47480), argv0 becomes absolute path in clang-cl and that embeds absolute path in /showIncludes. This patch removes such full path normalization from InitLLVM on windows, and that removes absolute path from clang-cl output (obj/stdout/stderr) when debug flag is disabled. Patch by Takuto Ikuta! Differential Revision https://reviews.llvm.org/D47578 llvm-svn: 334602
* [llvm-exegesis] Fix buildbot - power was using native target for X86.Guillaume Chatelet2018-06-133-4/+11
| | | | | | | | | | | | Reviewers: courbet Reviewed By: courbet Subscribers: tschuett, llvm-commits Differential Revision: https://reviews.llvm.org/D48125 llvm-svn: 334601
* Add -fforce-emit-vtablesPiotr Padlewski2018-06-1311-3/+182
| | | | | | | | | | | | | | | | | | | Summary: In many cases we can't devirtualize because definition of vtable is not present. Most of the time it is caused by inline virtual function not beeing emitted. Forcing emitting of vtable adds a reference of these inline virtual functions. Note that GCC was always doing it. Reviewers: rjmccall, rsmith, amharc, kuhar Subscribers: llvm-commits, cfe-commits Differential Revision: https://reviews.llvm.org/D47108 Co-authored-by: Krzysztof Pszeniczny <krzysztof.pszeniczny@gmail.com> llvm-svn: 334600
* [llvm-exegesis] Fix failing assert when creating Snippet for LAHF.Guillaume Chatelet2018-06-132-7/+22
| | | | | | | | | | Reviewers: courbet Subscribers: tschuett, llvm-commits Differential Revision: https://reviews.llvm.org/D48123 llvm-svn: 334599
* Revert "Improve handling of COPY instructions with identical value numbers"Krzysztof Parzyszek2018-06-132-268/+19
| | | | | | This reverts r334594, it breaks buildbots and fails with expensive checks. llvm-svn: 334598
* Correct behavior of __builtin_*_overflow and constexpr.Erich Keane2018-06-132-9/+36
| | | | | | | | | | Enable these builtins to be called across a lambda boundary with captureless const/constexpr, as brought up by Eli here: https://reviews.llvm.org/D48040 Differential Revision: https://reviews.llvm.org/D48053 llvm-svn: 334597
* [llvm-exegesis] Cleaner design without mutable data.Guillaume Chatelet2018-06-1312-214/+468
| | | | | | | | | | | | Summary: Previous design was relying on the 'mutate' keyword and was quite confusing. This version separate mutable from immutable data and makes it clearer what changes and what doesn't. Reviewers: courbet Subscribers: tschuett, llvm-commits Differential Revision: https://reviews.llvm.org/D48020 llvm-svn: 334596
* [mips][microMIPS] Extending size reduction pass with LWP and SWPZoran Jovanovic2018-06-1313-73/+828
| | | | | | | | | | | | Author: milena.vujosevic.janicic Reviewers: sdardis The patch extends size reduction pass for MicroMIPS. It introduces reduction of two instructions into one instruction: Two SW instructions are transformed into one SWP instrucition. Two LW instructions are transformed into one LWP instrucition. Differential Revision: https://reviews.llvm.org/D39115 llvm-svn: 334595
* Improve handling of COPY instructions with identical value numbersKrzysztof Parzyszek2018-06-132-19/+268
| | | | | | Differential Revision: https://reviews.llvm.org/D48102 llvm-svn: 334594
* [libclang] Optionally add code completion results for arrow instead of dotIvan Donchevskii2018-06-137-41/+310
| | | | | | | | Follow up for D41537 - libclang part. Differential Revision: https://reviews.llvm.org/D46862 llvm-svn: 334593
* [x86] eliminate even more sign-bit tests with vector selectSanjay Patel2018-06-133-29/+8
| | | | | | | | | | | | | | | | | | | This shortcoming was noted in D47330, and the test diffs show we already had other examples where we failed to fold to a SHRUNKBLEND: /// Dynamic (non-constant condition) vector blend where only the sign bits /// of the condition elements are used. This is used to enforce that the /// condition mask is not valid for generic VSELECT optimizations. This patch implements an idea from D48043 and would obsolete that patch because it catches more cases (notable the AVX1 case that was missed there). All we're doing is allowing the existing transform to fire more often by removing the post-legalize constraint. All of the relevant feature checks and other predicates are left as-is. Differential Revision: https://reviews.llvm.org/D48078 llvm-svn: 334592
* [RISCV] Add codegen support for atomic load/stores with RV32AAlex Bradbury2018-06-135-2/+273
| | | | | | | | | | | | | | | Fences are inserted according to table A.6 in the current draft of version 2.3 of the RISC-V Instruction Set Manual, which incorporates the memory model changes and definitions contributed by the RISC-V Memory Consistency Model task group. Instruction selection failures will now occur for 8/16/32-bit atomicrmw and cmpxchg operations when targeting RV32IA until lowering for these operations is added in a follow-on patch. Differential Revision: https://reviews.llvm.org/D47589 llvm-svn: 334591
* [RISCV] Codegen support for atomic operations on RV32IAlex Bradbury2018-06-137-0/+7368
| | | | | | | | | | | | | | | | | This patch adds lowering for atomic fences and relies on AtomicExpandPass to lower atomic loads/stores, atomic rmw, and cmpxchg to __atomic_* libcalls. test/CodeGen/RISCV/atomic-* are modelled on the exhaustive test/CodeGen/PPC/atomics-regression.ll, and will prove more useful once RV32A codegen support is introduced. Fence mappings are taken from table A.6 in the current draft of version 2.3 of the RISC-V Instruction Set Manual, which incorporates the memory model changes and definitions contributed by the RISC-V Memory Consistency Model task group. Differential Revision: https://reviews.llvm.org/D47587 llvm-svn: 334590
* Revert "[clangd] Log completion context type. NFC"Sam McCall2018-06-131-6/+4
| | | | | | This reverts commit r334572, which has a potential use-after-free. llvm-svn: 334589
* [SLPVectorizer] getSameOpcode - remove useless cast [NFC]Simon Pilgrim2018-06-131-3/+2
| | | | | | There's no need to cast the base Value to an Instruction llvm-svn: 334588
* [SLPVectorizer] getSameOpcode - remove unusued alternate code [NFC]Simon Pilgrim2018-06-131-4/+1
| | | | | | We early-out for the case where we don't use alternate opcodes, so no need to check for it later. llvm-svn: 334587
* [TableGen] Emit a fatal error on inconsistencies in resource units vs cycles.Clement Courbet2018-06-133-12/+25
| | | | | | | | | | | | | | | | | | | | | Summary: For targets I'm not familiar with, I've automatically made the "default to 1 for each resource" behaviour explicit in the td files. For more obvious cases, I've ventured a fix. Some notes: - Exynos is especially fishy. - AArch64SchedThunderX2T99.td had some truncated entries. If I understand correctly, the person who wrote that interpreted the ResourceCycle as a range. I made the decision to use the upper/lower bound for consistency with the 'Latency' value. I'm sure there is a better choice. - The change to X86ScheduleBtVer2.td is an NFC, it just makes values more explicit. Also see PR37310. Reviewers: RKSimon, craig.topper, javed.absar Subscribers: kristof.beyls, llvm-commits Differential Revision: https://reviews.llvm.org/D46356 llvm-svn: 334586
* [clangd] Move caching of compile args out of ClangdServer.Ilya Biryukov2018-06-1312-139/+109
| | | | | | | | | | | | | | | | | | | | | Summary: Caching is now handled by ClangdLSPServer and hidden behind the GlobalCompilationDatabase interface. This simplifies ClangdServer. This change also removes the SkipCache flag from addDocument, which is now obsolete. No behavioral changes are intended, the clangd binary still caches the compile commands on the first read. Reviewers: sammccall Reviewed By: sammccall Subscribers: mgorny, ioeric, MaskRay, jkorous, cfe-commits Differential Revision: https://reviews.llvm.org/D48068 llvm-svn: 334585
* GettingStarted.rst: Fix 'If you you' typo (PR37787)Hans Wennborg2018-06-131-1/+1
| | | | llvm-svn: 334584
* [PowerPC] fix trivial typos in comment, NFCHiroshi Inoue2018-06-1310-26/+26
| | | | llvm-svn: 334583
OpenPOWER on IntegriCloud