1. Aug 17, 2020
  2. Aug 13, 2020
  3. Aug 10, 2020
  4. Aug 08, 2020
    • Fangrui Song's avatar
      [ELF] Change tombstone values to (.debug_ranges/.debug_loc) 1 and (other .debug_*) 0 · 279922f1
      Fangrui Song authored
      tl;dr See D81784 for the 'tombstone value' concept. This patch changes our behavior to be almost the same as GNU ld (except that we also use 1 for .debug_loc):
      
      * .debug_ranges & .debug_loc: 1 (LLD<11: 0+addend; GNU ld uses 1 for .debug_ranges)
      * .debug_*: 0 (LLD<11: 0+addend; GNU ld uses 0; future LLD: -1)
      
      We make the tweaks because:
      
      1) The new tombstone is novel and needs more time to be adopted by consumers before it's the default.
      2) The old (gold) strategy had problems with zero-length functions - so rather than going back that, we're going to the GNU ld strategy which doesn't have that problem.
      3) One slight tweak to (2) is to apply the .debug_ranges workaround to .debug_loc for the same reasons it applies to debug_ranges - to avoid terminating lists early.
      
      -----
      
      http://lists.llvm.org/pipermail/llvm-dev/2020-July/143482.html
      
      The tombstone value -1 in .debug_line caused problems to lldb (fixed by D83957;
      will be included in 11.0.0) and breakpad (fixed by
      https://crrev.com/c/2321300). It may potentially affects other DWARF consumers.
      
      For .debug_ranges & .debug_loc: 1, an argument preferring 1 (GNU ld for .debug_ranges) over -2 is that:
      ```
      {-1, -2}    <<< base address selection entry
      {0, length} <<< address range
      ```
      may create a situation where low_pc is greater than high_pc. So we use
      1, the GNU ld behavior for .debug_ranges
      
      For other .debug_* sections, there haven't been many reports. One issue is that
      bloaty (src/dwarf.cc) can incorrectly count address ranges in .debug_ranges . To
      reduce similar disruption, this patch changes the tombstone values to be similar to GNU ld.
      
      This does mean another behavior change to the default trunk behavior. Sorry
      about it. The default trunk behavior will be similar to release/11.x while we work on a transition plan for LLD users.
      
      Reviewed By: dblaikie, echristo
      
      Differential Revision: https://reviews.llvm.org/D84825
      
      (cherry picked from commit 004be403)
      279922f1
    • Petar Avramovic's avatar
      [GlobalISel][InlineAsm] Fix matching input constraint to physreg · b067f5eb
      Petar Avramovic authored
      Add given input and mark it as tied.
      Doesn't create additional copy compared to
      matching input constraint to virtual register.
      
      Differential Revision: https://reviews.llvm.org/D85122
      
      (cherry picked from commit d893278b)
      b067f5eb
  5. Aug 06, 2020
  6. Aug 05, 2020
  7. Aug 03, 2020
  8. Aug 01, 2020
  9. Jul 31, 2020
    • Francesco Petrogalli's avatar
      [llvm][CodeGen] Addressing modes for SVE ldN. · f3fa6342
      Francesco Petrogalli authored
      Reviewers: c-rhodes, efriedma, sdesmalen
      
      Subscribers: huihuiz, tschuett, hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D77251
      
      (cherry picked from commit adb28e0f)
      f3fa6342
    • Francesco Petrogalli's avatar
      [NFC][AArch64] Replace some template methods/invocations... · db306412
      Francesco Petrogalli authored
      ...with the non-template version, as the template version might
      increase the size of the compiler build.
      
      Methods affected:
      
      1.`findAddrModeSVELoadStore`
      2. `SelectPredicatedStore`
      
      Also, remove the `const` qualifier from the `unsigned` parameters of
      the methods to conform with other similar methods in the class.
      
      (cherry picked from commit dbeb184b)
      db306412
    • Francesco Petrogalli's avatar
      [llvm][sve] Reg + Imm addressing mode for ld1ro. · 6b66be51
      Francesco Petrogalli authored
      Reviewers: kmclaughlin, efriedma, sdesmalen
      
      Subscribers: tschuett, hiraditya, psnobl, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D83357
      
      (cherry picked from commit 809600d6)
      6b66be51
    • David Sherwood's avatar
      [SVE][CodeGen] At -O0 fallback to DAG ISel when translating alloca with scalable types · 5583444d
      David Sherwood authored
      When building code at -O0 We weren't falling back to DAG ISel correctly
      when encountering alloca instructions with scalable vector types. This
      is because the alloca has no operands that are scalable. I've fixed this by
      adding a check in AArch64ISelLowering::fallBackToDAGISel for alloca
      instructions with scalable types.
      
      Differential Revision: https://reviews.llvm.org/D84746
      
      (cherry picked from commit 23ad660b)
      5583444d
    • David Sherwood's avatar
      [SVE] Don't consider scalable vector types in SLPVectorizerPass::vectorizeChainsInBlock · 16a68abc
      David Sherwood authored
      In vectorizeChainsInBlock we try to collect chains of PHI nodes
      that have the same element type, but the code is relying upon
      the implicit conversion from TypeSize -> uint64_t. For now, I have
      modified the code to ignore PHI nodes with scalable types.
      
      Differential Revision: https://reviews.llvm.org/D83542
      
      (cherry picked from commit 9ad7c980)
      16a68abc
    • David Sherwood's avatar
      [SVE][CodeGen] Add simple integer add tests for SVE tuple types · bec30644
      David Sherwood authored
      I have added tests to:
      
        CodeGen/AArch64/sve-intrinsics-int-arith.ll
      
      for doing simple integer add operations on tuple types. Since these
      tests introduced new warnings due to incorrect use of
      getVectorNumElements() I have also fixed up these warnings in the
      same patch. These fixes are:
      
      1. In narrowExtractedVectorBinOp I have changed the code to bail out
      early for scalable vector types, since we've not yet hit a case that
      proves the optimisations are profitable for scalable vectors.
      2. In DAGTypeLegalizer::WidenVecRes_CONCAT_VECTORS I have replaced
      calls to getVectorNumElements with getVectorMinNumElements in cases
      that work with scalable vectors. For the other cases I have added
      asserts that the vector is not scalable because we should not be
      using shuffle vectors and build vectors in such cases.
      
      Differential revision: https://reviews.llvm.org/D84016
      
      (cherry picked from commit 20787717)
      bec30644
    • David Sherwood's avatar
      [SVE] Add checks for no warnings in CodeGen/AArch64/sve-sext-zext.ll · 07a7044b
      David Sherwood authored
      Previous patches fixed up all the warnings in this test:
      
        llvm/test/CodeGen/AArch64/sve-sext-zext.ll
      
      and this change simply checks that no new warnings are added in future.
      
      Differential revision: https://reviews.llvm.org/D83205
      
      (cherry picked from commit f43b5c7a)
      07a7044b
    • David Sherwood's avatar
      [CodeGen] Remove calls to getVectorNumElements in DAGTypeLegalizer::SplitVecOp_EXTRACT_SUBVECTOR · 75e5d4f4
      David Sherwood authored
      In DAGTypeLegalizer::SplitVecOp_EXTRACT_SUBVECTOR I have replaced
      calls to getVectorNumElements with getVectorMinNumElements, since
      this code path works for both fixed and scalable vector types. For
      scalable vectors the index will be multiplied by VSCALE.
      
      Fixes warnings in this test:
      
        sve-sext-zext.ll
      
      Differential revision: https://reviews.llvm.org/D83198
      
      (cherry picked from commit 5d84eafc)
      75e5d4f4
    • David Sherwood's avatar
      [SVE] Don't use LocalStackAllocation for SVE objects · a3532c58
      David Sherwood authored
      I have introduced a new TargetFrameLowering query function:
      
        isStackIdSafeForLocalArea
      
      that queries whether or not it is safe for objects of a given stack
      id to be bundled into the local area. The default behaviour is to
      always bundle regardless of the stack id, however for AArch64 this is
      overriden so that it's only safe for fixed-size stack objects.
      There is future work here to extend this algorithm for multiple local
      areas so that SVE stack objects can be bundled together and accessed
      from their own virtual base-pointer.
      
      Differential Revision: https://reviews.llvm.org/D83859
      
      (cherry picked from commit 14bc85e0)
      a3532c58
    • Sander de Smalen's avatar
      [AArch64][SVE] Fix epilogue for SVE when the stack is realigned. · 13fb3d30
      Sander de Smalen authored
      While deallocating the stackframe, the offset used to reload the
      callee-saved registers was not pointing to the SVE callee-saves,
      but rather to the whole SVE area.
      
         +--------------+
         | GRP callee   |
         |     saves    |
         +--------------+ <- FP
         | SVE callee   |
         |     saves    |
         +--------------+ <- Should restore SVE callee saves from here
         |  SVE Spills  |
         |  and Locals  |
         +--------------+ <- instead of from here.
         |              |
         :              :
         |              |
         +--------------+ <- SP
      
      Reviewed By: paulwalker-arm
      
      Differential Revision: https://reviews.llvm.org/D84539
      
      (cherry picked from commit cda2eb3a)
      13fb3d30
    • Sander de Smalen's avatar
      [AArch64][SVE] Don't align the last SVE callee save. · 55966935
      Sander de Smalen authored
      Instead of aligning the last callee-saved-register slot to the stack
      alignment (16 bytes), just align the SVE callee-saved block. This also
      simplifies the code that allocates space for the callee-saves.
      
      This change is needed to make sure the offset to which the callee-saved
      register is spilled, corresponds to the offset used for e.g. unwind call
      frame instructions.
      
      Reviewers: efriedma, paulwalker-arm, david-arm, rengolin
      
      Reviewed By: efriedma
      
      Differential Revision: https://reviews.llvm.org/D84042
      
      (cherry picked from commit 26b4ef36)
      55966935
    • Sander de Smalen's avatar
      [AArch64][SVE] Don't support fixedStack for SVE objects. · 967b84c7
      Sander de Smalen authored
      Fixed stack objects are preallocated and defined to be allocated before
      any of the regular stack objects. These are normally used to model stack
      arguments.
      
      The AAPCS does not support passing SVE registers on the stack by value
      (only by reference). The current layout also doesn't place them before
      all stack objects, but rather before all SVE objects. Removing this
      simplifies the code that emits the allocation/deallocation
      around callee-saved registers (D84042).
      
      This patch also removes all uses of fixedStack from from
      framelayout-sve.mir, where this was used purely for testing purposes.
      
      Reviewers: paulwalker-arm, efriedma, rengolin
      
      Reviewed By: paulwalker-arm
      
      Differential Revision: https://reviews.llvm.org/D84538
      
      (cherry picked from commit 54492a58)
      967b84c7