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

Jonathon Penix via All-commits all-commits at lists.llvm.org
Mon Sep 16 11:31:38 PDT 2024


  Branch: refs/heads/release/19.x
  Home:   https://github.com/llvm/llvm-project
  Commit: a847b66a750291f8b63c03b9f355c6f4d09cdfe3
      https://github.com/llvm/llvm-project/commit/a847b66a750291f8b63c03b9f355c6f4d09cdfe3
  Author: Jonathon Penix <jpenix at quicinc.com>
  Date:   2024-09-16 (Mon, 16 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

(cherry picked from commit 866b93e6b33fac9a4bc62bbc32199bd98f434784)



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