1. Feb 26, 2022
  2. Feb 25, 2022
  3. Feb 23, 2022
    • Rainer Orth's avatar
      [Driver] Use libatomic for 32-bit SPARC atomics support · 2fe5bf57
      Rainer Orth authored
      Even after D86621 <https://reviews.llvm.org/D86621>, `clang -m32` on
      Solaris/sparcv9 doesn't inline atomics with 8-byte operands, unlike `gcc`.
      This leads to many link failures in the testsuite (undefined references to
      `__atomic_load_8` and `__sync_val_compare_and_swap_8`.  Until a proper
      codegen fix can be implemented, this patch works around the first of those
      by linking with `-latomic`.
      
      Tested on `sparcv9-sun-solaris2.11`.
      
      Differential Revision: https://reviews.llvm.org/D118021
      
      (cherry picked from commit a6afa9e6)
      2fe5bf57
    • Rainer Orth's avatar
      [mlir][sparse] Rename index_t to index_type again · 46266b35
      Rainer Orth authored
      While testing LLVM 14.0.0 rc1 on Solaris, I ran into a compile failure:
      
                         from /var/llvm/llvm-14.0.0-rc1/rc1/llvm-project/mlir/lib/ExecutionEngine/SparseTensorUtils.cpp:22:
        /usr/include/sys/types.h:103:16: error: conflicting declaration ‘typedef short int index_t’
          103 | typedef short  index_t;
              |                ^~~~~~~
        In file included from
      /var/llvm/llvm-14.0.0-rc1/rc1/llvm-project/mlir/lib/ExecutionEngine/SparseTensorUtils.cpp:17:
        /var/llvm/llvm-14.0.0-rc1/rc1/llvm-project/mlir/include/mlir/ExecutionEngine/SparseTensorUtils.h:26:7:
      note: previous declaration as ‘using index_t = uint64_t’
           26 | using index_t = uint64_t;
              |       ^~~~~~~
      
      The same issue had already occured in the past and fixed in D72619
      <https://reviews.llvm.org/D72619>.  More detailed explanation can also be
      found there.
      
      Tested on `amd64-pc-solaris2.11` and `sparcv9-solaris2.11`.
      
      Differential Revision: https://reviews.llvm.org/D119323
      
      (cherry picked from commit d2215e79)
      46266b35
    • Bradley Smith's avatar
      [AArch64][SVE] Fix selection failure during lowering of shuffle_vector · 03d9a409
      Bradley Smith authored
      The lowering code for shuffle_vector has a code path that looks through
      extract_subvector, this code path did not properly account for the
      potential presense of larger than Neon vector types and could produce
      unselectable DAG nodes.
      
      Differential Revision: https://reviews.llvm.org/D119252
      
      (cherry picked from commit 98936aee)
      03d9a409
    • David Sherwood's avatar
      Fix incorrect TypeSize->uint64_t cast in InductionDescriptor::isInductionPHI · 8b5b29c4
      David Sherwood authored
      The code was relying upon the implicit conversion of TypeSize to
      uint64_t and assuming the type in question was always fixed. However,
      I discovered an issue when running the canon-freeze pass with some
      IR loops that contains scalable vector types. I've changed the code
      to bail out if the size is unknown at compile time, since we cannot
      compute whether the step is a multiple of the type size or not.
      
      I added a test here:
      
        Transforms/CanonicalizeFreezeInLoops/phis.ll
      
      Differential Revision: https://reviews.llvm.org/D118696
      
      (cherry picked from commit 1badfbb4)
      8b5b29c4
    • David Sherwood's avatar
      [SVE][CodeGen] Bail out for scalable vectors in AArch64TargetLowering::ReconstructShuffle · 8c33ea3a
      David Sherwood authored
      Previously the code in AArch64TargetLowering::ReconstructShuffle assumed
      the input vectors were always fixed-width, however this is not always
      the case since you can extract elements from scalable vectors and insert
      into fixed-width ones. We were hitting crashes here for two different
      cases:
      
      1. When lowering a fixed-length vector extract from a scalable vector
      with i1 element types. This happens due to the fact the i1 elements
      get promoted to larger integer types for fixed-width vectors and leads
      to sequences of INSERT_VECTOR_ELT and EXTRACT_VECTOR_ELT nodes. In this
      case AArch64TargetLowering::ReconstructShuffle will still fail to make
      a transformation, but at least it no longer crashes.
      2. When lowering a sequence of extractelement/insertelement operations
      on mixed fixed-width/scalable vectors.
      
      For now, I've just changed AArch64TargetLowering::ReconstructShuffle to
      bail out if it finds a scalable vector.
      
      Tests for both instances described above have been added here:
      
        (1) CodeGen/AArch64/sve-extract-fixed-vector.ll
        (2) CodeGen/AArch64/sve-fixed-length-reshuffle.ll
      
      Differential Revision: https://reviews.llvm.org/D116602
      
      (cherry picked from commit a57a7f3d)
      8c33ea3a
    • Bradley Smith's avatar
      [AArch64][SVE] Fix selection failure caused by fp/int convert using non-Neon types · 1362f8bd
      Bradley Smith authored
      Fixes: #53679
      
      Differential Revision: https://reviews.llvm.org/D119428
      
      (cherry picked from commit c53ad72a)
      1362f8bd
    • Kerry McLaughlin's avatar
      [AArch64][SVE] Add structured load/store opcodes to getMemOpInfo · 88f8980a
      Kerry McLaughlin authored
      Currently, loading from or storing to a stack location with a structured load
      or store crashes in isAArch64FrameOffsetLegal as the opcodes are not handled by
      getMemOpInfo. This patch adds the opcodes for structured load/store instructions
      with an immediate index to getMemOpInfo & getLoadStoreImmIdx, setting appropriate
      values for the scale, width & min/max offsets.
      
      Reviewed By: sdesmalen, david-arm
      
      Differential Revision: https://reviews.llvm.org/D119338
      
      (cherry picked from commit fc1b2122)
      88f8980a
    • Nicolas Miller's avatar
      [llvm-objcopy][COFF] Fix section name encoding · cefe6876
      Nicolas Miller authored
      The section name encoding for `llvm-objcopy` had two main issues, the
      first is that the size used for the `snprintf` in the original code is
      incorrect because `snprintf` adds a null byte, so this code was only
      able to encode offsets of 6 digits - `/`, `\0` and 6 digits of the
      offset - rather than the 7 digits it should support.
      
      And the second part is that it didn't support the base64 encoding for
      offsets larger than 7 digits.
      
      This issue specifically showed up when using the `clang-offload-bundler`
      with a binary containing a lot of symbols/sections, since it uses
      `llvm-objcopy` to add the sections containing the offload code.
      
      Reviewed By: jhenderson
      
      Differential Revision: https://reviews.llvm.org/D118692
      
      (cherry picked from commit ddf528b7)
      cefe6876
    • Nicolas Miller's avatar
      [COFF] Move section name encoding into BinaryFormat · 3367c247
      Nicolas Miller authored
      Large COFF section names are moved into the string table and the
      section header field is the offset into the string table encoded in
      ASCII for offset smaller than 7 digits and in base64 for larger
      offsets.
      
      The operation of taking the string table offsets is done in a few
      places in the codebase, so it is helpful to move this operation into
      `BinaryFormat` so that it can be shared everywhere it's done.
      
      So this patch takes the implementation of this operation from
      `llvm/lib/MC/WinCOFFObjectWriter.cpp` and moves it into `BinaryFormat`.
      
      Reviewed By: jhenderson, rnk
      
      Differential Revision: https://reviews.llvm.org/D118793
      
      (cherry picked from commit 85f4023e)
      3367c247
    • Rainer Orth's avatar
      [MLIR][Presburger] Disambiguate call to floor · 9672d114
      Rainer Orth authored
      While testing LLVM 14.0.0 rc1 on Solaris, compilation of `FAIL`ed with
      
        /var/llvm/llvm-14.0.0-rc1/rc1/llvm-project/mlir/lib/Analysis/Presburger/Utils.cpp: In lambda function:
        /var/llvm/llvm-14.0.0-rc1/rc1/llvm-project/mlir/lib/Analysis/Presburger/Utils.cpp:48:58: error: call of overloaded ‘floor(int64_t)’ is ambiguous
           48 |                  [gcd](int64_t &n) { return floor(n / gcd); });
              |                                                          ^
        ...
        /usr/gcc/10/lib/gcc/sparcv9-sun-solaris2.11/10.3.0/include-fixed/iso/math_iso.h:201:21:
      note: candidate: ‘long double std::floor(long double)’
          201 |  inline long double floor(long double __X) { return __floorl(__X); }
              |                     ^~~~~
        /usr/gcc/10/lib/gcc/sparcv9-sun-solaris2.11/10.3.0/include-fixed/iso/math_iso.h:165:15:
      note: candidate: ‘float std::floor(float)’
          165 |  inline float floor(float __X) { return __floorf(__X); }
              |               ^~~~~
        /usr/gcc/10/lib/gcc/sparcv9-sun-solaris2.11/10.3.0/include-fixed/iso/math_iso.h:78:15:
      note: candidate: ‘double std::floor(double)’
           78 | extern double floor __P((double));
              |               ^~~~~
      
      The same issue had already occured in the past, cf. D108750
      <https://reviews.llvm.org/D108750>, and the solution is the same: cast the
      `floor` arg to `double`.
      
      Tested on `amd64-pc-solaris2.11` and `sparcv9-sun-solaris2.11`.
      
      Differential Revision: https://reviews.llvm.org/D119324
      
      (cherry picked from commit 91596755)
      9672d114
  4. Feb 22, 2022
  5. Feb 19, 2022
  6. Feb 18, 2022
  7. Feb 17, 2022