1. Apr 25, 2024
  2. Apr 24, 2024
  3. Apr 23, 2024
  4. Apr 17, 2024
    • Tom Stellard's avatar
      [CMake][Release] Disable PGO (#88465) (#89000) · e6c32898
      Tom Stellard authored
      Running the test-release.sh script with PGO enabled causes build errors
      like:
      
      ld.lld: error: Function Import: link error: linking module flags
      'ProfileSummary': IDs have conflicting values
      
      I believe this a build system bug due to the PGO profile data being
      generated unconditionally. If you run `ninja check-all` and then `ninja
      install` like we do in test-release.sh, then the profile data is
      regenerated during `ninja install` and some of the clang tools which are
      not test dependencies get build during the ninja install step with
      different profile data. When these tools link against the LLVM
      libraries, like libSupport, we end up with these errors.
      
      (cherry picked from commit 0d2bb7f0)
      e6c32898
    • Cinhi Young's avatar
      [MIPS] Fix the opcode of max.fmt and mina.fmt (#85609) · 028e425f
      Cinhi Young authored
      - The opcode of the mina.fmt and max.fmt is documented wrong, the
        object code compiled from the same assembly with LLVM behaves
        differently than one compiled with GCC and Binutils.
      - Modify the opcodes to match Binutils. The actual opcodes are as
      follows:
      
        {5,3} | bits {2,0} of func
                 |    ...   | 100  | 101    | 110   | 111
        -----+-----+-----+-----+-----+-----
         010  |   ...   |  min  | mina | max  | maxa
      
      (cherry picked from commit 8b859c6e)
      028e425f
    • Giuliano Belinassi's avatar
      Fix override keyword being print to the left side · e3c832b3
      Giuliano Belinassi authored
      
      
      Previously, the `override` keyword in C++ was being print in the left
      side of a method decl, which is unsupported by C++ standard. This commit
      fixes that by setting the `CanPrintOnLeft` field to 0, forcing it to be
      print on the right side of the decl.
      
      Signed-off-by: default avatarGiuliano Belinassi <gbelinassi@suse.de>
      e3c832b3
    • Nikita Popov's avatar
      Revert "[Mips] Fix missing sign extension in expansion of sub-word atomic max (#77072)" · 1deeee3f
      Nikita Popov authored
      These changes caused correctness regressions observed in Rust,
      see
      https://github.com/llvm/llvm-project/pull/77072#issuecomment-2049009507.
      
      This reverts commit 0e501dbd.
      This reverts commit fbb27d16.
      1deeee3f
    • Martin Storsjö's avatar
      [LLD] [COFF] Don't add pseudo relocs for dangling references (#88487) · 995539ce
      Martin Storsjö authored
      When doing GC, we normally won't have dangling references, because such
      a reference would keep the other section alive, keeping it from being
      eliminated.
      
      However, references within DWARF sections are ignored for the purposes
      of GC (because otherwise, they would essentially keep everything alive,
      defeating the point of the GC), see
      c579a5b1 for more context.
      
      Therefore, dangling relocations against discarded symbols are ignored
      within DWARF sections (see maybeReportRelocationToDiscarded in
      Chunks.cpp). Consequently, we also shouldn't create any pseudo
      relocations for these cases, as we run into a null pointer dereference
      when trying to generate the pseudo relocation info for it.
      
      This fixes the downstream bug
      https://github.com/mstorsjo/llvm-mingw/issues/418, fixing crashes on
      combinations with -ffunction-sections, -fdata-sections,
      -Wl,--gc-sections and debug info.
      
      (cherry picked from commit 9c970d5e)
      995539ce
    • Louis Dionne's avatar
      [libc++] Fix -Wgnu-include-next in stddef.h (#88214) · db67e6fb
      Louis Dionne authored
      As reported in #86843, we must have #pragma GCC system_header before we
      use #include_next, otherwise the compiler may not understand that we're
      in a system header and may issue a diagnostic for our usage of
      
      (cherry picked from commit 3c4b673a)
      db67e6fb
    • XChy's avatar
      [SelectionDAG] Prevent combination on inconsistent type in `combineCarryDiamond` (#84888) · 647fbc71
      XChy authored
      Fixes #84831
      When matching carry pattern with `getAsCarry`, it may produce different
      type of carryout. This patch checks such case and does early exit.
      
      I'm new to DAG, any suggestion is appreciated.
      
      (cherry picked from commit cb4453dc)
      647fbc71
  5. Apr 16, 2024
    • Cyrill Leutwiler's avatar
      [RISCV] Support rv{32, 64}e in the compiler builtins (#88252) · eaae766a
      Cyrill Leutwiler authored
      Register spills (save/restore) in RISC-V embedded work differently
      because there are less registers and different stack alignment.
      
      [GCC equivalent
      ](https://github.com/gcc-mirror/gcc/blob/master/libgcc/config/riscv/save-restore.S#L298C16-L336
      
      )
      
      Follow up from #76777.
      
      ---------
      
      Signed-off-by: default avatarxermicus <cyrill@parity.io>
      (cherry picked from commit bd32aaa8)
      eaae766a
    • Tom Stellard's avatar
      github-upload-release.py: Fix bug preventing release creation (#84571) · c24b41d7
      Tom Stellard authored
      After aa020024 we started passing the
      user name to the create_release function and this was being interpreted
      as the git tag.
      
      (cherry picked from commit 0b9ce71a)
      c24b41d7
    • Alexandre Ganea's avatar
      [Codegen][X86] Fix /HOTPATCH with clang-cl and inline asm (#87639) · c837970d
      Alexandre Ganea authored
      This fixes an edge case where functions starting with inline assembly
      would assert while trying to lower that inline asm instruction.
      
      After this PR, for now we always add a no-op (xchgw in this case) without
      considering the size of the next inline asm instruction. We might want
      to revisit this in the future.
      
      This fixes Unreal Engine 5.3.2 compilation with clang-cl and /HOTPATCH.
      
      Should close https://github.com/llvm/llvm-project/issues/56234
      
      (cherry picked from commit ec1af63d)
      c837970d
    • Yingwei Zheng's avatar
      [InstSimplify] Make sure the simplified value doesn't generate poison in... · d0ddcce2
      Yingwei Zheng authored
      [InstSimplify] Make sure the simplified value doesn't generate poison in threadBinOpOverSelect (#87075)
      
      Alive2: https://alive2.llvm.org/ce/z/y_Jmdn
      Fix https://github.com/llvm/llvm-project/issues/87042.
      
      (cherry picked from commit 3197f9d8)
      d0ddcce2
    • Daniel Paoliello's avatar
      Prepend all library intrinsics with `#` when building for Arm64EC (#87542) · 4056cc29
      Daniel Paoliello authored
      While attempting to build some Rust code, I was getting linker errors
      due to missing functions that are implemented in `compiler-rt`. Turns
      out that when `compiler-rt` is built for Arm64EC, all its function names
      are mangled with the leading `#`.
      
      This change removes the hard-coded list of library-implemented
      intrinsics to mangle for Arm64EC, and instead assumes that they all must
      be mangled.
      4056cc29
    • Alexey Bataev's avatar
      [SLP]Fix a crash if the argument of call was affected by minbitwidth analysis. · 6e071cf3
      Alexey Bataev authored
      Need to support proper type conversion for function arguments to avoid
      compiler crash.
      6e071cf3
    • Brian Cain's avatar
      [libcxx] coerce formatter precision to int (#87738) · d89da2ac
      Brian Cain authored
      __precision_ is declared as an int32_t which on some hexagon platforms
      is defined as a long.
      
      This change fixes errors like the ones below:
      
      In file included from
      /local/mnt/workspace/hex/llvm-project/libcxx/test/libcxx/diagnostics/format.nodiscard_extensions.compile.pass.cpp:19:
      In file included from
      /local/mnt/workspace/hex/obj_runtimes_hex88_qurt_v75_ON_ON_shared/include/c++/v1/format:202:
      In file included from
      /local/mnt/workspace/hex/obj_runtimes_hex88_qurt_v75_ON_ON_shared/include/c++/v1/__format/format_functions.h:29:
      
      /local/mnt/workspace/hex/obj_runtimes_hex88_qurt_v75_ON_ON_shared/include/c++/v1/__format/formatter_floating_point.h:700:17:
      error: no matching function for call to 'max'
      700 | int __p = std::max(1, (__specs.__has_precision() ?
      __specs.__precision_ : 6));
                |                 ^~~~~~~~
      
      /local/mnt/workspace/hex/obj_runtimes_hex88_qurt_v75_ON_ON_shared/include/c++/v1/__format/formatter_floating_point.h:771:25:
      note: in instantiation of function template specialization
      'std::__formatter::__format_floating_point<float, char,
      std::format_context>' requested here
      771 | return __formatter::__format_floating_point(__value, __ctx,
      __parser_.__get_parsed_std_specifications(__ctx));
                |                         ^
      
      /local/mnt/workspace/hex/obj_runtimes_hex88_qurt_v75_ON_ON_shared/include/c++/v1/__format/format_functions.h:284:42:
      note: in instantiation of function template specialization
      'std::__formatter_floating_point<char>::format<float,
      std::format_context>' requested here
      284 | __ctx.advance_to(__formatter.format(__arg, __ctx));
                |                                          ^
      
      /local/mnt/workspace/hex/obj_runtimes_hex88_qurt_v75_ON_ON_shared/include/c++/v1/__format/format_functions.h:429:15:
      note: in instantiation of function template specialization
      'std::__vformat_to<std::back_insert_iterator<std::string>, char,
      std::back_insert_iterator<std::__format::__output_buffer<char>>>'
      requested here
      429 | return std::__vformat_to(std::move(__out_it), __fmt, __args);
                |               ^
      
      /local/mnt/workspace/hex/obj_runtimes_hex88_qurt_v75_ON_ON_shared/include/c++/v1/__format/format_functions.h:462:8:
      note: in instantiation of function template specialization
      'std::vformat_to<std::back_insert_iterator<std::string>>' requested here
            462 |   std::vformat_to(std::back_inserter(__res), __fmt, __args);
                |        ^
      
      /local/mnt/workspace/hex/llvm-project/libcxx/test/libcxx/diagnostics/format.nodiscard_extensions.compile.pass.cpp:29:8:
      note: in instantiation of function template specialization
      'std::vformat<void>' requested here
             29 |   std::vformat("", std::make_format_args());
                |        ^
      
      /local/mnt/workspace/hex/obj_runtimes_hex88_qurt_v75_ON_ON_shared/include/c++/v1/__algorithm/max.h:35:1:
      note: candidate template ignored: deduced conflicting types for
      parameter '_Tp' ('int' vs. 'int32_t' (aka 'long'))
      35 | max(_LIBCPP_LIFETIMEBOUND const _Tp& __a, _LIBCPP_LIFETIMEBOUND
      const _Tp& __b) {
                | ^
      
      /local/mnt/workspace/hex/obj_runtimes_hex88_qurt_v75_ON_ON_shared/include/c++/v1/__algorithm/max.h:43:1:
      note: candidate template ignored: could not match
      'initializer_list<_Tp>' against 'int'
             43 | max(initializer_list<_Tp> __t, _Compare __comp) {
                | ^
      
      /local/mnt/workspace/hex/obj_runtimes_hex88_qurt_v75_ON_ON_shared/include/c++/v1/__algorithm/max.h:48:86:
      note: candidate function template not viable: requires single argument
      '__t', but 2 arguments were provided
      48 | _LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI
      _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp max(initializer_list<_Tp> __t) {
      | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~
      
      /local/mnt/workspace/hex/obj_runtimes_hex88_qurt_v75_ON_ON_shared/include/c++/v1/__algorithm/max.h:29:1:
      note: candidate function template not viable: requires 3 arguments, but
      2 were provided
      29 | max(_LIBCPP_LIFETIMEBOUND const _Tp& __a, _LIBCPP_LIFETIMEBOUND
      const _Tp& __b, _Compare __comp) {
      | ^
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      
      (cherry picked from commit e1830f58)
      d89da2ac
  6. Apr 11, 2024
  7. Apr 03, 2024
  8. Apr 02, 2024
  9. Mar 30, 2024
    • Xing Xue's avatar
      [OpenMP][AIX] Affinity implementation for AIX (#84984) · 47aac495
      Xing Xue authored
      This patch implements `affinity` for AIX, which is quite different from
      platforms such as Linux.
      - Setting CPU affinity through masks and related functions are not
      supported. System call `bindprocessor()` is used to bind a thread to one
      CPU per call.
      - There are no system routines to get the affinity info of a thread. The
      implementation of `get_system_affinity()` for AIX gets the mask of all
      available CPUs, to be used as the full mask only.
      - Topology is not available from the file system. It is obtained through
      system SRAD (Scheduler Resource Allocation Domain).
      
      This patch has run through the libomp LIT tests successfully with
      `affinity` enabled.
      
      (cherry picked from commit d394f3a1)
      47aac495
  10. Mar 29, 2024
    • Andrew Ng's avatar
      [Support] Fix color handling in formatted_raw_ostream (#86700) · a385a917
      Andrew Ng authored
      The color methods in formatted_raw_ostream were forwarding directly to
      the underlying stream without considering existing buffered output. This
      would cause incorrect colored output for buffered uses of
      formatted_raw_ostream.
      
      Fix this issue by applying the color to the formatted_raw_ostream itself
      and temporarily disabling scanning of any color related output so as not
      to affect the position tracking.
      
      This fix means that workarounds that forced formatted_raw_ostream
      buffering to be disabled can be removed. In the case of llvm-objdump,
      this can improve disassembly performance when redirecting to a file by
      more than an order of magnitude on both Windows and Linux. This
      improvement restores the disassembly performance when redirecting to a
      file to a level similar to before color support was added.
      
      (cherry picked from commit c9db031c)
      a385a917
    • Martin Storsjö's avatar
      Reapply [libcxx] [modules] Fix relative paths with absolute LIBCXX_INSTALL_MODULES_DIR (#86020) · 0cd4babe
      Martin Storsjö authored
      This reapplies 272d1b44 (from #85756),
      which was reverted in
      40793703.
      
      In the previous attempt, empty CMAKE_INSTALL_PREFIX was handled by
      quoting them, in d209d134. That made the
      calls to cmake_path(ABSOLUTE_PATH) succeed, but the output paths of that
      weren't actually absolute, which was required by file(RELATIVE_PATH).
      
      Avoid this issue by constructing a non-empty base directory variable
      to use for calculating the relative path.
      
      (cherry picked from commit 50801f10)
      0cd4babe
  11. Mar 28, 2024
    • Ulrich Weigand's avatar
      release/18.x: [SystemZ] Fix overflow flag for i128 USUBO (#86491) · cfaeee6a
      Ulrich Weigand authored
      We use the VSCBIQ/VSBIQ/VSBCBIQ family of instructions to implement
      USUBO/USUBO_CARRY for the i128 data type. However, these instructions
      use an inverted sense of the borrow indication flag (a value of 1
      indicates *no* borrow, while a value of 0 indicated borrow). This does
      not match the semantics of the boolean "overflow" flag of the
      USUBO/USUBO_CARRY ISD nodes.
      
      Fix this by generating code to explicitly invert the flag. These cancel
      out of the result of USUBO feeds into an USUBO_CARRY.
      
      To avoid unnecessary zero-extend operations, also improve the DAGCombine
      handling of ZERO_EXTEND to optimize (zext (xor (trunc))) sequences where
      appropriate.
      
      Fixes: https://github.com/llvm/llvm-project/issues/83268
      cfaeee6a
    • Arthur Eubanks's avatar
      [lld/ELF][X86] Respect outSecOff when checking if GOTPCREL can be relaxed (#86334) · 767b61c1
      Arthur Eubanks authored
      The existing implementation didn't handle when the input text section
      was some offset from the output section.
      
      This resulted in an assert in relaxGot() with an lld built with asserts
      for some large binaries, or even worse, a silently broken binary with an
      lld without asserts.
      
      (cherry picked from commit 48048051)
      767b61c1