[all-commits] [llvm/llvm-project] 4f243f: [test] Improve MC/RISCV/riscv64-64b-pcrel.s

Tobias Hieta via All-commits all-commits at lists.llvm.org
Mon Mar 27 23:55:57 PDT 2023


  Branch: refs/heads/release/16.x
  Home:   https://github.com/llvm/llvm-project
  Commit: 4f243f13785931667440be264ab96c55159dbfd2
      https://github.com/llvm/llvm-project/commit/4f243f13785931667440be264ab96c55159dbfd2
  Author: Fangrui Song <i at maskray.me>
  Date:   2023-03-28 (Tue, 28 Mar 2023)

  Changed paths:
    M llvm/test/MC/RISCV/riscv64-64b-pcrel.s

  Log Message:
  -----------
  [test] Improve MC/RISCV/riscv64-64b-pcrel.s

(cherry picked from commit 97f6283c634a5797cc51ba715bbcd4662a4dc00f)


  Commit: ee1493c713d69bcc9329923c132f8befd79dcc65
      https://github.com/llvm/llvm-project/commit/ee1493c713d69bcc9329923c132f8befd79dcc65
  Author: Fangrui Song <i at maskray.me>
  Date:   2023-03-28 (Tue, 28 Mar 2023)

  Changed paths:
    M llvm/test/MC/RISCV/riscv64-64b-pcrel.s

  Log Message:
  -----------
  [test] Improve MC/RISCV/riscv64-64b-pcrel.s to demonstrate regression due to D132262

(cherry picked from commit feb3432a4e9448cee425e610af5b62567a298e2c)


  Commit: 34194d85544f9c5295d244ca91e35abcfef98f19
      https://github.com/llvm/llvm-project/commit/34194d85544f9c5295d244ca91e35abcfef98f19
  Author: Fangrui Song <i at maskray.me>
  Date:   2023-03-28 (Tue, 28 Mar 2023)

  Changed paths:
    M llvm/test/MC/RISCV/riscv64-64b-pcrel.s

  Log Message:
  -----------
  [test] Add some interesting cases to MC/RISCV/riscv64-64b-pcrel.s

(cherry picked from commit c598828b1beb8a67271b5e56cb7033ae4e40da88)


  Commit: 1c1ab11d6e1e45a49fd543fa485d2b1701487e06
      https://github.com/llvm/llvm-project/commit/1c1ab11d6e1e45a49fd543fa485d2b1701487e06
  Author: Fangrui Song <i at maskray.me>
  Date:   2023-03-28 (Tue, 28 Mar 2023)

  Changed paths:
    M llvm/lib/Target/RISCV/MCTargetDesc/RISCVELFStreamer.cpp
    M llvm/test/MC/RISCV/riscv64-64b-pcrel.s

  Log Message:
  -----------
  [RISCV][MC] Adjust conditions to emit R_RISCV_ADD*/R_RISCV_SUB* pairs

D132262 tried to simplify `IsMetadataOrEHFrameSection` originally introduced in
D127549 but caused a regression as `.quad` directives in

```
.section .note,"a", at note; note:
.quad extern-note    # extern is undefined

.section .rodata,"a", at progbits; rodata:
.quad extern-rodata  # extern is undefined

.section .nonalloc,"", at progbits; nw:
.quad extern-nw
```

are incorrectly rejected: these differences may be link-time constants and
are allowed in GNU assembler and LLVM MC's non-RISC-V ports.

Relax the conditions to allow these cases. For A-B, A may be defined later, but
this requiresFixups call has to eagerly make a decision. For now, emit ADD/SUB
unless A is `.L*`. This euristic handles many temporary label differences for
.debug_* and .apple_types sections. Ideally we should delay the decision of
PC-relative vs ADD/SUB until A is defined.

Reviewed By: compnerd

Differential Revision: https://reviews.llvm.org/D145474

(cherry picked from commit 2f5fe16e6d29c55ebd9ec098b03d4de47a804a18)


  Commit: c2ef3257df81b8e3f5f4313939ff536a81d7cde0
      https://github.com/llvm/llvm-project/commit/c2ef3257df81b8e3f5f4313939ff536a81d7cde0
  Author: Rafael Auler <rafaelauler at fb.com>
  Date:   2023-03-28 (Tue, 28 Mar 2023)

  Changed paths:
    M bolt/lib/Core/JumpTable.cpp

  Log Message:
  -----------
  [BOLT][NFC] Remove C-style out of bounds array ref

Old code breaks build with libstdc++ with assertions. Fix it.

(cherry picked from commit 7768f63e5b7adc8a92b8f8041e9c1d298b011128)


  Commit: a18482ac5089d7eec2321711b2428a2ed63edf02
      https://github.com/llvm/llvm-project/commit/a18482ac5089d7eec2321711b2428a2ed63edf02
  Author: Denis Revunov <revunov.denis at huawei-partners.com>
  Date:   2023-03-28 (Tue, 28 Mar 2023)

  Changed paths:
    M bolt/lib/Passes/ADRRelaxationPass.cpp
    M bolt/test/runtime/AArch64/adrrelaxationpass.s

  Log Message:
  -----------
  [BOLT][AArch64] Replace NOP with adrp in AdrRelaxationPass to preserve relative offsets.

Avoid replacing one adr instruction with two adrp+add by utilizing linker-provided nops
when they are present. By doing so we preserve relative offsets of next instructions
in a function which reduces chances to break undetected jump tables. This commit makes
release-mode lld-linked clang, lld and etc work after BOLT.

Reviewed By: rafauler, yota9

Differential Revision: https://reviews.llvm.org/D143887


  Commit: 140c68db4fe4d37274c4f3322a058a7a26e45537
      https://github.com/llvm/llvm-project/commit/140c68db4fe4d37274c4f3322a058a7a26e45537
  Author: Nikolas Klauser <nikolasklauser at berlin.de>
  Date:   2023-03-28 (Tue, 28 Mar 2023)

  Changed paths:
    M libcxx/include/__expected/expected.h
    M libcxx/include/__memory/uninitialized_algorithms.h
    M libcxx/include/__memory_resource/polymorphic_allocator.h
    M libcxx/include/__utility/exception_guard.h
    A libcxx/test/libcxx/utilities/exception_guard.odr.sh.cpp

  Log Message:
  -----------
  [libc++] Avoid ODR violations in __exception_guard

Having an ODR violation with `__exception_guard` seems to be problematic in LTO builds. To avoid the ODR violation, give the class different names for exception/no-exceptions mode and have an alias to the correct class.

Reviewed By: ldionne, #libc, alexfh

Spies: aeubanks, dblaikie, joanahalili, alexfh, rupprecht, libcxx-commits

Differential Revision: https://reviews.llvm.org/D143071

(cherry picked from commit 1a17739d3aa78599c32f6106e05dcfa7f3f9e823)


  Commit: 973cea75544001fcb06a315b7190ce164793d9e7
      https://github.com/llvm/llvm-project/commit/973cea75544001fcb06a315b7190ce164793d9e7
  Author: yavtuk <yavtuk at ya.ru>
  Date:   2023-03-28 (Tue, 28 Mar 2023)

  Changed paths:
    M bolt/lib/Rewrite/RewriteInstance.cpp
    A bolt/test/AArch64/Inputs/array_end.lld_script
    A bolt/test/AArch64/array_end.c

  Log Message:
  -----------
  [BOLT] Search section based on relocation symbol

We need to search referenced section based on relocations symbol section
to properly match end section symbols. For example on some binaries we
can observe that init_array_end/fini_array_end might be "placed" in to
the gap and since no section could be found for address the relocation
would be skipped resulting in wrong ADRP imm after emitting new text
resulting in binary sigsegv.

Credits for the test to Vladislav Khmelevskii aka yota9.

(cherry picked from commit 0776fc32b15dc76c6b43c41fc4471552833265de)


Compare: https://github.com/llvm/llvm-project/compare/1f9ea2d3f045...973cea755440


More information about the All-commits mailing list