1. Mar 28, 2019
    • Sam McCall's avatar
      [clangd] Update error message to fix tests after r357173 · 16cb94b6
      Sam McCall authored
      llvm-svn: 357175
      16cb94b6
    • Michael Platings's avatar
      [Documentation] Proposal to change variable names · 7aecb64c
      Michael Platings authored
      Differential Revision: https://reviews.llvm.org/D59251
      
      llvm-svn: 357174
      7aecb64c
    • Sam McCall's avatar
      [clangd] Support UTF-32 (i.e. codepoint) offsets. · 8b25d228
      Sam McCall authored
      Summary:
      (Changes to UTF-8/UTF-16 here are NFC, moving things around to make the
      cases more symmetrical)
      
      Reviewers: ilya-biryukov
      
      Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D59927
      
      llvm-svn: 357173
      8b25d228
    • Sanjay Patel's avatar
      [x86] avoid cmov in movmsk reduction · 5bbf6f0b
      Sanjay Patel authored
      This is probably the least important of our movmsk problems, but I'm starting
      at the bottom to reduce distractions.
      
      We were creating a select_cc which bypasses the select and bitmask codegen
      optimizations that we have now. If we produce a compare+negate instead, we
      allow things like neg/sbb carry bit hacks, and in all cases we avoid a cmov.
      There's no partial register update danger in these sequences because we always
      produce the zero-register xor ahead of the 'set' if needed.
      
      There seems to be a missing fold for sext of a bool bit here:
      
      negl %ecx
      movslq %ecx, %rax
      
      ...but that's an independent transform.
      
      Differential Revision: https://reviews.llvm.org/D59818
      
      llvm-svn: 357172
      5bbf6f0b
    • Clement Courbet's avatar
      [X86MacroFusion] Handle branch fusion (AMD CPUs). · 699dc025
      Clement Courbet authored
      Summary:
      This adds a BranchFusion feature to replace the usage of the MacroFusion
      for AMD CPUs.
      
      See D59688 for context.
      
      Reviewers: andreadb, lebedev.ri
      
      Subscribers: hiraditya, jdoerfert, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D59872
      
      llvm-svn: 357171
      699dc025
    • Matt Arsenault's avatar
      AMDGPU: Make exec mask optimzations more resistant to block splits · a353fd57
      Matt Arsenault authored
      Also improve the check for SALU instructions to also ignore
      implicit_def and other fake instructions.
      
      llvm-svn: 357170
      a353fd57
    • Roman Lebedev's avatar
      [X86] AMD Piledriver (BdVer2): fine-tune some latencies · c325be6c
      Roman Lebedev authored
      Based on llvm-exegesis measurements.
      
      Now that llvm-exegesis is ~2 magnitudes faster, and is a bit smarter,
      it is now possible to continue cleanup of the scheduler model.
      
      With this, there are no more latency inconsistencies for the
      opcodes that produce stable measurements, and only a few inconsistencies
      for unstable measurements (MMX_* opcodes, opcodes that llvm-exegesis
      measures by chaining - CMP, TEST, BT, SETcc, CVT, MOV, etc.)
      
      llvm-svn: 357169
      c325be6c
    • Clement Courbet's avatar
      [NFC] Format InlineFeatureIgnoreList. · 54c95e51
      Clement Courbet authored
      To avoid more spurious clang-format changes when adding features (D59872).
      
      llvm-svn: 357168
      54c95e51
    • Adam Balogh's avatar
      [Analyzer] Constraint Manager - Calculate Effective Range for Differences · a19c985f
      Adam Balogh authored
      Since rL335814, if the constraint manager cannot find a range set for `A - B`
      (where `A` and `B` are symbols) it looks for a range for `B - A` and returns
      it negated if it exists. However, if a range set for both `A - B` and `B - A`
      is stored then it only returns the first one. If we both use `A - B` and
      `B - A`, these expressions behave as two totally unrelated symbols. This way
      we miss some useful deductions which may lead to false negatives or false
      positives.
      
      This tiny patch changes this behavior: if the symbolic expression the
      constraint manager is looking for is a difference `A - B`, it tries to
      retrieve the range for both `A - B` and `B - A` and if both exists it returns
      the intersection of range `A - B` and the negated range of `B - A`. This way
      every time a checker applies new constraints to the symbolic difference or to
      its negated it always affects both the original difference and its negated.
      
      Differential Revision: https://reviews.llvm.org/D55007
      
      llvm-svn: 357167
      a19c985f
    • Xing GUO's avatar
      - Addressed comments · 12632c76
      Xing GUO authored
      llvm-svn: 357166
      12632c76
    • Xing GUO's avatar
      - Addressed @jhenderson 's comments · 7ffd9112
      Xing GUO authored
      - Format patch
      
      llvm-svn: 357165
      7ffd9112
    • Xing GUO's avatar
      [llvm-readobj] Add new helper function `getSymbolVersionByIndex()` · 137315e7
      Xing GUO authored
      Summary: When implementing `GNU style` dumper for `.gnu.version` section, we should find symbol version name by `vs_index`.
      
      Reviewers: jhenderson, rupprecht
      
      Reviewed By: rupprecht
      
      Subscribers: arphaman, rupprecht, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D59545
      
      llvm-svn: 357164
      137315e7
    • Simon Pilgrim's avatar
      Fix Wdocumentation warning. NFCI. · 288c2d98
      Simon Pilgrim authored
      llvm-svn: 357163
      288c2d98
    • Anastasia Stulova's avatar
      [PR41247] Fixed parsing of private keyword in C++. · 314fab6d
      Anastasia Stulova authored
      Fixed bug in C++ to prevent parsing 'private' as a
      valid address space qualifier.
      
      Differential Revision: https://reviews.llvm.org/D59874
      
      llvm-svn: 357162
      314fab6d
    • Simon Pilgrim's avatar
      [DAGCombiner] Fold truncate(build_vector(x,y)) -> build_vector(truncate(x),truncate(y)) · 38a0616c
      Simon Pilgrim authored
      If scalar truncates are free, attempt to pre-truncate build_vectors source operands.
      
      Only attempt to do this before legalization as we often end up with truncations/extensions during build_vector lowering.
      
      Differential Revision: https://reviews.llvm.org/D59654
      
      llvm-svn: 357161
      38a0616c
    • Peter Smith's avatar
      [ELF][ARM] Recommit Redesign of .ARM.exidx handling to use a SyntheticSection · 3ce9af93
      Peter Smith authored
      Recommit r356666 with fixes for buildbot failure, as well as handling for
      --emit-relocs, which we decide not to emit any relocation sections as the
      table is already position independent and an offline tool can deduce the
      relocations.
      
      Instead of creating extra Synthetic .ARM.exidx sections to account for
      gaps in the table, create a single .ARM.exidx SyntheticSection that can
      derive the contents of the gaps from a sorted list of the executable
      InputSections. This has the benefit of moving the ARM specific code for
      SyntheticSections in SHF_LINK_ORDER processing and the table merging code
      into the ARM specific SyntheticSection. This also makes it easier to create
      EXIDX_CANTUNWIND table entries for executable InputSections that don't
      have an associated .ARM.exidx section.
      
      Fixes pr40277
      
      Differential Revision: https://reviews.llvm.org/D59216
      
      llvm-svn: 357160
      3ce9af93
    • Diana Picus's avatar
      [ARM GlobalISel] Run regbankselect test for Thumb. NFCI · 13ef0c53
      Diana Picus authored
      This should just work, since ARM mode and Thumb2 mode are at the same
      level of support now and should map the same to GPR and FPR.
      
      llvm-svn: 357159
      13ef0c53
    • George Rimar's avatar
      [yaml2obj][obj2yaml] - Teach yaml2obj/obj2yaml tools about STB_GNU_UNIQUE symbols. · 41112995
      George Rimar authored
      yaml2obj/obj2yaml does not support the symbols with STB_GNU_UNIQUE yet.
      Currently, obj2yaml fails with llvm_unreachable when met such a symbol.
      
      I faced it when investigated the https://bugs.llvm.org/show_bug.cgi?id=41196.
      
      Differential revision: https://reviews.llvm.org/D59875
      
      llvm-svn: 357158
      41112995
    • Pierre Gousseau's avatar
      [asan] Add options -asan-detect-invalid-pointer-cmp and -asan-detect-invalid-pointer-sub options. · a833c2bd
      Pierre Gousseau authored
      This is in preparation to a driver patch to add gcc 8's -fsanitize=pointer-compare and -fsanitize=pointer-subtract.
      Disabled by default as this is still an experimental feature.
      
      Reviewed By: morehouse, vitalybuka
      
      Differential Revision: https://reviews.llvm.org/D59220
      
      llvm-svn: 357157
      a833c2bd
    • Florian Hahn's avatar
      [VPlan] Determine Vector Width programmatically. · e21ed594
      Florian Hahn authored
      With this change, the VPlan native path is triggered with the directive:
      
         #pragma clang loop vectorize(enable)
      
      There is no need to specify the vectorize_width(N) clause.
      
      Patch by Francesco Petrogalli <francesco.petrogalli@arm.com>
      
      Differential Revision: https://reviews.llvm.org/D57598
      
      llvm-svn: 357156
      e21ed594
    • Simon Pilgrim's avatar
      [X85][AVX] Add missing vXi16 broadcast fold patterns · 22be913a
      Simon Pilgrim authored
      Now that D59484 has landed its easier to add these.
      
      Added missing AVX512BW v32i16 equivalents while I was at it.
      
      llvm-svn: 357155
      22be913a
    • Diana Picus's avatar
      [ARM GlobalISel] Fix G_STORE with s1 · 52495c47
      Diana Picus authored
      G_STORE for 1-bit values uses a STRBi12, which stores the whole byte.
      Zero out the undefined bits before writing.
      
      llvm-svn: 357154
      52495c47
    • Diana Picus's avatar
      [ARM GlobalISel] Fix selection of G_SELECT · 4d512df3
      Diana Picus authored
      G_SELECT uses a 1-bit scalar for the condition, and is currently
      implemented with a plain CMPri against 0. This means that values such as
      0x1110 are interpreted as true, when instead the higher bits should be
      treated as undefined and therefore ignored. Replace the CMPri with a
      TSTri against 0x1, which performs an implicit AND, yielding the expected
      result.
      
      llvm-svn: 357153
      4d512df3
    • Roman Lebedev's avatar
      [llvm-exegesis] Introduce a 'naive' clustering algorithm (PR40880) · c2423fe6
      Roman Lebedev authored
      Summary:
      This is an alternative to D59539.
      
      Let's suppose we have measured 4 different opcodes, and got: `0.5`, `1.0`, `1.5`, `2.0`.
      Let's suppose we are using `-analysis-clustering-epsilon=0.5`.
      By default now we will start processing the `0.5` point, find that `1.0` is it's neighbor, add them to a new cluster.
      Then we will notice that `1.5` is a neighbor of `1.0` and add it to that same cluster.
      Then we will notice that `2.0` is a neighbor of `1.5` and add it to that same cluster.
      So all these points ended up in the same cluster.
      This may or may not be a correct implementation of dbscan clustering algorithm.
      
      But this is rather horribly broken for the reasons of comparing the clusters with the LLVM sched data.
      Let's suppose all those opcodes are currently in the same sched cluster.
      If i specify `-analysis-inconsistency-epsilon=0.5`, then no matter
      the LLVM values this cluster will **never** match the LLVM values,
      and thus this cluster will **always** be displayed as inconsistent.
      
      The solution is obviously to split off some of these opcodes into different sched cluster.
      But how do i do that? Out of 4 opcodes displayed in the inconsistency report,
      which ones are the "bad ones"? Which ones are the most different from the checked-in data?
      I'd need to go in to the `.yaml` and look it up manually.
      
      The trivial solution is to, when creating clusters, don't use the full dbscan algorithm,
      but instead "pick some unclustered point, pick all unclustered points that are it's neighbor,
      put them all into a new cluster, repeat". And just so as it happens, we can arrive
      at that algorithm by not performing the "add neighbors of a neighbor to the cluster" step.
      
      But that won't work well once we teach analyze mode to operate in on-1D mode
      (i.e. on more than a single measurement type at a time), because the clustering would
      depend on the order of the measurements.
      
      Instead, let's just create a single cluster per opcode, and put all the points of that opcode into said cluster.
      And simultaneously check that every point in that cluster is a neighbor of every other point in the cluster,
      and if they are not, the cluster (==opcode) is unstable.
      
      This is //yet another// step to bring me closer to being able to continue cleanup of bdver2 sched model..
      
      Fixes [[ https://bugs.llvm.org/show_bug.cgi?id=40880 | PR40880 ]].
      
      Reviewers: courbet, gchatelet
      
      Reviewed By: courbet
      
      Subscribers: tschuett, jdoerfert, RKSimon, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D59820
      
      llvm-svn: 357152
      c2423fe6
    • Fangrui Song's avatar
      Fix tests after rC357150 · aff4efff
      Fangrui Song authored
      llvm-svn: 357151
      aff4efff
    • Fangrui Song's avatar
      [Driver] Allow -gsplit-dwarf on ELF OSes other than Linux and Fuchsia · ee957e04
      Fangrui Song authored
      In gcc, -gsplit-dwarf is handled in gcc/gcc.c as a spec
      (ASM_FINAL_SPEC): objcopy --extract-dwo + objcopy --strip-dwo. In
      gcc/opts.c, -gsplit_dwarf has the same semantic of a -g. Except for the
      availability of the external command 'objcopy', nothing precludes the
      feature working on other ELF OSes. llvm doesn't use objcopy, so it doesn't
      have to exclude other OSes.
      
      llvm-svn: 357150
      ee957e04
    • Piotr Sobczak's avatar
      [SelectionDAG] Add 2 tests for selection across basic blocks · f896785c
      Piotr Sobczak authored
      Summary:
      Add tests for selection across basic block boundary:
       * one test containing a buffer load, where part of the offset
         computation is placed in the predecessor of the load
       * similar test, but containing two buffer loads and shared
         computations
      
      Please note that the behaviour being tested will be updated in
      a subsequent commit.
      
      This commit was extracted from https://reviews.llvm.org/D59535.
      
      Reviewers: RKSimon
      
      Reviewed By: RKSimon
      
      Subscribers: jvesely, nhaehnle, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D59690
      
      llvm-svn: 357149
      f896785c
    • Serguei Katkov's avatar
      SafepointIRVerifier port to new Pass Manager · 1311e8e4
      Serguei Katkov authored
      Add missed include.
      
      llvm-svn: 357148
      1311e8e4
    • Serguei Katkov's avatar
      SafepointIRVerifier port to new Pass Manager · 93432be3
      Serguei Katkov authored
      Straightforward port of StatepointIRVerifier pass to new Pass Manager framework.
      
      Reviewers: fedor.sergeev, reames
      Reviewed By: fedor.sergeev
      Subscribers: llvm-commits
      Differential Revision: https://reviews.llvm.org/D59825
      
      llvm-svn: 357147
      93432be3
    • Marshall Clow's avatar
      Reworked all the utilities/meta tests to use ASSERT_SAME_TYPE instead of... · 24fa56bc
      Marshall Clow authored
      Reworked all the utilities/meta tests to use ASSERT_SAME_TYPE instead of 'static_assert( is_same<'. Much easier to read. I left two tests alone: is_same.pass.cpp, which should call 'is_same' directly, and common_type.pass.cpp, which Eric is working on. NFC intended
      
      llvm-svn: 357146
      24fa56bc
    • Sam Clegg's avatar
      [WebAssembly] Rename wasm fixup kinds · a5e175c6
      Sam Clegg authored
      These fixup kinds are not explicitly related to the code section.  They
      are there to signal how to apply the fixup.
      
      Also, a couple of other minor wasm cleanups.
      
      Differential Revision: https://reviews.llvm.org/D59908
      
      llvm-svn: 357145
      a5e175c6
    • Sam Clegg's avatar
      [WebAssembly] Fix typo from rL357143 · a9958fc3
      Sam Clegg authored
      llvm-svn: 357144
      a9958fc3
    • Sam Clegg's avatar
      [WebAssembly] Improve invalid relocation error message · 0805ec5f
      Sam Clegg authored
      This message now matches the equivalent message in the ELF linker.
      
      Differential Revision: https://reviews.llvm.org/D59860
      
      llvm-svn: 357143
      0805ec5f
    • Eric Christopher's avatar
      0a2d0c1f
    • Jim Ingham's avatar
      Copy the breakpoint site owner's collection so we can drop · 1432b978
      Jim Ingham authored
      the collection lock before we iterate over the owners calling ShouldStop.
      
      BreakpointSite::ShouldStop can do a lot of work, and might by chance hit the same breakpoint
      site again on another thread.  So instead of holding the site's owners lock
      while iterating over them calling ShouldStop, I make a local copy of the list, drop the lock 
      and then iterate over the copy calling BreakpointLocation::ShouldStop.
      
      It's actually quite difficult to make this cause problems because usually all the
      action happens on the private state thread, and the lock is recursive.
      
      I have a report where some code hit the ASAN error breakpoint, went to 
      compile the ASAN error gathering expression, in the course of compiling
      that we went to fetch the ObjC runtime data, but the state of the program
      was such that the ObjC runtime grubbing function triggered an ASAN error and 
      we were executing that function on another thread.  
      
      I couldn't figure out a way to reproduce that situation in a test.  But this is an 
      NFC change anyway, it just makes the locking strategy more narrowly focused.
      
      <rdar://problem/49074093>
      
      llvm-svn: 357141
      1432b978
    • Rui Ueyama's avatar
      Inline a trivial function. NFC. · a0a50a7a
      Rui Ueyama authored
      I found that hiding this particular actual expression doesn't help
      readers understand the code. So I remove and inline that function.
      
      llvm-svn: 357140
      a0a50a7a
    • Louis Dionne's avatar
      [libc++] Rename span's as_writeable_bytes to as_writable_bytes · 7cd0dad8
      Louis Dionne authored
      Summary: The Standard says as_writable_bytes.
      
      Reviewers: mclow.lists, EricWF
      
      Subscribers: christof, jkorous, dexonsmith, libcxx-commits
      
      Differential Revision: https://reviews.llvm.org/D59882
      
      llvm-svn: 357139
      7cd0dad8
    • Eric Christopher's avatar
      Fix typoed variable name. · 1857edb2
      Eric Christopher authored
      NFCI.
      
      llvm-svn: 357138
      1857edb2
    • Chandler Carruth's avatar
      [NewPM] Fix a nasty bug with analysis invalidation in the new PM. · 923ff550
      Chandler Carruth authored
      The issue here is that we actually allow CGSCC passes to mutate IR (and
      therefore invalidate analyses) outside of the current SCC. At a minimum,
      we need to support mutating parent and ancestor SCCs to support the
      ArgumentPromotion pass which rewrites all calls to a function.
      
      However, the analysis invalidation infrastructure is heavily based
      around not needing to invalidate the same IR-unit at multiple levels.
      With Loop passes for example, they don't invalidate other Loops. So we
      need to customize how we handle CGSCC invalidation. Doing this without
      gratuitously re-running analyses is even harder. I've avoided most of
      these by using an out-of-band preserved set to accumulate the cross-SCC
      invalidation, but it still isn't perfect in the case of re-visiting the
      same SCC repeatedly *but* it coming off the worklist. Unclear how
      important this use case really is, but I wanted to call it out.
      
      Another wrinkle is that in order for this to successfully propagate to
      function analyses, we have to make sure we have a proxy from the SCC to
      the Function level. That requires pre-creating the necessary proxy.
      
      The motivating test case now works cleanly and is added for
      ArgumentPromotion.
      
      Thanks for the review from Philip and Wei!
      
      Differential Revision: https://reviews.llvm.org/D59869
      
      llvm-svn: 357137
      923ff550
    • Davide Italiano's avatar
      8ff45859