1. Mar 12, 2020
    • Florian Hahn's avatar
      [Matrix] Add remark propagation along the inlined-at chain. · bc6c8c4b
      Florian Hahn authored
      This patch adds support for propagating matrix expressions along the
      inlined-at chain and emitting remarks at the traversed function scopes.
      
      To motivate this new behavior, consider the example below. Without the
      remark 'up-leveling', we would only get remarks in load.h and store.h,
      but we cannot generate a remark describing the full expression in
      toplevel.cpp, which is the place where the user has the best chance of
      spotting/fixing potential problems.
      
      With this patch, we generate a remark for the load in load.h, one for
      the store in store.h and one for the complete expression in
      toplevel.cpp. For a bigger example, please see remarks-inlining.ll.
      
          load.h:
          template <typename Ty, unsigned R, unsigned C> Matrix<Ty, R, C> load(Ty *Ptr) {
            Matrix<Ty, R, C> Result;
            Result.value = *reinterpret_cast <typename Matrix<Ty, R, C>::matrix_t *>(Ptr);
            return Result;
          }
      
          store.h:
          template <typename Ty, unsigned R, unsigned C> void store(Matrix<Ty, R, C> M1, Ty *Ptr) {
             *reinterpret_cast<typename decltype(M1)::matrix_t *>(Ptr) = M1.value;
          }
      
          toplevel.cpp
          void test(double *A, double *B, double *C) {
            store(add(load<double, 3, 5>(A), load<double, 3, 5>(B)), C);
          }
      
      For a given function, we traverse the inlined-at chain for each
      matrix instruction (= instructions with shape information). We collect
      the matrix instructions in each DISubprogram we visit. This produces a
      mapping of DISubprogram -> (List of matrix instructions visible in the
      subpogram). We then generate remarks using the list of instructions for
      each subprogram in the inlined-at chain. Note that the list of instructions
      for a subprogram includes the instructions from its own subprograms
      recursively. For example using the example above, for the subprogram
      'test' this includes inline functions 'load' and 'store'. This allows
      surfacing the remarks at a level useful to users.
      
      Please note that the current approach may create a lot of extra remarks.
      Additional heuristics to cut-off the traversal can be implemented in the
      future. For example, it might make sense to stop 'up-leveling' once all
      matrix instructions are at the same debug location.
      
      Reviewers: anemet, Gerolf, thegameg, hfinkel, andrew.w.kaylor, LuoYuanke
      
      Reviewed By: anemet
      
      Differential Revision: https://reviews.llvm.org/D73600
      bc6c8c4b
    • Alexey Bataev's avatar
      0d7c8c07
    • Sterling Augustine's avatar
      Lazily save initialState of registers during unwind. · 8ffdabdb
      Sterling Augustine authored
      Summary:
      Copying all of the saved register state on every entry to
      parseInstruction is a severe performance contraint, especially
      because most of this saved state is never used. On x86 linux
      this is about 560 bytes, and will be more on other platforms.
      
      When performance testing libunwind, this memcpy appears at the
      top of nearly all our tests.
      
      By only saving this state as needed, we see increasing in performance
      of around 2.5% for the ctak test here.
      
      https://github.com/clasp-developers/ctak
      
      Certain internal extremely exception-heavy tasks run in about 2/3
      the time.
      
      Note that by stashing the new boolean inside what had been padding in
      the original structure, this uses no additional memory.
      
      Subscribers: fedor.sergeev, libcxx-commits
      
      Tags: #libc
      
      Differential Revision: https://reviews.llvm.org/D75692
      8ffdabdb
    • Andrzej Warzynski's avatar
      [AArch64][SVE] Add the @llvm.aarch64.sve.sel intrinsic · a9f15832
      Andrzej Warzynski authored
      Reviewers: sdesmalen, efriedma
      
      Subscribers: tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D75928
      a9f15832
    • Philip Reames's avatar
      [GC] Remove buggy untested optimization from statepoint lowering · e6716418
      Philip Reames authored
      A downstream test case (see included reduced test) revealed that we have a bug in how we handle duplicate relocations. If we have the same SDValue relocated twice, and that value happens to be a constant (such as null), we only export one of the two llvm::Values. Exporting on a per llvm::Value basis is required to allow lowering of gc.relocates in following basic blocks (e.g. invokes). Without it, we end up with a use of an undefined vreg and bad things happen.
      
      Rather than fixing the optimization - which appears to be hard - I propose we simply remove it. There are no tests in tree that change with this code removed. If we find out later that this did matter for something, we can reimplement a variation of this in CodeGenPrepare to catch the easy cases without complicating the lowering code.
      
      Thanks to Denis and Serguei who did all the hard work of figuring out what went wrong here. The patch is by far the easy part. :)
      
      Differential Revision: https://reviews.llvm.org/D75964
      e6716418
    • Adrian Prantl's avatar
      Add a decorator option to skip tests based on a default setting. · 0396aa4c
      Adrian Prantl authored
      This patch allows skipping a test based on a default setting, which is
      useful when running the testsuite in different "modes" based on a
      default setting. This is a feature I need for the Swift testsuite, but
      I think it's generally useful.
      
      Differential Revision: https://reviews.llvm.org/D75864
      0396aa4c
    • Fangrui Song's avatar
      [ELF] Simplify sh_addr computation and warn if sh_addr is not a multiple of sh_addralign · fbf41b52
      Fangrui Song authored
      See `docs/ELF/linker_script.rst` for the new computation for sh_addr and sh_addralign.
      `ALIGN(section_align)` now means: "increase alignment to section_align"
      (like yet another input section requirement).
      
      The "start of section .foo changes from 0x11 to 0x20" warning no longer
      makes sense. Change it to warn if sh_addr%sh_addralign!=0.
      
      To decrease the alignment from the default max_input_align,
      use `.output ALIGN(8) : {}` instead of `.output : ALIGN(8) {}`
      See linkerscript/section-address-align.test as an example.
      
      When both an output section address and ALIGN are set (can be seen as an
      "undefined behavior" https://sourceware.org/ml/binutils/2020-03/msg00115.html),
      lld may align more than GNU ld, but it makes a linker script working
      with GNU ld hard to break with lld.
      
      This patch can be considered as restoring part of the behavior before D74736.
      
      Differential Revision: https://reviews.llvm.org/D75724
      fbf41b52
  2. Mar 11, 2020