1. Nov 27, 2018
    • Matt Arsenault's avatar
      AMDGPU: Cleanup / relax tests for future changes · dcdf3ddf
      Matt Arsenault authored
      llvm-svn: 347576
      dcdf3ddf
    • Gabor Marton's avatar
      [ASTImporter] Set MustBuildLookupTable on PrimaryContext · b795ed93
      Gabor Marton authored
      Summary: SetMustBuildLookupTable() must always be called on a primary context.
      
      Reviewers: labath, shafik, a.sidorin
      
      Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411
      
      Differential Revision: https://reviews.llvm.org/D54863
      
      llvm-svn: 347575
      b795ed93
    • Ilya Biryukov's avatar
      [clangd] Do not drop diagnostics from macros · e8ccb823
      Ilya Biryukov authored
      if they still end up being in the main file.
      
      llvm-svn: 347574
      e8ccb823
    • Matt Arsenault's avatar
      AMDGPU: Don't optimize exec masks at -O0 · 105fc1a5
      Matt Arsenault authored
      llvm-svn: 347573
      105fc1a5
    • Matt Arsenault's avatar
      AMDGPU: Only add implicit super-reg def for first subreg · 6384d9ea
      Matt Arsenault authored
      llvm-svn: 347572
      6384d9ea
    • Sander de Smalen's avatar
      [AArch64] Add aarch64_vector_pcs function attribute to Clang · 44a2253a
      Sander de Smalen authored
      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
      44a2253a
    • Guillaume Chatelet's avatar
      [clang-tidy] Improving narrowing conversions · 10a7ee70
      Guillaume Chatelet authored
      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
      10a7ee70
    • Than McIntosh's avatar
      [CodeGen] Take SPAdj into account for STATEPOINT liveness args · b9e4852c
      Than McIntosh authored
      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
      b9e4852c
    • Louis Dionne's avatar
      [libcxx] Use a type that is always an aggregate in variant's tests · 20883fc2
      Louis Dionne authored
      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
      20883fc2
    • Sam McCall's avatar
      [clangd] Enable auto-index behind a flag. · 422c828d
      Sam McCall authored
      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
      422c828d
  2. Nov 26, 2018
    • Ilya Biryukov's avatar
      [clangd] Fix compilation of IndexBenchmark · d60c2896
      Ilya Biryukov authored
      llvm-svn: 347566
      d60c2896
    • Aaron Ballman's avatar
      Remove an unnecessary file; NFC. · 0442a12a
      Aaron Ballman authored
      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
      0442a12a
    • Gabor Marton's avatar
      [ASTImporter][Structural Eq] Check for isBeingDefined · 17d39677
      Gabor Marton authored
      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
      17d39677
    • Ilya Biryukov's avatar
      [clangd] Fix use-after-free with expected types in indexing · 4d3d82ee
      Ilya Biryukov authored
      llvm-svn: 347563
      4d3d82ee
    • Ilya Biryukov's avatar
      [clangd] Add type boosting in code completion · 647da3e8
      Ilya Biryukov authored
      Reviewers: sammccall, ioeric
      
      Reviewed By: sammccall
      
      Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D52276
      
      llvm-svn: 347562
      647da3e8
    • Nikita Popov's avatar
      [DemandedBits] Add support for funnel shifts · f94c8f0d
      Nikita Popov authored
      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
      f94c8f0d
    • Ilya Biryukov's avatar
      [clangd] Collect and store expected types in the index · a21392bf
      Ilya Biryukov authored
      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
      a21392bf
    • Ilya Biryukov's avatar
      [clangd] Initial implementation of expected types · d360b298
      Ilya Biryukov authored
      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
      d360b298
    • Ilya Biryukov's avatar
      [Index] Expose USR generation for types · a622484f
      Ilya Biryukov authored
      Summary: Used in clangd.
      
      Reviewers: sammccall, ioeric
      
      Reviewed By: sammccall
      
      Subscribers: kadircet, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D52275
      
      llvm-svn: 347558
      a622484f
    • Sanjay Patel's avatar
      [x86] promote all multiply i8 by constant to i32 · d31220e0
      Sanjay Patel authored
      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
      d31220e0
    • Nemanja Ivanovic's avatar
      [PowerPC] Vector load/store builtins overstate alignment of pointers · 2447baff
      Nemanja Ivanovic authored
      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
      2447baff
    • Sylvestre Ledru's avatar
      Create a diagnostic group for... · 72c5fcf0
      Sylvestre Ledru authored
      Create a diagnostic group for 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
      72c5fcf0
    • Sam McCall's avatar
      [clangd] Fix missing include from r347538 - fix windows buildbots · 7d0e4848
      Sam McCall authored
      llvm-svn: 347554
      7d0e4848
    • George Rimar's avatar
      [LLD][ELF] - Added a test for "-image-base: number expected" message. NFC. · 6bc22e1b
      George Rimar authored
      We had no such test.
      
      llvm-svn: 347553
      6bc22e1b
    • George Rimar's avatar
      [LLD][ELF] - Add a test for "unbalanced --push-state/--pop-state" error. · e9ab0d06
      George Rimar authored
      We had no such test.
      
      llvm-svn: 347552
      e9ab0d06
    • Haojian Wu's avatar
      [clang-tidy] No warning for auto new expression in smart check · 77c56fff
      Haojian Wu authored
      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
      77c56fff
    • George Rimar's avatar
      [LLD][ELF] - Add a check for --split-stack-adjust-size error message. NFCI. · 15b8cd91
      George Rimar authored
      "--split-stack-adjust-size: size must be >= 0" message
      was never tested.
      
      llvm-svn: 347550
      15b8cd91
    • George Rimar's avatar
      [LLD][ELF] - Do not crash when parsing the -defsym option from a error state. · c1522816
      George Rimar authored
      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
      c1522816
    • Eric Liu's avatar
      [clangd] Tune down scope boost for global scope · 4fac50e7
      Eric Liu authored
      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
      4fac50e7
    • Haojian Wu's avatar
      [clangd] Use testPath in the test. · 43efc6ba
      Haojian Wu authored
      llvm-svn: 347547
      43efc6ba
    • Alexander Kornienko's avatar
      [clang-tidy] PrintStackTraceOnErrorSignal · f90bdf73
      Alexander Kornienko authored
      llvm-svn: 347546
      f90bdf73
    • Diana Picus's avatar
      [ARM GlobalISel] Support G_CTLZ and G_CTLZ_ZERO_UNDEF · 0528e2cf
      Diana Picus authored
      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
      0528e2cf
    • Diana Picus's avatar
      Fix typo in comment. NFC · 30887bf6
      Diana Picus authored
      llvm-svn: 347544
      30887bf6
    • George Rimar's avatar
      [LLD][ELF] - Remove the excessive safety return. NFC. · a44c0f27
      George Rimar authored
      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
      a44c0f27
    • Sam Parker's avatar
      [ARM] Prevent parallel macs for unsigned values · 5338f7aa
      Sam Parker authored
      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
      5338f7aa
    • Fedor Sergeev's avatar
      Revert "[TTI] Reduction costs only need to include a single extract element cost" · 8cd9d1b5
      Fedor Sergeev authored
      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
      8cd9d1b5
    • George Rimar's avatar
      [LLD][ELF] - Add llvm_unreachable. NFC. · 0e0cd5be
      George Rimar authored
      We never should call writeTo() for BSS section.
      
      llvm-svn: 347540
      0e0cd5be
    • Ilya Biryukov's avatar
      [clangd] Cleanup after landing documentSymbol. NFC · 4174d096
      Ilya Biryukov authored
      - 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
      4174d096
    • Sam McCall's avatar
      [clangd] Auto-index watches global CDB for changes. · 6e2d2a33
      Sam McCall authored
      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
      6e2d2a33
    • Haojian Wu's avatar
      [clang-tidy] Don't generate incorrect fixes for class with deleted copy... · dbfa9c3e
      Haojian Wu authored
      [clang-tidy] Don't generate incorrect fixes for class with deleted copy 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
      dbfa9c3e