[all-commits] [llvm/llvm-project] a8081e: [LoongArch] Allow delayed decision for ADD/SUB rel...

Jinyang He via All-commits all-commits at lists.llvm.org
Tue Dec 19 18:55:04 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a8081ed8ff0fd11fb8d5f4c83df49da909e49612
      https://github.com/llvm/llvm-project/commit/a8081ed8ff0fd11fb8d5f4c83df49da909e49612
  Author: Jinyang He <hejinyang at loongson.cn>
  Date:   2023-12-20 (Wed, 20 Dec 2023)

  Changed paths:
    M llvm/lib/MC/MCExpr.cpp
    M llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchAsmBackend.cpp
    M llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchAsmBackend.h
    M llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchFixupKinds.h
    A llvm/test/MC/LoongArch/Misc/subsection.s
    A llvm/test/MC/LoongArch/Relocations/relax-addsub.s

  Log Message:
  -----------
  [LoongArch] Allow delayed decision for ADD/SUB relocations (#72960)

Refer to RISCV [1], LoongArch also need delayed decision for ADD/SUB
relocations. In handleAddSubRelocations, just return directly if SecA !=
SecB, handleFixup usually will finish the the rest of creating PCRel
relocations works. Otherwise we emit relocs depends on whether
relaxation is enabled. If not, we return true and avoid record ADD/SUB
relocations.
Now the two symbols separated by alignment directive will return without
folding symbol offset in AttemptToFoldSymbolOffsetDifference, which has
the same effect when relaxation is enabled.

[1] https://reviews.llvm.org/D155357




More information about the All-commits mailing list