1. Feb 20, 2020
    • Thomas Lively's avatar
      [WebAssembly] Fix memory bug introduced in 52861809 · 16aabc86
      Thomas Lively authored
      Summary:
      The instruction at `DefI` can sometimes be destroyed by
      `rematerializeCheapDef`, so it should not be used after calling that
      function. The fix is to use `Insert` instead when examining additional
      multivalue stackifications. `Insert` is the address of the new
      defining instruction after all moves and rematerializations have taken
      place.
      
      Reviewers: aheejin
      
      Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D74875
      16aabc86
    • Alexander Lanin's avatar
      [clang-tidy] fix readability-redundant-member-init auto-fix of Function-try-block · 709fd989
      Alexander Lanin authored
      Summary: This fixes https://bugs.llvm.org/show_bug.cgi?id=39310
      
      Reviewers: malcolm.parsons, ioeric
      
      Reviewed By: malcolm.parsons
      
      Subscribers: xazax.hun
      
      Tags: #clang-format, #clang-tools-extra
      
      Differential Revision: https://reviews.llvm.org/D74800
      709fd989
    • LLVM GN Syncbot's avatar
      [gn build] Port 85fb9976 · 38419b8a
      LLVM GN Syncbot authored
      38419b8a
    • Lang Hames's avatar
    • Matt Arsenault's avatar
      AMDGPU: Enable integer division bypass · 4bb0c8f9
      Matt Arsenault authored
      We probably want this, and I've meant to turn this on for a long
      time. SC actually emits a special case to early-out for a 1
      denominator, which perhaps should also be considered.
      4bb0c8f9
    • Yaxun (Sam) Liu's avatar
      ed07c89f
    • Matt Arsenault's avatar
      cbc3b304
    • Matt Arsenault's avatar
      AMDGPU/GlobalISel: Cleanup min/max RegBankSelect tests · 0b6ead01
      Matt Arsenault authored
      Use common check prefix, although update_mir_test_checks makes this
      unnecessarily annoying. Also make sure to have uses in case that ever
      ends up mattering.
      0b6ead01
    • Lang Hames's avatar
      [ORC] Fix a missing move. · 63d0932c
      Lang Hames authored
      63d0932c
    • Lang Hames's avatar
      [ORC] Qualify nullptr_t. · 9df65ca1
      Lang Hames authored
      9df65ca1
    • David Goldman's avatar
      Another fix for 7d91633a · 4960eb4a
      David Goldman authored
      Forgot to update lines for RUNs
      4960eb4a
    • Martijn Vels's avatar
      Add benchmarks for basic_string::erase · c4b8c3dd
      Martijn Vels authored
      Reviewers: EricWF
      
      Subscribers: christof, libcxx-commits
      
      Tags: #libc
      
      Differential Revision: https://reviews.llvm.org/D73740
      c4b8c3dd
    • Cristian Adam's avatar
      libclang: Add static build support for Windows · 7ff1f55a
      Cristian Adam authored
      Differential Revision: https://reviews.llvm.org/D74564
      7ff1f55a
    • Lang Hames's avatar
      [ORC] Add generic initializer/deinitializer support. · 85fb9976
      Lang Hames authored
      Initializers and deinitializers are used to implement C++ static constructors
      and destructors, runtime registration for some languages (e.g. with the
      Objective-C runtime for Objective-C/C++ code) and other tasks that would
      typically be performed when a shared-object/dylib is loaded or unloaded by a
      statically compiled program.
      
      MCJIT and ORC have historically provided limited support for discovering and
      running initializers/deinitializers by scanning the llvm.global_ctors and
      llvm.global_dtors variables and recording the functions to be run. This approach
      suffers from several drawbacks: (1) It only works for IR inputs, not for object
      files (including cached JIT'd objects). (2) It only works for initializers
      described by llvm.global_ctors and llvm.global_dtors, however not all
      initializers are described in this way (Objective-C, for example, describes
      initializers via specially named metadata sections). (3) To make the
      initializer/deinitializer functions described by llvm.global_ctors and
      llvm.global_dtors searchable they must be promoted to extern linkage, polluting
      the JIT symbol table (extra care must be taken to ensure this promotion does
      not result in symbol name clashes).
      
      This patch introduces several interdependent changes to ORCv2 to support the
      construction of new initialization schemes, and includes an implementation of a
      backwards-compatible llvm.global_ctor/llvm.global_dtor scanning scheme, and a
      MachO specific scheme that handles Objective-C runtime registration (if the
      Objective-C runtime is available) enabling execution of LLVM IR compiled from
      Objective-C and Swift.
      
      The major changes included in this patch are:
      
      (1) The MaterializationUnit and MaterializationResponsibility classes are
      extended to describe an optional "initializer" symbol for the module (see the
      getInitializerSymbol method on each class). The presence or absence of this
      symbol indicates whether the module contains any initializers or
      deinitializers. The initializer symbol otherwise behaves like any other:
      searching for it triggers materialization.
      
      (2) A new Platform interface is introduced in llvm/ExecutionEngine/Orc/Core.h
      which provides the following callback interface:
      
        - Error setupJITDylib(JITDylib &JD): Can be used to install standard symbols
          in JITDylibs upon creation. E.g. __dso_handle.
      
        - Error notifyAdding(JITDylib &JD, const MaterializationUnit &MU): Generally
          used to record initializer symbols.
      
        - Error notifyRemoving(JITDylib &JD, VModuleKey K): Used to notify a platform
          that a module is being removed.
      
        Platform implementations can use these callbacks to track outstanding
      initializers and implement a platform-specific approach for executing them. For
      example, the MachOPlatform installs a plugin in the JIT linker to scan for both
      __mod_inits sections (for C++ static constructors) and ObjC metadata sections.
      If discovered, these are processed in the usual platform order: Objective-C
      registration is carried out first, then static initializers are executed,
      ensuring that calls to Objective-C from static initializers will be safe.
      
      This patch updates LLJIT to use the new scheme for initialization. Two
      LLJIT::PlatformSupport classes are implemented: A GenericIR platform and a MachO
      platform. The GenericIR platform implements a modified version of the previous
      llvm.global-ctor scraping scheme to provide support for Windows and
      Linux. LLJIT's MachO platform uses the MachOPlatform class to provide MachO
      specific initialization as described above.
      
      Reviewers: sgraenitz, dblaikie
      
      Subscribers: mgorny, hiraditya, mgrang, ributzka, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D74300
      85fb9976
    • David Goldman's avatar
      7d91633a
    • Rafael Ávila de Espíndola's avatar
      [lld][ELF] Add --shuffle-sections=seed to shuffle input sections · d48d3391
      Rafael Ávila de Espíndola authored
      Summary:
      This option causes lld to shuffle sections by assigning different
      priorities in each run.
      
      The use case for this is to introduce randomization in benchmarks. The
      idea is inspired by the paper "Producing Wrong Data Without Doing
      Anything Obviously Wrong!"
      (https://www.inf.usi.ch/faculty/hauswirth/publications/asplos09.pdf). Unlike
      the paper, we shuffle individual sections, not just input files.
      
      Doing this in lld is particularly convenient as the --reproduce option
      makes it easy to collect all the necessary bits for relinking the
      program being benchmarked. Once that it is done, all that is needed is
      to add --shuffle-sections=0 to the response file and relink before each
      run of the benchmark.
      
      Differential Revision: https://reviews.llvm.org/D74791
      d48d3391
    • Stanislav Mekhanoshin's avatar
      [AMDGPU] Fix DS_WRITE_B32 patterns · 03954a12
      Stanislav Mekhanoshin authored
      It uses VGPR_32.RegTypes which includes 16 bit types. As a
      result DS_WRITE_B32 may be generated for "store i16" which
      is a bug. The only reason we do not hit it now is relative
      patterns complexity and sorting. Should DS_WRITE_B16 pattern
      complexity become higher and the bug appears.
      
      Differential Revision: https://reviews.llvm.org/D74868
      03954a12
    • Dan Liew's avatar
      [TSan] Fix incorrect expansion of `%deflake` lit substitution. · ddd2257f
      Dan Liew authored
      dadc214e introduced a change to
      `%deflake` to support a configurable threshold but the patch forgot
      to add a trailing space.
      ddd2257f
    • Louis Dionne's avatar
      [libc++] reduce <complex> parsing time · c3478eff
      Louis Dionne authored
      Instead of including <ios> for ios_base::failbit, simply get failbit
      member of the template argument. Print directly to a stream instead
      of using intermediate ostringstream.
      
          Parsing time: 874ms -> 164ms (-81%)
      
      Thanks to Nikita Kniazev for the patch!
      
      Differential Revision: https://reviews.llvm.org/D71214
      c3478eff
    • Louis Dionne's avatar
      [libc++] Fixes backreferences for extended grammar. · 6ba2d7b1
      Louis Dionne authored
      The regex backreferences were not properly parsed and used when using
      the extended grammar. This change parses them. The issue was found while
      working on PR34297.
      
      Thanks to Mark de Wever for the patch!
      
      Differential Revision: https://reviews.llvm.org/D62451
      6ba2d7b1
    • Tony's avatar
      [AMDGPU] AMDGPUUsage define call convention ABI · 788e74ce
      Tony authored
      Reviewers: scott.linder, arsenm, b-sumner
      
      Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, kerbowa, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D74861
      788e74ce
    • Michael Kruse's avatar
      [IndVarSimply] Fix assert/release build difference. · e4d20ec8
      Michael Kruse authored
      In builds with assertions enabled (!NDEBUG), IndVarSimplify does an
      additional query to ScalarEvolution which may change future SCEV queries
      since it fills the internal cache differently. The result is actually
      only used with the -verify-indvars command line option. We fix the issue
      by only calling SE->getBackedgeTakenCount(L) if -verify-indvars is
      enabled such that only -verify-indvars shows the behavior, but not debug
      builds themselves. Also add a remark to the description of
      -verify-indvars about this behavior.
      
      Fixes llvm.org/PR44815
      
      Differential Revision: https://reviews.llvm.org/D74810
      e4d20ec8
    • Tony's avatar
      [AMDGPU] Update AMDGPUUsage with DWARF proposal · f5678d4a
      Tony authored
      Summary:
      - Add AMDGPU DWARF proposal.
      - Add references for gfx10 ISA and SemVer.
      
      Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, aprantl, dstuttard, tpr, jfb, dmgreen, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D70523
      f5678d4a
    • Sanjay Patel's avatar
    • Krzysztof Parzyszek's avatar
      [Hexagon] Change HVX vector predicate types from v512/1024i1 to v64/128i1 · b1d47467
      Krzysztof Parzyszek authored
      This commit removes the artificial types <512 x i1> and <1024 x i1>
      from HVX intrinsics, and makes v512i1 and v1024i1 no longer legal on
      Hexagon.
      
      It may cause existing bitcode files to become invalid.
      
      * Converting between vector predicates and vector registers must be
        done explicitly via vandvrt/vandqrt instructions (their intrinsics),
        i.e. (for 64-byte mode):
          %Q = call <64 x i1> @llvm.hexagon.V6.vandvrt(<16 x i32> %V, i32 -1)
          %V = call <16 x i32> @llvm.hexagon.V6.vandqrt(<64 x i1> %Q, i32 -1)
      
        The conversion intrinsics are:
          declare  <64 x i1> @llvm.hexagon.V6.vandvrt(<16 x i32>, i32)
          declare <128 x i1> @llvm.hexagon.V6.vandvrt.128B(<32 x i32>, i32)
          declare <16 x i32> @llvm.hexagon.V6.vandqrt(<64 x i1>, i32)
          declare <32 x i32> @llvm.hexagon.V6.vandqrt.128B(<128 x i1>, i32)
        They are all pure.
      
      * Vector predicate values cannot be loaded/stored directly. This directly
        reflects the architecture restriction. Loading and storing or vector
        predicates must be done indirectly via vector registers and explicit
        conversions via vandvrt/vandqrt instructions.
      b1d47467
    • Fady Ghanim's avatar
      [OpenMP][OMPIRBuilder] Introducing the `OMPBuilderCBHelpers` helper class · ba3f863d
      Fady Ghanim authored
      This patch introduces a new helper class `OMPBuilderCBHelpers`,
      which will contain all reusable C/C++ language specific function-
      alities required by the `OMPIRBuilder`.
      
      Initially, this helper class contains the body and finalization
      codegen functionalities implemented using callbacks which were
      moved here for reusability among the different directives
      implemented in the `OMPIRBuilder`, along with RAIIs for preserving
      state prior to emitting outlined and/or inlined OpenMP regions.
      
      In the future this helper class will also contain all the different
      call backs required by OpenMP clauses/variable privatization.
      
      Reviewed By: jdoerfert
      
      Differential Revision: https://reviews.llvm.org/D74562
      ba3f863d
    • Nikita Popov's avatar
      Reapply [IRBuilder] Always respect inserter/folder · f6875c43
      Nikita Popov authored
      Some IRBuilder methods that were originally defined on
      IRBuilderBase do not respect custom IRBuilder inserters/folders,
      because those were not accessible prior to D73835. Fix this by
      making use of existing (and now accessible) IRBuilder methods,
      which will handle inserters/folders correctly.
      
      There are some changes in OpenMP and Instrumentation tests, where
      bitcasts now get constant folded. I've also highlighted one
      InstCombine test which now finishes in two rather than three
      iterations, thanks to new instructions being inserted into the
      worklist.
      
      Differential Revision: https://reviews.llvm.org/D74787
      f6875c43
    • aartbik's avatar
      [mlir] [VectorOps] Framework for progressive lowering of vector.contract · 0ba9ee9f
      aartbik authored
      Summary:
      Lowers all free/batch dimensions in a vector.contract progressively
      into simpler vector.contract operations until a direct vector.reduction
      operation is reached. Then lowers 1-D reductions into vector.reduce.
      
      Still TBD:
      multi-dimensional contractions that remain after removing all the parallel dims
      
      Reviewers: nicolasvasilache, andydavis1, rriddle
      
      Reviewed By: andydavis1
      
      Subscribers: mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, liufengdb, Joonsoo, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D74797
      0ba9ee9f
    • Bill Wendling's avatar
      Include static prof data when collecting loop BBs · 129c911e
      Bill Wendling authored
      Summary:
      If the programmer adds static profile data to a branch---i.e. uses
      "__builtin_expect()" or similar---then we should honor it. Otherwise,
      "__builtin_expect()" is ignored in crucial situations. So we trust that
      the programmer knows what they're doing until proven wrong.
      
      Subscribers: hiraditya, JDevlieghere, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D74809
      129c911e
    • Max Moroz's avatar
      [libFuzzer] Fix denominator in the "inputs have DFT" log line. · 07647571
      Max Moroz authored
      Summary:
      The number of "inputs have the Data Flow Trace" cannot be greater than
      the number of inputs touching the focus function. The existing message is rather
      confusing as the same log would mention a greater total number of traces a few
      lines above.
      
      Reviewers: kcc, metzman
      
      Subscribers: #sanitizers, llvm-commits
      
      Tags: #sanitizers, #llvm
      
      Differential Revision: https://reviews.llvm.org/D74779
      07647571
    • Simon Pilgrim's avatar
      025ff5a4
    • Simon Pilgrim's avatar
      [UpdateTestChecks] Add support for '.' in ir function names · 59982a6d
      Simon Pilgrim authored
      Will let us regenerate from amdgpu float constant tests
      59982a6d
    • Louis Dionne's avatar
      [CMake] Only detect the linker once in AddLLVM.cmake · 84f80b1f
      Louis Dionne authored
      Summary:
      Otherwise, the build output contains a bunch of "Linker detection: <xxx>"
      lines that are really redundant. We also make redundant calls to the
      linker, although that is a smaller concern.
      
      Reviewers: smeenai
      
      Subscribers: mgorny, fedor.sergeev, jkorous, dexonsmith, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D68648
      84f80b1f
    • Diego Caballero's avatar
      [mlir][NFC] Fix 'gatherLoops' utility · 376c6853
      Diego Caballero authored
      It replaces DenseMap output with a SmallVector and it
      removes empty loop levels from the output.
      
      Reviewed By: andydavis1, mehdi_amini
      
      Differential Revision: https://reviews.llvm.org/D74658
      376c6853
    • Bardia Mahjour's avatar
      [DDG] Data Dependence Graph - Graph Simplification · 0a2626d0
      Bardia Mahjour authored
      Summary:
      This is the last functional patch affecting the representation of DDG.
      Here we try to simplify the DDG to reduce the number of nodes and edges by
      iteratively merging pairs of nodes that satisfy the following conditions,
      until no such pair can be identified. A pair of nodes consisting of a and b
      can be merged if:
      
          1. the only edge from a is a def-use edge to b and
          2. the only edge to b is a def-use edge from a and
          3. there is no cyclic edge from b to a and
          4. all instructions in a and b belong to the same basic block and
          5. both a and b are simple (single or multi instruction) nodes.
      
      These criteria allow us to fold many uninteresting def-use edges that
      commonly exist in the graph while avoiding the risk of introducing
      dependencies that didn't exist before.
      
      Authored By: bmahjour
      
      Reviewer: Meinersbur, fhahn, myhsu, xtian, dmgreen, kbarton, jdoerfert
      
      Reviewed By: Meinersbur
      
      Subscribers: ychen, arphaman, simoll, a.elovikov, mgorny, hiraditya, jfb, wuzish, llvm-commits, jsji, Whitney, etiotto, ppc-slack
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D72350
      0a2626d0
    • River Riddle's avatar
      fd0e8b4c
    • Florian Hahn's avatar
      Revert "[PatternMatch] Match XOR variant of unsigned-add overflow check." · c7fc0e5d
      Florian Hahn authored
      This reverts commit e01a3d49.
      and commit a6a585b8.
      
      This causes a failure on GreenDragon:
      http://lab.llvm.org:8080/green/view/LLDB/job/lldb-cmake/9597
      c7fc0e5d
    • River Riddle's avatar
      [mlir][Parser] Use APFloat instead of FloatAttr when parsing DenseElementsAttrs. · 4a7364f1
      River Riddle authored
      Summary: DenseElementsAttr stores float values as raw bits internally, so creating attributes just to have them unwrapped is extremely inefficient.
      
      Differential Revision: https://reviews.llvm.org/D74818
      4a7364f1
    • River Riddle's avatar
      [mlir][ODS] Add a new trait `TypesMatchWith` · 6b6c9669
      River Riddle authored
      Summary:
      This trait takes three arguments: lhs, rhs, transformer. It verifies that the type of 'rhs' matches the type of 'lhs' when the given 'transformer' is applied to 'lhs'. This allows for adding constraints like: "the type of 'a' must match the element type of 'b'". A followup revision will add support in the declarative parser for using these equality constraints to port more c++ parsers to the declarative form.
      
      Differential Revision: https://reviews.llvm.org/D74647
      6b6c9669
    • Jonas Devlieghere's avatar
      [lldb/Core] Remove locking in the PluginManager · df590f51
      Jonas Devlieghere authored
      Remove locking as all the plugin registration takes place from a single
      thread. Addresses Pavel's feedback in D74816.
      df590f51