1. Nov 28, 2023
  2. Nov 27, 2023
    • Georgios Eleftheriou's avatar
      eliminate python SyntaxWarnings from check-all output. · e919a83f
      Georgios Eleftheriou authored
      ```
      src_dir/clang/lib/Tooling/DumpTool/generate_cxx_src_locs.py:28: SyntaxWarning: invalid escape sequence '\*'    self.implementationContent += """
      src_dir/llvm/utils/lit/lit/TestRunner.py:205: SyntaxWarning: invalid escape sequence '\c'                      """
      src_dir/llvm/utils/lit/lit/TestRunner.py:1561: SyntaxWarning: invalid escape sequence '\s'                     match = _caching_re_compile("^\s*%else\s*(%{)?").search(ln)
      src_dir/libcxx/utils/libcxx/test/format.py:64: SyntaxWarning: invalid escape sequence '\s'                     for output in re.split('[$]\s*":"\s*"RUN: at line \d+"', fullOutput):
      src_dir/libcxx/utils/libcxx/test/params.py:121: SyntaxWarning: invalid escape sequence '\+'                    AddSubstitution("%{cxx_std}", re.sub("\+", "x", std)),
      src_dir/libcxx/utils/libcxx/test/params.py:214: SyntaxWarning: invalid escape sequence '\+'                    AddFeature("stdlib=libc++") if re.match(".+-libc\+\+", stdlib) else None,
      src_dir/compiler-rt/test/lit.common.cfg.py:800: SyntaxWarning: invalid escape sequence '\$'                    "-Wl,-z,origin -Wl,-rpath,\$ORIGIN -L%T -l%xdynamiclib_namespec"
      src_dir/compiler-rt/test/lit.common.cfg.py:809: SyntaxWarning: invalid escape sequence '\$'                    "-Wl,-rpath,\$ORIGIN -L%T -l%xdynamiclib_namespec" + postfix,
      src_dir/compiler-rt/test/lit.common.cfg.py:817: SyntaxWarning: invalid escape sequence '\$'                    "-Wl,-R\$ORIGIN -L%T -l%xdynamiclib_namespec" + postfix,
      src_dir/llvm/test/lit.cfg.py:275: SyntaxWarning: invalid escape sequence '\d'                                  match = re.search("release (\d+)\.(\d+)", ptxas_out)
      ```
      e919a83f
    • Owen Pan's avatar
      [clang-format] Fix crashes in AlignArrayOfStructures (#72520) · f6c231c1
      Owen Pan authored
      Fixed #54815.
      Fixed #55269.
      Fixed #55493.
      Fixed #68431.
      f6c231c1
    • Tulio Magno Quites Machado Filho's avatar
      [clang] Fix sorting module headers (#73146) · f74f3e6f
      Tulio Magno Quites Machado Filho authored
      Struct Module::Header is not a POD type. As such, qsort() and
      llvm::array_pod_sort() must not be used to sort it. This became an issue
      with the new implementation of qsort() in glibc 2.39 that is not
      guaranteed to be a stable sort, causing Headers to be re-ordered and
      corrupted.
      
      Replace the usage of llvm::array_pod_sort() with std::stable_sort() in
      order to fix this issue. The signature of compareModuleHeaders() has to
      be modified.
      
      Fixes #73145.
      
      (cherry picked from commit cf1bde33)
      f74f3e6f
    • Lang Hames's avatar
      [JITLink][aarch32] Change writeRegister's return type to void. · 7e30ce95
      Lang Hames authored
      This function does not return a value.
      
      https://github.com/llvm/llvm-project/issues/64418
      (cherry picked from commit dce17939)
      7e30ce95
    • Brad Smith's avatar
      [CMake] Support building shared library for NetBSD · 03373fd9
      Brad Smith authored
      (cherry picked from commit 51c5d749)
      03373fd9
    • Tom Stellard's avatar
      workflows/release-binaries: Do a preliminary build to fill ccache (#72576) · 21af3b62
      Tom Stellard authored
      Build clang with the host compiler and ccache enabled in order to speed
      up the phase 1 builds. This helps reduce the amount of time spent
      running on the non-free builders.
      
      (cherry picked from commit e746b56c)
      21af3b62
    • Shao-Ce SUN's avatar
      Add RV64 constraint to SRLIW (#69416) · 201faeca
      Shao-Ce SUN authored
      Fixes #69408
      
      (cherry picked from commit f48dab52)
      201faeca
  3. Nov 24, 2023
    • Tom Stellard's avatar
      [runtimes] Add missing test dependencies to check-all (#72955) · e957e6dc
      Tom Stellard authored
      The test-depends target contained all the dependencies needed to run the
      runtimes tests, but it was never added as a dependency of check-all.
      This caused some of the tsan tests to fail, since the custom libcxx
      build the tests were looking for was never built. Besides the tsan
      failures, this fixes all the other test failures I was seeing with:
      cmake -G Ninja -B release-build -S llvm \
              -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
              -DCMAKE_BUILD_TYPE=Release \
              -DLLVM_ENABLE_ASSERTIONS=OFF \
              -DLLVM_ENABLE_PROJECTS="clang;lld" \
              -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind;compiler-rt"
      
      This is the same configuration the test-release.sh script uses, so I'm
      hoping this will also fix all the test failures we've been seeing when
      building the releases.
      
      Fixes #58680
      
      (cherry picked from commit 7f215b13)
      e957e6dc
  4. Nov 20, 2023
  5. Nov 14, 2023
    • Nikita Popov's avatar
      [BranchFolding] Remove dubious assert from operator< (#71639) · 98bfdac5
      Nikita Popov authored
      `MergePotentialElts::operator<` asserts that the two elements being
      compared are not equal. However, sorting functions are allowed to invoke
      the comparison function with equal arguments (though they usually don't
      for efficiency reasons).
      
      There is an existing special-case that disables the assert if
      _GLIBCXX_DEBUG is used, which may invoke the comparator with equal args
      to verify strict weak ordering. I believe libc++ also has strict weak
      ordering checks under some options nowadays.
      
      Recently, #71312 was reported, where a change to glibc's qsort_r
      implementation can also result in comparison between equal elements.
      From what I understood, this is an inefficiency that will be fixed on
      the glibc side as well, but I think at this point we should just remove
      this assertion.
      
      Fixes https://github.com/llvm/llvm-project/issues/71312.
      
      (cherry picked from commit 74a76a28)
      98bfdac5
    • Nikita Popov's avatar
      [GlobalOpt] Cache whether CC is changeable (#71381) · 12c6ee8f
      Nikita Popov authored
      The hasAddressTaken() call in hasOnlyColdCalls() has quadratic
      complexity if there are many cold calls to a function: We're going to
      visit each call of the function, and then for each of them iterate all
      the users of the function.
      
      We've recently encountered a case where GlobalOpt spends more than an
      hour in these hasAddressTaken() checks when full LTO is used.
      
      Avoid this by moving the hasAddressTaken() check into hasChangeableCC()
      and caching its result, so it is only computed once per function.
      
      (cherry picked from commit e360a16f)
      12c6ee8f
    • Jan Kokemüller's avatar
      [libc++] Fix UB in <expected> related to "has value" flag (#68552) (#68733) · 0a127422
      Jan Kokemüller authored
      The calls to std::construct_at might overwrite the previously set
      __has_value_ flag in the case where the flag is overlapping with
      the actual value or error being stored (since we use [[no_unique_address]]).
      To fix this issue, this patch ensures that we initialize the
      __has_value_ flag after we call std::construct_at.
      
      Fixes #68552
      
      (cherry picked from commit 134c9159)
      0a127422
    • antoine moynault's avatar
      [clang] fix test PR69717.cpp (#72134) · 42f8800b
      antoine moynault authored
      Test still fail on ARM machine (no float_control support)
      
      (cherry picked from commit 5fdb70be)
      42f8800b
    • Serge Pavlov's avatar
      [clang] Run test on x86 only · e666be92
      Serge Pavlov authored
      The test Sema/PR69717.cpp fails on platforms that do not support
      pragma float_control. So run this test on x86 only.
      
      (cherry picked from commit 93ae2633)
      e666be92
    • Serge Pavlov's avatar
      [clang] Do not clear FP pragma stack when instantiating functions (#70646) · aebee698
      Serge Pavlov authored
      When instantiation function, a call to Sema::resetFPOption was used to
      set the FP options associated with AST node. However this function also
      cleared FP pragma stack, and it is incorrect. Template instantiation
      takes place on AST representation and semantic information like the FP
      pragma stack should not affect it. This was a reason for miscompilation
      in some cases.
      
      To make the Sema interface more consistent, now `resetFPOptions` does
      not clear FP pragma stack anymore. It is cleared in
      `FpPragmaStackSaveRAII`, which is used in parsing only.
      
      This change must fix https://github.com/llvm/llvm-project/issues/69717
      (Problems with float_control pragma stack in Clang 17.x).
      
      (cherry picked from commit f6f625f4)
      aebee698
  6. Nov 13, 2023
    • Alexey Bataev's avatar
      [SLP]Fix PR70004: Do not change insert point for reduction gather nodes. · 529aa6ea
      Alexey Bataev authored
      No need to change the insert point for reduction gather node, we can use
      the ReductionRoot as insert point instead to avoid possible crashes.
      
      (cherry picked from commit d79051f8)
      529aa6ea
    • Simon Pilgrim's avatar
      [DAG] WidenVectorOperand - add basic handling for *_EXTEND_VECTOR_INREG nodes · 69b3baf9
      Simon Pilgrim authored
      Fixes Issue #70208
      
      (cherry picked from commit c9c9bf0f)
      69b3baf9
    • Craig Topper's avatar
      [Mips] In LowerShift*Parts, xor with bits-1 instead of -1. (#71149) · e7dc53b9
      Craig Topper authored
      If we start with an i128 shift, the initial shift amount would usually
      have zeros in bit 8 and above. xoring the shift amount with -1 will set
      those upper bits to 1. If DAGCombiner is able to prove those bits are
      now 1, then the shift that uses the xor will be replaced with undef.
      Which we don't want.
      
      Reduce the xor constant to VT.bits-1 where VT is half the size of the
      larger shift type. This avoids toggling the upper bits. The hardware
      shift instruction only uses the lower bits of the shift amount. I assume
      the code used NOT because the hardware doesn't use the upper bits, but
      that isn't compatible with the LLVM poison semantics.
      
      Fixes #71142.
      
      (cherry picked from commit 8d24d390)
      e7dc53b9
    • Owen Pan's avatar
      [clang-format] Correctly annotate keyword operator function name (#66904) · a6cbdae9
      Owen Pan authored
      Fixes #66890.
      
      (cherry picked from commit 67b99fa8)
      a6cbdae9
    • Tobias Hieta's avatar
      Bump version to 17.0.5 · 094cfd14
      Tobias Hieta authored
      094cfd14
    • Rainer Orth's avatar
      [Driver] Fix linking with -lm on Solaris (#65632) · 05422e1d
      Rainer Orth authored
      As noticed in D158846, the Solaris driver deviates from other targets in
      that it links every executable with `-lm`, but doesn't for shared
      objects. For C code, this is unnecessary, while for C++ `libm` is always
      needed, even for shared objects.
      
      This patch fixes this by following the `Gnu.cpp` precedent. It adjusts
      the `solaris-ld.c` test accordingly, adding some more tests.
      
      Tested on `amd64-pc-solaris2.11`, `sparcv9-sun-solaris2.11`, and
      `x86_64-pc-linux-gnu`.
      
      (cherry picked from commit 1e6b0df3)
      05422e1d
    • Martin Storsjö's avatar
      [clang-repl] Fix BUILD_SHARED_LIBS symbols from libclangInterpreter on MinGW (#71393) · 910748f4
      Martin Storsjö authored
      A few symbols within libclangInterpreter have got explicit dllexport
      attributes, in order to make them exported (and thus visible at runtime)
      in any build, not only when they are part of e.g. a DLL libclang-cpp,
      but also when they are part of a plain .exe.
      
      Due to the explicit dllexports, these symbols would sidestep the regular
      MinGW logic of exporting all symbols if there are no dllexports.
      Therefore, for libclang-cpp, a separate fix was made in
      592e935e, to pass --export-all-symbols
      to the build of libclang-cpp.
      
      If building with BUILD_SHARED_LIBS enabled, then the same issue appears
      in libclangInterpreter; pass the same flag --export-all-symbols there as
      well, to make sure all symbols are visible, not only the ones that are
      explicitly marked as dllexport.
      
      (cherry picked from commit 0d3eeac8)
      910748f4
    • Nick Desaulniers's avatar
      [CGExprConstant] stop calling into ConstExprEmitter for Reference type destinations (#70366) · 582f0469
      Nick Desaulniers authored
      Fixes a bug introduced by
      commit b54294e2 ("[clang][ConstantEmitter] have
      tryEmitPrivate[ForVarInit] try ConstExprEmitter fast-path first")
      
      In the added test case, the QualType is a LValueReferenceType.
      
          LValueReferenceType 0x558412998d90 'const char (&)[41]'
          `-ParenType 0x558412998d30 'const char[41]' sugar
            `-ConstantArrayType 0x558412998cf0 'const char[41]' 41
              `-QualType 0x55841294c271 'const char' const
                `-BuiltinType 0x55841294c270 'char'
      
      Fixes: #69979
      (cherry picked from commit d9b15b06)
      582f0469
  7. Oct 31, 2023