1. Nov 27, 2018
  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