summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* AMDGPU: Don't optimize exec masks at -O0Matt Arsenault2018-11-261-1/+2
| | | | llvm-svn: 347573
* AMDGPU: Only add implicit super-reg def for first subregMatt Arsenault2018-11-261-2/+2
| | | | llvm-svn: 347572
* [AArch64] Add aarch64_vector_pcs function attribute to ClangSander de Smalen2018-11-2616-9/+110
| | | | | | | | | | | | | | | | | | | | This is the Clang patch to complement the following LLVM patches: https://reviews.llvm.org/D51477 https://reviews.llvm.org/D51479 More information describing the vector ABI and procedure call standard can be found here: https://developer.arm.com/products/software-development-tools/\ hpc/arm-compiler-for-hpc/vector-function-abi Patch by Kerry McLaughlin. Reviewed By: rjmccall Differential Revision: https://reviews.llvm.org/D54425 llvm-svn: 347571
* [clang-tidy] Improving narrowing conversionsGuillaume Chatelet2018-11-269-66/+988
| | | | | | | | | | | | | | | | | | | | | Summary: Newly flagged narrowing conversions: - integer to narrower signed integer (this is compiler implementation defined), - integer - floating point narrowing conversions, - floating point - integer narrowing conversions, - constants with narrowing conversions (even in ternary operator). Reviewers: hokein, alexfh, aaron.ballman, JonasToth Reviewed By: aaron.ballman, JonasToth Subscribers: lebedev.ri, courbet, nemanjai, xazax.hun, kbarton, cfe-commits Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D53488 llvm-svn: 347570
* [CodeGen] Take SPAdj into account for STATEPOINT liveness argsThan McIntosh2018-11-262-3/+97
| | | | | | | | | | | | | | | | | | Summary: STATEPOINT records its args' locations on stack relative to SP. If the SP is changed, take that into account. This patch authored by Cherry Zhang <cherryyz@google.com>. Reviewers: thanm, reames Reviewed By: reames Subscribers: reames, llvm-commits Differential Revision: https://reviews.llvm.org/D53603 llvm-svn: 347569
* [libcxx] Use a type that is always an aggregate in variant's testsLouis Dionne2018-11-263-25/+28
| | | | | | | | | | | | | | | | | | | | | Summary: In PR39232, we noticed that some variant tests started failing in C++2a mode with recent Clangs, because the rules for literal types changed in C++2a. As a result, a temporary fix was checked in (enabling the test only in C++17). This commit is what I believe should be the long term fix: I removed the tests that checked constexpr default-constructibility with a weird type from the tests for index() and valueless_by_exception(), and instead I added tests for those using an obviously literal type in the test for the default constructor. Reviewers: EricWF, mclow.lists Subscribers: christof, jkorous, dexonsmith, arphaman, libcxx-commits, rsmith Differential Revision: https://reviews.llvm.org/D54767 llvm-svn: 347568
* [clangd] Enable auto-index behind a flag.Sam McCall2018-11-2615-22/+150
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Ownership and configuration: The auto-index (background index) is maintained by ClangdServer, like Dynamic. (This means ClangdServer will be able to enqueue preamble indexing in future). For now it's enabled by a simple boolean flag in ClangdServer::Options, but we probably want to eventually allow injecting the storage strategy. New 'sync' command: In order to meaningfully test the integration (not just unit-test components) we need a way for tests to ensure the asynchronous index reads/writes occur before a certain point. Because these tests and assertions are few, I think exposing an explicit "sync" command for use in tests is simpler than allowing threading to be completely disabled in the background index (as we do for TUScheduler). Bugs: I fixed a couple of trivial bugs I found while testing, but there's one I can't. JSONCompilationDatabase::getAllFiles() may return relative paths, and currently we trigger an assertion that assumes they are absolute. There's no efficient way to resolve them (you have to retrieve the corresponding command and then resolve against its directory property). In general I think this behavior is broken and we should fix it in JSONCompilationDatabase and require CompilationDatabase::getAllFiles() to be absolute. Reviewers: kadircet Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D54894 llvm-svn: 347567
* [clangd] Fix compilation of IndexBenchmarkIlya Biryukov2018-11-261-2/+2
| | | | llvm-svn: 347566
* Remove an unnecessary file; NFC.Aaron Ballman2018-11-262-18/+0
| | | | | | This source file has not been needed since r346522 and was triggering diagnostics in MSVC about an object file which exports no public symbols (LNK4221). llvm-svn: 347565
* [ASTImporter][Structural Eq] Check for isBeingDefinedGabor Marton2018-11-263-3/+49
| | | | | | | | | | | | | | | | Summary: If one definition is currently being defined, we do not compare for equality and we assume that the decls are equal. Reviewers: a_sidorin, a.sidorin, shafik Reviewed By: a_sidorin Subscribers: gamesh411, shafik, rnkovacs, dkrupp, Szelethus, cfe-commits Differential Revision: https://reviews.llvm.org/D53697 llvm-svn: 347564
* [clangd] Fix use-after-free with expected types in indexingIlya Biryukov2018-11-261-2/+4
| | | | llvm-svn: 347563
* [clangd] Add type boosting in code completionIlya Biryukov2018-11-264-2/+43
| | | | | | | | | | | | Reviewers: sammccall, ioeric Reviewed By: sammccall Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D52276 llvm-svn: 347562
* [DemandedBits] Add support for funnel shiftsNikita Popov2018-11-262-0/+100
| | | | | | | | | | | | | | Add support for funnel shifts to the DemandedBits analysis. The demanded bits of the first two operands can be determined if the shift amount is constant. The demanded bits of the third operand (shift amount) can be determined if the bitwidth is a power of two. This is basically the same functionality as implemented in D54869 and D54478, but for DemandedBits rather than InstCombine. Differential Revision: https://reviews.llvm.org/D54876 llvm-svn: 347561
* [clangd] Collect and store expected types in the indexIlya Biryukov2018-11-264-1/+15
| | | | | | | | | | | | | | | | | | | | Summary: And add a hidden option to control whether the types are collected. For experiments, will be removed when expected types implementation is stabilized. The index size is almost unchanged, e.g. the YAML index for all clangd sources increased from 53MB to 54MB. Reviewers: ioeric, sammccall Reviewed By: sammccall Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D52274 llvm-svn: 347560
* [clangd] Initial implementation of expected typesIlya Biryukov2018-11-265-0/+304
| | | | | | | | | | | | | | | | | Summary: Provides facilities to model the C++ conversion rules without the AST. The introduced representation can be stored in the index and used to implement type-based ranking improvements for index-based completions. Reviewers: sammccall, ioeric Reviewed By: sammccall Subscribers: malaperle, mgorny, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D52273 llvm-svn: 347559
* [Index] Expose USR generation for typesIlya Biryukov2018-11-262-0/+19
| | | | | | | | | | | | | | Summary: Used in clangd. Reviewers: sammccall, ioeric Reviewed By: sammccall Subscribers: kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D52275 llvm-svn: 347558
* [x86] promote all multiply i8 by constant to i32Sanjay Patel2018-11-265-155/+165
| | | | | | | | | | | | | | | | | | | | We have these 2 "isDesirable" promotion hooks (I'm not sure why we need both of them, but that's independent of this patch), and we can adjust them to promote "mul i8 X, C" to i32. Then, all of our existing LEA and other multiply expansion magic happens as it would for i32 ops. Some of the test diffs show that we could end up with an actual 32-bit mul instruction here because we choose not to expand to simpler ops. That instruction could be slower depending on the subtarget. On the plus side, this means we don't need a separate instruction to load the constant operand and possibly an extra instruction to move the result. If we need to tune mul i32 further, we could add a later transform that tries to shrink it back to i8 based on subtarget timing. I did not bother to duplicate all of the 32-bit test file RUNs and target settings that exist to test whether LEA expansion is cheap or not. The diffs here assume a default target, so that means LEA is generally cheap. Differential Revision: https://reviews.llvm.org/D54803 llvm-svn: 347557
* [PowerPC] Vector load/store builtins overstate alignment of pointersNemanja Ivanovic2018-11-264-100/+115
| | | | | | | | | | | | | A number of builtins in altivec.h load/store vectors from pointers to scalar types. Currently they just cast the pointer to a vector pointer, but expressions like that have the alignment of the target type. Of course, the input pointer did not have that alignment so this triggers UBSan (and rightly so). This resolves https://bugs.llvm.org/show_bug.cgi?id=39704 Differential revision: https://reviews.llvm.org/D54787 llvm-svn: 347556
* Create a diagnostic group for ↵Sylvestre Ledru2018-11-264-4/+4
| | | | | | | | | | | | | | | | warn_call_to_pure_virtual_member_function_from_ctor_dtor, so it can be turned into an error using Werror Summary: Patch by Arnaud Bienner Reviewers: davide, rsmith, jkorous Reviewed By: jkorous Subscribers: jkorous, sylvestre.ledru, cfe-commits Differential Revision: https://reviews.llvm.org/D53807 llvm-svn: 347555
* [clangd] Fix missing include from r347538 - fix windows buildbotsSam McCall2018-11-261-0/+1
| | | | llvm-svn: 347554
* [LLD][ELF] - Added a test for "-image-base: number expected" message. NFC.George Rimar2018-11-261-0/+3
| | | | | | We had no such test. llvm-svn: 347553
* [LLD][ELF] - Add a test for "unbalanced --push-state/--pop-state" error.George Rimar2018-11-261-0/+3
| | | | | | We had no such test. llvm-svn: 347552
* [clang-tidy] No warning for auto new expression in smart checkHaojian Wu2018-11-262-0/+6
| | | | | | | | | | | | Summary: The fix for `auto` new expression is illegal. Reviewers: aaron.ballman Subscribers: xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D54832 llvm-svn: 347551
* [LLD][ELF] - Add a check for --split-stack-adjust-size error message. NFCI.George Rimar2018-11-261-0/+2
| | | | | | | "--split-stack-adjust-size: size must be >= 0" message was never tested. llvm-svn: 347550
* [LLD][ELF] - Do not crash when parsing the -defsym option from a error state.George Rimar2018-11-262-0/+8
| | | | | | | | | | | | | | When we are in a error state, script parser will not parse the -defsym expression and hence will not tokenize it. Then ScriptLexer::Pos will be 0 and LLD will assert and crash here: MemoryBufferRef ScriptLexer::getCurrentMB() { assert(!MBs.empty() && Pos > 0); // Bang ! Solution - stop parsing the defsym in a error state. That is consistent with the regular case (when we parse the linker script). llvm-svn: 347549
* [clangd] Tune down scope boost for global scopeEric Liu2018-11-261-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This improves cross-namespace completions and has ignorable impact on other completion types. Metrics ``` ================================================================================================== OVERALL (excl. CROSS_NAMESPACE) ================================================================================================== Total measurements: 109367 (-6) All measurements: MRR: 68.11 (+0.04) Top-1: 58.59% (+0.03%) Top-5: 80.00% (+0.01%) Top-100: 95.92% (-0.02%) Full identifiers: MRR: 98.35 (+0.09) Top-1: 97.87% (+0.17%) Top-5: 98.96% (+0.01%) Top-100: 99.03% (+0.00%) Filter length 0-5: MRR: 23.20 (+0.05) 58.72 (+0.01) 70.16 (-0.03) 73.44 (+0.03) 76.24 (+0.00) 80.79 (+0.14) Top-1: 11.90% (+0.03%) 45.07% (+0.03%) 58.49% (-0.05%) 62.44% (-0.02%) 66.31% (-0.05%) 72.10% (+0.07%) Top-5: 35.51% (+0.08%) 76.94% (-0.01%) 85.10% (-0.13%) 87.40% (-0.02%) 88.65% (+0.01%) 91.84% (+0.17%) Top-100: 83.25% (-0.02%) 96.61% (-0.15%) 98.15% (-0.02%) 98.43% (-0.01%) 98.53% (+0.01%) 98.66% (+0.02%) ================================================================================================== CROSS_NAMESPACE ================================================================================================== Total measurements: 17702 (+27) All measurements: MRR: 28.12 (+3.26) Top-1: 21.07% (+2.70%) Top-5: 35.11% (+4.48%) Top-100: 74.31% (+1.02%) Full identifiers: MRR: 79.20 (+3.72) Top-1: 71.78% (+4.86%) Top-5: 88.39% (+2.84%) Top-100: 98.99% (+0.00%) Filter length 0-5: MRR: 0.92 (-0.10) 5.51 (+0.57) 18.30 (+2.34) 21.62 (+3.76) 32.00 (+6.00) 41.55 (+7.61) Top-1: 0.56% (-0.08%) 2.44% (+0.15%) 9.82% (+1.47%) 12.59% (+2.16%) 21.17% (+4.47%) 30.05% (+6.72%) Top-5: 1.20% (-0.15%) 7.14% (+1.04%) 25.17% (+3.91%) 29.74% (+5.90%) 43.29% (+9.59%) 54.75% (+9.79%) Top-100: 5.49% (-0.01%) 56.22% (+2.59%) 86.69% (+1.08%) 89.03% (+2.04%) 93.74% (+0.78%) 96.99% (+0.59%) ``` Reviewers: sammccall Reviewed By: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D54851 llvm-svn: 347548
* [clangd] Use testPath in the test.Haojian Wu2018-11-261-2/+2
| | | | llvm-svn: 347547
* [clang-tidy] PrintStackTraceOnErrorSignalAlexander Kornienko2018-11-261-0/+2
| | | | llvm-svn: 347546
* [ARM GlobalISel] Support G_CTLZ and G_CTLZ_ZERO_UNDEFDiana Picus2018-11-266-9/+255
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | We can now select CLZ via the TableGen'erated code, so support G_CTLZ and G_CTLZ_ZERO_UNDEF throughout the pipeline for types <= s32. Legalizer: If the CLZ instruction is available, use it for both G_CTLZ and G_CTLZ_ZERO_UNDEF. Otherwise, use a libcall for G_CTLZ_ZERO_UNDEF and lower G_CTLZ in terms of it. In order to achieve this we need to add support to the LegalizerHelper for the legalization of G_CTLZ_ZERO_UNDEF for s32 as a libcall (__clzsi2). We also need to allow lowering of G_CTLZ in terms of G_CTLZ_ZERO_UNDEF if that is supported as a libcall, as opposed to just if it is Legal or Custom. Due to a minor refactoring of the helper function in charge of this, we will also allow the same behaviour for G_CTTZ and G_CTPOP. This is not going to be a problem in practice since we don't yet have support for treating G_CTTZ and G_CTPOP as libcalls (not even in DAGISel). Reg bank select: Map G_CTLZ to GPR. G_CTLZ_ZERO_UNDEF should not make it to this point. Instruction select: Nothing to do. llvm-svn: 347545
* Fix typo in comment. NFCDiana Picus2018-11-261-1/+1
| | | | llvm-svn: 347544
* [LLD][ELF] - Remove the excessive safety return. NFC.George Rimar2018-11-261-3/+0
| | | | | | | | | | | | We explicitly call finalizeContents() only once for DynamicSection. The code testing we do not do it twice is just excessive. It could be an assert, but we don't do that for other sections, so does not seem we should do it here too. llvm-svn: 347543
* [ARM] Prevent parallel macs for unsigned valuesSam Parker2018-11-264-13/+214
| | | | | | | | | | | | Both zext and sext are currently allowed during the search for narrow sequences and sexts operands are later added to the mac candidates. But operands of muls are also added, without checking whether they're sext or zext, which means we can generate a signed smlad when we shouldn't. Differential Revision: https://reviews.llvm.org/D54790 llvm-svn: 347542
* Revert "[TTI] Reduction costs only need to include a single extract element ↵Fedor Sergeev2018-11-2615-1186/+1334
| | | | | | | | | | cost" This reverts commit r346970. It was causing PR39774, a crash in slp-vectorizer on a rather simple loop with just a bunch of 'and's in the body. llvm-svn: 347541
* [LLD][ELF] - Add llvm_unreachable. NFC.George Rimar2018-11-261-1/+3
| | | | | | We never should call writeTo() for BSS section. llvm-svn: 347540
* [clangd] Cleanup after landing documentSymbol. NFCIlya Biryukov2018-11-262-5/+6
| | | | | | | | - fix compile error on older gcc in Protocol.cpp, - remove redundant 'llvm::' qualifiers from Protocol.cpp, - remove unused variables in AST.cpp llvm-svn: 347539
* [clangd] Auto-index watches global CDB for changes.Sam McCall2018-11-269-61/+120
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Instead of receiving compilation commands, auto-index is triggered by just filenames to reindex, and gets commands from the global comp DB internally. This has advantages: - more of the work can be done asynchronously (fetching compilation commands upfront can be slow for large CDBs) - we get access to the CDB which can be used to retrieve interpolated commands for headers (useful in some cases where the original TU goes away) - fits nicely with the filename-only change observation from r347297 The interface to GlobalCompilationDatabase gets extended: when retrieving a compile command, the GCDB can optionally report the project the file belongs to. This naturally fits together with getCompileCommand: it's hard to implement one without the other. But because most callers don't care, I've ended up with an awkward optional-out-param-in-virtual method pattern - maybe there's a better one. This is the main missing integration point between ClangdServer and BackgroundIndex, after this we should be able to add an auto-index flag. Reviewers: ioeric, kadircet Subscribers: MaskRay, jkorous, arphaman, cfe-commits, ilya-biryukov Differential Revision: https://reviews.llvm.org/D54865 llvm-svn: 347538
* [clang-tidy] Don't generate incorrect fixes for class with deleted copy ↵Haojian Wu2018-11-262-0/+72
| | | | | | | | | | | | | | | | | constructor in smart_ptr check. Summary: The fix for aggregate initialization (`std::make_unique<Foo>(Foo {1, 2})` needs to see Foo copy constructor, otherwise we will have a compiler error. So we only emit the check warning. Reviewers: JonasToth, aaron.ballman Subscribers: xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D54745 llvm-svn: 347537
* [ELF] - Added test case for invalid relocation target errors. NFCI.George Rimar2018-11-262-0/+50
| | | | | | We had a proper error reporting, but no test cases. llvm-svn: 347536
* [LLD][ELF] - Add a test for non-null terminated mergeable strings section. NFCI.George Rimar2018-11-261-0/+8
| | | | | | LLD reports an error in this case, but we had no test. llvm-svn: 347535
* Revert "[PowerPC] Fix inconsistent ImmMustBeMultipleOf for same instruction"Kang Zhang2018-11-262-173/+4
| | | | | | | | This reverts commits r347532. Forget add the option -mtriple powerpc64-unknown-linux-gnu. So other platform is error except for PowerPC. llvm-svn: 347534
* [X86] Add test cases to show bad type legalization of fptosi/fptosui ↵Craig Topper2018-11-262-0/+667
| | | | | | | | v16f32->v16i8 and v8f64->v8i16 on pre-AVX512 targets. When splitting the v16f32/v8f64 result type, type legalization will try to promote the integer result type before a concat and an explicit truncate. But for the fptoui test case this is particularly bad since fptoui isn't supported on X86 until AVX512. We could use an fptosi since the result range would fit in a signed 32-bit value, but the generic type legalization doesn't do that transformation when splitting. It does do this when promoting. llvm-svn: 347533
* [PowerPC] Fix inconsistent ImmMustBeMultipleOf for same instructionKang Zhang2018-11-262-4/+173
| | | | | | | | | | | | | Summary: There are 4 instructions which have Inconsistent ImmMustBeMultipleOf in the function PPCInstrInfo::instrHasImmForm, they are LFS, LFD, STFS, STFD. These four instructions should set the ImmMustBeMultipleOf to 1 instead of 4. Reviewed By: nemanjai Differential Revision: https://reviews.llvm.org/D54738 llvm-svn: 347532
* A "constexpr" is evaluated in a constant context. Make sure this is reflectedBill Wendling2018-11-262-0/+10
| | | | | | if a __builtin_constant_p() is a part of a constexpr. llvm-svn: 347531
* [Support/FileSystem] Add sub-second precision for atime/mtime of ↵Argyrios Kyrtzidis2018-11-265-9/+61
| | | | | | | | | | | | | | | | | | | | sys::fs::file_status on unix platforms Summary: getLastAccessedTime() and getLastModificationTime() provided times in nanoseconds but with only 1 second resolution, even when the underlying file system could provide more precise times than that. These changes add sub-second precision for unix platforms that support improved precision. Also add some comments to make sure people are aware that the resolution of times can vary across different file systems. Reviewers: labath, zturner, aaron.ballman, kristina Reviewed By: aaron.ballman, kristina Subscribers: lebedev.ri, mgorny, kristina, llvm-commits Differential Revision: https://reviews.llvm.org/D54826 llvm-svn: 347530
* [CodeComplete] Simplify CodeCompleteConsumer.cpp, NFCFangrui Song2018-11-251-77/+69
| | | | | | | | Use range-based for loops Use XStr.compare(YStr) < 0 Format misaligned code llvm-svn: 347529
* [MetadataTest] Fix off-by-one strncpy warning reported by gcc8. (NFC)Florian Hahn2018-11-251-5/+3
| | | | llvm-svn: 347528
* [CodeGen] translate MS rotate builtins to LLVM funnel-shift intrinsicsSanjay Patel2018-11-252-118/+31
| | | | | | | | | | | | | | This was originally part of: D50924 and should resolve PR37387: https://bugs.llvm.org/show_bug.cgi?id=37387 ...but it was reverted because some bots using a gcc host compiler would crash for unknown reasons with this included in the patch. Trying again now to see if that's still a problem. llvm-svn: 347527
* [x86] limit transform for select-of-fp-constantsSanjay Patel2018-11-258-16/+39
| | | | | | | | | | | | This should likely be adjusted to limit this transform further, but these diffs should be clear wins. If we have blendv/conditional move, then we should assume those are cheap ops. The loads become independent of the compare, so those can be speculated before we need to use the values in the blend/mov. llvm-svn: 347526
* [x86] add tests for select-of-fp-constants; NFCSanjay Patel2018-11-252-18/+96
| | | | | | | | | | | | There are many options here depending on subtarget, but we are uniformly relying on a transform that was driven by performance for a 32-bit SSE2 target in 2009. Note: The same motivation was apparently used to do this transform for *all* targets, so non-x86 may want to look at this too. llvm-svn: 347525
* [IPSCCP] Use input operand instead of OriginalOp for ssa_copy.Florian Hahn2018-11-252-5/+55
| | | | | | | | | | | OriginalOp of a Predicate refers to the original IR value, before renaming. While solving in IPSCCP, we have to use the operand of the ssa_copy instead, to avoid missing updates for nested conditions on the same IR value. Fixes PR39772. llvm-svn: 347524
OpenPOWER on IntegriCloud