1. Apr 06, 2024
    • Paul Kirth's avatar
      rebase · 90dc9ac8
      Paul Kirth authored
      Created using spr 1.3.4
      90dc9ac8
    • Paul Kirth's avatar
      [llvm][NFC] Update URL in comment about Android ABI · f0724f07
      Paul Kirth authored
      The previous URL was stale, and referenced 'master' instead of 'main',
      which will never be updated.
      
      Reviewers: topperc, enh-google
      
      Reviewed By: enh-google
      
      Pull Request: https://github.com/llvm/llvm-project/pull/87726
      f0724f07
    • Fangrui Song's avatar
      [llvm-ranlib] Change -v (alias for --version) to -V · 7e4883f8
      Fangrui Song authored
      -V prints the version information in both BSD and GNU ar/ranlib.
      
      BSD ranlib rejects -v while -v enables verbose output in GNU ar but is
      another alias for --version in GNU ranlib. The GNU ranlib behavior is
      inconsistent: `ranlib -v` is different from `ar -sv`. But it's not a
      major concern in practice:
      
      * Users typically use ranlib solely for creating archive symbol tables,
        and they don't need verbose output.
      * Verbose output in ranlib seems a no-op.
      * GNU ar creates an archive symbol table by default. Many ranlib uses
        have been eliminated.
      * Modern linkers like lld/ELF (since version 14) and mold don't rely on
        archive symbol tables anymore.
      
      https://reviews.llvm.org/D71554 introduced -v. This patch removes it so
      that `llvm-ranlib -v` and `llvm-ranlib -version` lead to errors (GNU
      ranlib rejects `-version` as well). -V is added as an alias for
      --version.
      
      Close #87654
      
      Pull Request: https://github.com/llvm/llvm-project/pull/87661
      7e4883f8
    • Eric's avatar
      Fix issue with never-constexpr __construct_at in C++ < 20. (#87403) · 29cc80f4
      Eric authored
      The application of constexpr to __construct_at triggers weird linker
      errors when building LLVM with modules enabled and C++ < 20.
      
      > ld.lld: error: undefined hidden symbol: void*
      std::__1::__voidify[abi:nn190000]<llvm::sys::ProcessStatistics>(llvm::sys::ProcessStatistics&)
      >>>> referenced by construct_at.h:52
      (/usr/local/bin/../include/c++/v1/__memory/construct_at.h:52)
      >>>> Program.cpp.o:(llvm::sys::Wait(llvm::sys::ProcessInfo const&,
      std::__1::optional<unsigned int>, std::__1::basic_string<char,
      std::__1::char_traits<char>, std::__1::allocator<char>>*,
      std::__1::optional<llvm::sys::ProcessStatistics>*, bool)) in archive
      lib/libLLVMSupport.a
      
      I suspect this is related to undefined behavior caused by the fact that
      construct_at is never really constexpr (which is UB NDR).
      
      I'm unsure how to meaningfully write a test for this, as I haven't been
      able to trigger it in smaller unit tests
      29cc80f4
    • Lang Hames's avatar
      [ORC] Fix an EDU-update bug in ExecutionSession::IL_failSymbols. · a671ceec
      Lang Hames authored
      We were catching a local variable, SymMI, by value instead of by reference
      during EDU cleanup and this was leaving the dependence graph in an
      inconsistent state that could lead to crashes on subsequent emits. Fixing this
      bug required us to also avoid aliasing between SymMI and MI (which would have
      caused cleanup to clear the MI.DependantEDUs set that we're iterating over).
      
      No testcase: the crash only triggered in very specific circumstances
      (including concurrent linking) in an out-of-tree ORC client. I'm working on a
      session state verifier that could be turned on when compiling with
      expensive-checks turned on and that should help us catch issues like this in
      the future.
      
      rdar://125164262
      
      Coding my way home: 0.89527S, 89.61313W
      a671ceec
    • Valentin Clement (バレンタイン クレメン)'s avatar
      [flang][cuda] Lower device to host and device to device transfer (#87387) · 953aa102
      Add more support for CUDA data transfer in assignment. This patch adds
      device to device and device to host support. If device symbols are
      present on the rhs, some implicit data transfer are initiated. A
      temporary is created and the data are transferred to the host. The
      expression is evaluated on the host and the assignment is done.
      953aa102
    • Vitaly Buka's avatar
      [clang][CodeGen] Guard ubsan checks with `llvm.allow.ubsan.check` (#87436) · 5f9ed2ff
      Vitaly Buka authored
      Intrinsic inserted into CodeGenFunction::EmitCheck, which
      is not mostly used by CFI.
      
      CFI is not the goal, and fixing inconsistencies with CFI is outside of
      the cope of the patch.
      
      RFC:
      https://discourse.llvm.org/t/rfc-add-llvm-experimental-hot-intrinsic-or-llvm-hot/77641
      5f9ed2ff
    • Brian Cain's avatar
      [libcxx] coerce formatter precision to int (#87738) · e1830f58
      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) {
      | ^
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      e1830f58
  2. Apr 05, 2024