[all-commits] [llvm/llvm-project] 67b075: [ARM] Add a baseline elf-preemption test

Alexander Richardson via All-commits all-commits at lists.llvm.org
Tue Aug 9 02:54:06 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 67b075319b17450705483628c87631e3336e110d
      https://github.com/llvm/llvm-project/commit/67b075319b17450705483628c87631e3336e110d
  Author: Alex Richardson <alexrichardson at google.com>
  Date:   2022-08-09 (Tue, 09 Aug 2022)

  Changed paths:
    A llvm/test/CodeGen/ARM/elf-preemption.ll

  Log Message:
  -----------
  [ARM] Add a baseline elf-preemption test

This is based on the RISC-V elf-preemption.ll (converted to opaque
pointers) and is useful for test coverage for the patch series starting
with D131392.


  Commit: 7925341d9332118c8f3469013b08cdcd9016749c
      https://github.com/llvm/llvm-project/commit/7925341d9332118c8f3469013b08cdcd9016749c
  Author: Alex Richardson <alexrichardson at google.com>
  Date:   2022-08-09 (Tue, 09 Aug 2022)

  Changed paths:
    A llvm/test/CodeGen/ARM/dso-local-func.ll

  Log Message:
  -----------
  [ARM] Add a baseline test for D131392

We should be emitting .Lfoo$local aliases for dso_local functions.


  Commit: 9a2b14afa02e46acbc7838bafa8d9e59b7cc86b8
      https://github.com/llvm/llvm-project/commit/9a2b14afa02e46acbc7838bafa8d9e59b7cc86b8
  Author: Alex Richardson <alexrichardson at google.com>
  Date:   2022-08-09 (Tue, 09 Aug 2022)

  Changed paths:
    M llvm/lib/Target/ARM/ARMAsmPrinter.cpp
    M llvm/test/CodeGen/ARM/dso-local-func.ll
    M llvm/utils/UpdateTestChecks/asm.py

  Log Message:
  -----------
  [ARM] Emit local aliases (.Lfoo$local) for functions

ARMAsmPrinter::emitFunctionEntryLabel() was not calling the base class
function so the $local alias was not being emitted. This should not have
any function effect right now since ARM does not generate different code
for the $local symbols, but it could be improved in the future.

Reviewed By: MaskRay

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


  Commit: fa210dd67b458f7a11631c7fb2eebb05f4849ce5
      https://github.com/llvm/llvm-project/commit/fa210dd67b458f7a11631c7fb2eebb05f4849ce5
  Author: Alex Richardson <alexrichardson at google.com>
  Date:   2022-08-09 (Tue, 09 Aug 2022)

  Changed paths:
    A llvm/test/CodeGen/ARM/thumb-function-section-reloc.ll

  Log Message:
  -----------
  [Thumb] Baseline test for incorrect relocation with -ffunction-sections

When calling a dso_local function, we end up creating a call against the
.Lfoo$local label. This might be converted to a relocation against a
section if there is such a matching one (which is a lot more likely with
-ffunction-sections) and then the LSB (Thumb flag) will be lost.

I originally noticed this with Morello LLVM (which uses the LSB to indicate
a C64 encoding mode function). The missing LSB meant that ld.lld would
insert a thunk that switches encoding mode which then resulted in errors
at runtime since functions were being entered with the wrong encoding mode.
Since the Morello backend is not upstream, I looked if any in-tree
backends could also be affected by the missing STT_FUNC flag and noticed
that Thumb is also affected (although the bug is rather difficult to
trigger - it currently requires inline assembly).

Reviewed By: MaskRay

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


  Commit: 6db15a82cc0966458c2b7d84b39f42ef09d2ac20
      https://github.com/llvm/llvm-project/commit/6db15a82cc0966458c2b7d84b39f42ef09d2ac20
  Author: Alex Richardson <alexrichardson at google.com>
  Date:   2022-08-09 (Tue, 09 Aug 2022)

  Changed paths:
    M llvm/lib/Target/ARM/ARMAsmPrinter.cpp
    M llvm/test/CodeGen/ARM/dso-local-func.ll
    M llvm/test/CodeGen/ARM/elf-preemption.ll
    M llvm/test/CodeGen/ARM/thumb-function-section-reloc.ll

  Log Message:
  -----------
  [ARM] Use getSymbolPreferLocal() in GetARMGVSymbol

This allows relaxing some relocations to STT_SECTION symbol+offset
instead of emitting a relocation against a symbol.

Reviewed By: MaskRay

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


Compare: https://github.com/llvm/llvm-project/compare/adb0cd62a98c...6db15a82cc09


More information about the All-commits mailing list