[all-commits] [llvm/llvm-project] 866b93: [RISCV] Don't outline pcrel_lo when the function h...

Jonathon Penix via All-commits all-commits at lists.llvm.org
Wed Sep 11 09:53:32 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 866b93e6b33fac9a4bc62bbc32199bd98f434784
      https://github.com/llvm/llvm-project/commit/866b93e6b33fac9a4bc62bbc32199bd98f434784
  Author: Jonathon Penix <jpenix at quicinc.com>
  Date:   2024-09-11 (Wed, 11 Sep 2024)

  Changed paths:
    M llvm/lib/Target/RISCV/RISCVInstrInfo.cpp
    M llvm/test/CodeGen/RISCV/machineoutliner-pcrel-lo.mir

  Log Message:
  -----------
  [RISCV] Don't outline pcrel_lo when the function has a section prefix (#107943)

GNU ld will error when encountering a pcrel_lo whose corresponding
pcrel_hi is in a different section. [1] introduced a check to help
prevent this issue by preventing outlining in a few circumstances.
However, we can also hit this same issue when outlining from functions
with prefixes ("hot"/"unlikely"/"unknown" from profile information, for
example) as the outlined function might not have the same prefix,
possibly resulting in a "paired" pcrel_lo and pcrel_hi ending up in
different sections.

To prevent this issue, take a similar approach as [1] and additionally
prevent outlining when we see a pcrel_lo and the function has a prefix.

[1]
https://github.com/llvm/llvm-project/commit/96c85f80f0d615ffde0f85d8270e0a8c9f4e5430

Fixes #107520



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list