1. Apr 06, 2022
    • Fangrui Song's avatar
      [llvm-objdump] --private-headers: change errors to warnings for dynamic section dumping · 1007cb79
      Fangrui Song authored
      Fix #54456: `objcopy --only-keep-debug` produces a linked image with invalid
      empty dynamic section. llvm-objdump -p currently reports an error which seems
      excessive.
      
      ```
      % llvm-readelf -l a.out
      llvm-readelf: warning: 'a.out': no valid dynamic table was found
      ...
      ```
      
      Follow the spirit of llvm-readelf -l (D64472) and report a warning instead.
      This allows later files to be dumped despite warnings for an input file, and
      improves objdump compatibility in that the exit code is now 0 instead of 1.
      
      ```
      % llvm-objdump -p a.out  # new behavior
      ...
      Program Header:
      llvm-objdump: warning: 'a.out': invalid empty dynamic section
      % objdump -p a.out
      ...
      Dynamic Section:
      
      ```
      
      Reviewed By: jhenderson, raj.khem
      
      Differential Revision: https://reviews.llvm.org/D122505
      
      (cherry picked from commit 11a8fc68)
      1007cb79
    • Fangrui Song's avatar
      [llvm-objdump][test] dos2unix some files · c9ec4902
      Fangrui Song authored
      (cherry picked from commit 423af54c)
      c9ec4902
    • Craig Topper's avatar
      [SelectionDAG][RISCV] Make RegsForValue::getCopyToRegs explicitly zero_extend constants. · 5b9dd016
      Craig Topper authored
      ComputePHILiveOutRegInfo assumes that constant incoming values to
      Phis will be zero extended if they aren't a legal type. To guarantee
      that we should zero_extend rather than any_extend constants.
      
      This fixes a bug for RISCV where any_extend of constants can be
      treated as a sign_extend.
      
      Differential Revision: https://reviews.llvm.org/D122053
      
      (cherry picked from commit 4eb59f01)
      5b9dd016
    • Craig Topper's avatar
      [RISCV] Add test case for miscompile caused by treating ANY_EXTEND of constants as SIGN_EXTEND. · e9b26b5b
      Craig Topper authored
      The code that inserts AssertZExt based on predecessor information assumes
      constants are zero extended for phi incoming values this allows
      AssertZExt to be created in blocks consuming a Phi.
      SelectionDAG::getNode treats any_extend of i32 constants as sext for RISCV.
      The code that creates phi incoming values in the predecessors creates an
      any_extend for the constants which then gets treated as a sext by getNode.
      This makes the AssertZExt incorrect and can cause zexts to be
      incorrectly removed.
      
      This bug was introduced by D105918
      
      Differential Revision: https://reviews.llvm.org/D122052
      
      (cherry picked from commit 268371cf)
      e9b26b5b
    • Martin Storsjö's avatar
      [libcxx] [test] Avoid spurious test breakage in clang-cl-dll configs with newer CMake · a4681df0
      Martin Storsjö authored
      The pointer.volatile.pass.cpp test was already marked as XFAIL for
      mingw-dll (for reasons explained in the comment above it).
      
      The same issue also appears in clang-cl-dll when built with newer
      CMake versions. (It didn't appear with older versions of CMake, as
      CMake built the library with the clang-cl flag `-std:c++latest` when
      we've requested C++ 20 - which practically built it in c++2b mode with
      current clang versions. With current versions of CMake, it passes
      `-std:c++20` instead.)
      
      As it succeeds/fails dependent on factors we don't
      directly control, mark it as UNSUPPORTED instead of XFAIL.
      
      Differential Revision: https://reviews.llvm.org/D122718
      
      (cherry picked from commit b048397d)
      a4681df0
    • Fangrui Song's avatar
      [MC] Fix llvm_unreachable when a STB_GNU_UNIQUE symbol needs a relocation · db07d9f0
      Fangrui Song authored
      STB_GNU_UNIQUE should be treated in a way similar to STB_GLOBAL.
      This fixes an "Invalid Binding" failure in an LLVM_ENABLE_ASSERTIONS=on build
      for source files like glibc elf/tst-unique1mod1.c .
      
      This bug has been benign so far because (a) Clang does not produce
      %gnu_unique_object by itself (b) a non-assertion build likely picks the
      STB_GLOBAL code path anyway.
      
      (cherry picked from commit 6bdad85b)
      db07d9f0
    • Aaron Puchert's avatar
      [PPCISelLowering] Avoid emitting calls to __multi3, __muloti4 · 22d7bee0
      Aaron Puchert authored
      After D108936, @llvm.smul.with.overflow.i64 was lowered to __multi3
      instead of __mulodi4, which also doesn't exist on PowerPC 32-bit, not
      even with compiler-rt. Block it as well so that we get inline code.
      
      Because libgcc doesn't have __muloti4, we block that as well.
      
      Fixes #54460.
      
      Reviewed By: craig.topper
      
      Differential Revision: https://reviews.llvm.org/D122090
      22d7bee0
  2. Apr 02, 2022
  3. Mar 31, 2022
  4. Mar 22, 2022
  5. Mar 16, 2022
    • Louis Dionne's avatar
      [libc++] Add workaround to avoid breaking users of <span> when <ranges> are disabled · add3ab7f
      Louis Dionne authored
      Back in 3a208c68, we implemented the range-based constructor for <span>.
      However, in doing so, we removed a previous non-standard constructor that
      we provided before shipping <ranges>. Unfortunately, that breaks code that
      was relying on a range-based constructor until we ship all of <ranges>.
      
      This patch reintroduces the old non-conforming constructors and tests
      that were removed in 3a208c68 and uses them whenever <ranges> is
      not provided (e.g. in LLVM 14). This is only a temporary workaround
      until we enable <ranges> by default in C++20, which should hopefully
      happen by LLVM 15.
      
      The goal is to cherry-pick this workaround back to the LLVM 14 release
      branch, since I suspect the constructor removal may otherwise cause
      breakage out there, like the breakage I saw internally.
      
      We could have avoided this situation by waiting for C++20 to be finalized
      before shipping std::span. For example, we could have guarded it with
      something like _LIBCPP_HAS_NO_INCOMPLETE_RANGES to prevent users from
      accidentally starting to depend on it before it is stable. We did not
      have these mechanisms when std::span was first implemented, though.
      
      NOTE: This is a pretty modified version of d4c39f1a since that one
      didn't apply properly onto the release/14.x branch.
      
      (cherry picked from commit d4c39f1a)
      
      Differential Revision: https://reviews.llvm.org/D121739
      add3ab7f
  6. Mar 14, 2022
  7. Mar 12, 2022
  8. Mar 11, 2022
  9. Mar 09, 2022
  10. Mar 08, 2022