1. Nov 23, 2018
  2. Nov 22, 2018
    • Andrea Di Biagio's avatar
      [llvm-mca] LSUnit: use a SmallSet to model load/store queues. NFCI · 840f0326
      Andrea Di Biagio authored
      Also, try to minimize the number of queries to the memory queues to speedup the
      analysis.
      
      On average, this change gives a small 2% speedup. For memcpy-like kernels, the
      speedup is up to 5.5%.
      
      llvm-svn: 347469
      840f0326
    • Ilya Biryukov's avatar
      [clangd] Cleanup: make diagnostics callbacks from TUScheduler non-racy · c76394bc
      Ilya Biryukov authored
      Summary:
      Previously, removeDoc followed by an addDoc to TUScheduler resulted in
      racy diagnostic responses, i.e. the old dianostics could be delivered
      to the client after the new ones by TUScheduler.
      
      To workaround this, we tracked a version number in ClangdServer and
      discarded stale diagnostics. After this commit, the TUScheduler will
      stop delivering diagnostics for removed files and the workaround in
      ClangdServer is not required anymore.
      
      Reviewers: sammccall
      
      Reviewed By: sammccall
      
      Subscribers: javed.absar, ioeric, MaskRay, jkorous, arphaman, jfb, kadircet, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D54829
      
      llvm-svn: 347468
      c76394bc
    • Eric Liu's avatar
      [clangd] Cleanup: stop passing around list of supported URI schemes. · c0ac4bb1
      Eric Liu authored
      Summary:
      Instead of passing around a list of supported URI schemes in clangd, we
      expose an interface to convert a path to URI using any compatible scheme
      that has been registered. It favors customized schemes and falls
      back to "file" when no other scheme works.
      
      Changes in this patch are:
      - URI::create(AbsPath, URISchemes) -> URI::create(AbsPath). The new API finds a
      compatible scheme from the registry.
      - Remove URISchemes option everywhere (ClangdServer, SymbolCollecter, FileIndex etc).
      - Unit tests will use "unittest" by default.
      - Move "test" scheme from ClangdLSPServer to ClangdMain.cpp, and only
      register the test scheme when lit-test or enable-lit-scheme is set.
      (The new flag is added to make lit protocol.test work; I wonder if there
      is alternative here.)
      
      Reviewers: sammccall
      
      Reviewed By: sammccall
      
      Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D54800
      
      llvm-svn: 347467
      c0ac4bb1
    • Eric Liu's avatar
      [clangd] Cleanup: use index file instead of header in workspace symbols lit test. · 5628c145
      Eric Liu authored
      Summary:
      The full path of the input header depends on the execution environment
      and may result in different behavior (e.g. when different URI schemes are used).
      
      Reviewers: sammccall
      
      Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D54833
      
      llvm-svn: 347466
      5628c145
    • Krasimir Georgiev's avatar
      [clang-format] Do not treat asm clobber [ as ObjCExpr, refined · 56904bf8
      Krasimir Georgiev authored
      Summary:
      r346756 refined clang-format to not treat the `[` in `asm (...: [] ..)` as an
      ObjCExpr. However that's not enough, as we might have a comma-separated list of
      such clobbers as in the newly added test.
      This updates the detection to instead look at the Line's first token being `asm`
      and not mark `[`-s as ObjCExprs in this case.
      
      Reviewers: djasper, benhamilton
      
      Reviewed By: djasper, benhamilton
      
      Subscribers: benhamilton, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D54795
      
      llvm-svn: 347465
      56904bf8
    • Andrea Di Biagio's avatar
      [llvm-mca] Use a SmallVector instead of std::vector to track register reads/writes. NFCI · 13e1d207
      Andrea Di Biagio authored
      This avoids a heap allocation most of the times.
      This patch gives a small but consistent 3% speedup on a release build (up to ~5%
      on a debug build).
      
      llvm-svn: 347464
      13e1d207
    • Clement Courbet's avatar
      Revert rL347462 "[ASTMatchers] Add hasSideEffect() matcher." · a6144db1
      Clement Courbet authored
      Breaks some buildbots.
      
      llvm-svn: 347463
      a6144db1
    • Clement Courbet's avatar
      [ASTMatchers] Add hasSideEffect() matcher. · c022c51f
      Clement Courbet authored
      Summary: Exposes Expr::HasSideEffects.
      
      Reviewers: aaron.ballman
      
      Subscribers: cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D54830
      
      llvm-svn: 347462
      c022c51f
    • Louis Dionne's avatar
      [libcxx] Remove incorrect XFAIL on macos 10.12 · 509f7d7c
      Louis Dionne authored
      llvm-svn: 347461
      509f7d7c
    • Benjamin Kramer's avatar
      [clangd] Fix use-after-scope in unit test · 2c347759
      Benjamin Kramer authored
      The scheduler holds a reference to `Proceed`, so it has to be destroyed
      after the scheduler. Found by asan.
      
      llvm-svn: 347460
      2c347759
    • Andrea Di Biagio's avatar
      [llvm-mca] Fix an invalid memory read introduced by r346487. · 1cb8a3c6
      Andrea Di Biagio authored
      This patch fixes an invalid memory read introduced by r346487.
      Before this patch, partial register write had to query the latency of the
      dependent full register write by calling a method on the full write descriptor.
      However, if the full write is from an already retired instruction, chances are
      that the EntryStage already reclaimed its memory.
      In some parial register write tests, valgrind was reporting an invalid
      memory read.
      
      This change fixes the invalid memory access problem. Writes are now responsible
      for tracking dependent partial register writes, and notify them in the event of
      instruction issued.
      That means, partial register writes no longer need to query their associated
      full write to check when they are ready to execute.
      
      Added test X86/BtVer2/partial-reg-update-7.s
      
      llvm-svn: 347459
      1cb8a3c6
    • Max Kazantsev's avatar
      [NFC] Assert that all blocks staying in loop are live · b565e609
      Max Kazantsev authored
      llvm-svn: 347458
      b565e609
    • Max Kazantsev's avatar
      [NFC] Ensure deterministic order of dead exit blocks · 56a24430
      Max Kazantsev authored
      llvm-svn: 347457
      56a24430
    • John Brawn's avatar
      [AArch64] Fix SelectionDAG infinite loop for v1i64 SCALAR_TO_VECTOR · d6e0ebea
      John Brawn authored
      A consequence of r347274 is that SCALAR_TO_VECTOR can be converted into
      BUILD_VECTOR by SimplifyDemandedBits, but LowerBUILD_VECTOR can turn
      BUILD_VECTOR into SCALAR_TO_VECTOR so we get an infinite loop.
      
      Fix this by making LowerBUILD_VECTOR not do this transformation for those
      vectors that would get transformed back, i.e. BUILD_VECTOR of a single-element
      constant vector. Doing that means we get a DUP, which we then need to recognise
      in ISel as a copy.
      
      llvm-svn: 347456
      d6e0ebea
    • George Rimar's avatar
      [ELF] - Make SymbolTable::addDefined return Defined. · 94a16cb6
      George Rimar authored
      Now it returns Symbol. This should be NFC that
      avoids doing cast at the caller's sides.
      
      Differential revision: https://reviews.llvm.org/D54627
      
      llvm-svn: 347455
      94a16cb6
    • Max Kazantsev's avatar
      [NFC] Simplify code by using standard exit blocks collection · d9f59f8c
      Max Kazantsev authored
      llvm-svn: 347454
      d9f59f8c
    • Clement Courbet's avatar
      [ASTMatchers] Re-generate ast matchers doc after rL346455. · 314cfb53
      Clement Courbet authored
      llvm-svn: 347453
      314cfb53
    • Chandler Carruth's avatar
      [TI removal] Leverage the fact that TerminatorInst is gone to create · e429c794
      Chandler Carruth authored
      a normal base class that provides all common "call" functionality.
      
      This merges two complex CRTP mixins for the common "call" logic and
      common operand bundle logic into a single, normal base class of
      `CallInst` and `InvokeInst`. Going forward, users can typically
      `dyn_cast<CallBase>` and use the resulting API. No more need for the
      `CallSite` wrapper. I'm planning to migrate current usage of the wrapper
      to directly use the base class and then it can be removed, but those are
      simpler and much more incremental steps. The big change is to introduce
      this abstraction into the type system.
      
      I've tried to do some basic simplifications of the APIs that I couldn't
      really help but touch as part of this:
      - I've tried to organize the attribute API and bundle API into groups to
        make understanding the API of `CallBase` easier. Without this,
        I wasn't able to navigate the API sanely for all of the ways I needed
        to modify it.
      - I've added what seem like more clear and consistent APIs for getting
        at the called operand. These ended up being especially useful to
        consolidate the *numerous* duplicated code paths trying to do this.
      - I've largely reworked the organization and implementation of the APIs
        for computing the argument operands as they needed to change to work
        with the new subclass approach.
      
      To minimize any cost associated with this abstraction, I've moved the
      operand layout in memory to store the called operand last. This makes
      its position relative to the end of the operand array the same,
      regardless of the subclass. It should make it much cheaper to reference
      from the `CallBase` abstraction, and this is likely one of the most
      frequent things to query.
      
      We do still pay one abstraction penalty here: we have to branch to
      determine whether there are 0 or 2 extra operands when computing the end
      of the argument operand sequence. However, that seems both rare and
      should optimize well. I've implemented this in a way specifically
      designed to allow it to optimize fairly well. If this shows up in
      profiles, we can add overrides of the relevant methods to the subclasses
      that bypass this penalty. It seems very unlikely that this will be an
      issue as the code was *already* dealing with an ever present abstraction
      of whether or not there are operand bundles, so this isn't the first
      branch to go into the computation.
      
      I've tried to remove as much of the obvious vestigial API surface of the
      old CRTP implementation as I could, but I suspect there is further
      cleanup that should now be possible, especially around the operand
      bundle APIs. I'm leaving all of that for future work in this patch as
      enough things are changing here as-is.
      
      One thing that made this harder for me to reason about and debug was the
      pervasive use of unsigned values in subtraction and other arithmetic
      computations. I had to debug more than one unintentional wrap. I've
      switched a few of these to use `int` which seems substantially simpler,
      but I've held back from doing this more broadly to avoid creating
      confusing divergence within a single class's API.
      
      I also worked to remove all of the magic numbers used to index into
      operands, putting them behind named constants or putting them into
      a single method with a comment and strictly using the method elsewhere.
      This was necessary to be able to re-layout the operands as discussed
      above.
      
      Thanks to Ben for reviewing this (somewhat large and awkward) patch!
      
      Differential Revision: https://reviews.llvm.org/D54788
      
      llvm-svn: 347452
      e429c794
    • David Carlier's avatar
      Unbreak FreeBSD build. · 0a01f5d2
      David Carlier authored
      M    lib/sanitizer_common/sanitizer_platform_limits_posix.cc
      
      llvm-svn: 347451
      0a01f5d2
    • Sam McCall's avatar
      [clangd] Respect task cancellation in TUScheduler. · a2b048bc
      Sam McCall authored
      Summary:
      - Reads are never executed if canceled before ready-to run.
        In practice, we finalize cancelled reads eagerly and out-of-order.
      - Cancelled reads don't prevent prior updates from being elided, as they don't
        actually depend on the result of the update.
      - Updates are downgraded from WantDiagnostics::Yes to WantDiagnostics::Auto when
        cancelled, which allows them to be elided when all dependent reads are
        cancelled and there are subsequent writes. (e.g. when the queue is backed up
        with cancelled requests).
      
      The queue operations aren't optimal (we scan the whole queue for cancelled
      tasks every time the scheduler runs, and check cancellation twice in the end).
      However I believe these costs are still trivial in practice (compared to any
      AST operation) and the logic can be cleanly separated from the rest of the
      scheduler.
      
      Reviewers: ilya-biryukov
      
      Subscribers: javed.absar, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D54746
      
      llvm-svn: 347450
      a2b048bc
    • Haojian Wu's avatar
      Move the llvm lit test dependencies to clang-tools-extra. · af5b1603
      Haojian Wu authored
      Summary: Part of revert r343473
      
      Reviewers: mgorny
      
      Subscribers: cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D54798
      
      llvm-svn: 347449
      af5b1603
    • Haojian Wu's avatar
      Revert r343473 "Move llvm util dependencies from clang-tools-extra to add_lit_target." · 36f48c55
      Haojian Wu authored
      Summary:
      It will cause test tools `FileCheck`, `count`, `not` being built blindly, these
      dependencies should move back to clang-tools-extra.
      
      Reviewers: mgorny
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D54797
      
      llvm-svn: 347448
      36f48c55
    • Diana Picus's avatar
      [ARM GlobalISel] Add test for BFC. NFCI · 6b376557
      Diana Picus authored
      r334871 has made it possible for TableGen'erated code to select BFC, but
      it has not added a test for it on the ARM side. Add it now to make sure
      we don't introduce regressions if we ever change anything about that
      rule.
      
      llvm-svn: 347447
      6b376557