[all-commits] [llvm/llvm-project] c2ee21: [LoongArch] Add some fixups and relocations

wangleiat via All-commits all-commits at lists.llvm.org
Fri Aug 19 20:46:31 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c2ee21cf3f863dbe48bd6decf896b41891808647
      https://github.com/llvm/llvm-project/commit/c2ee21cf3f863dbe48bd6decf896b41891808647
  Author: wanglei <wanglei at loongson.cn>
  Date:   2022-08-20 (Sat, 20 Aug 2022)

  Changed paths:
    M llvm/lib/Target/LoongArch/AsmParser/LoongArchAsmParser.cpp
    M llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp
    M llvm/lib/Target/LoongArch/LoongArchInstrInfo.td
    M llvm/lib/Target/LoongArch/LoongArchMCInstLower.cpp
    M llvm/lib/Target/LoongArch/MCTargetDesc/CMakeLists.txt
    M llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchAsmBackend.cpp
    M llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchAsmBackend.h
    M llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchBaseInfo.h
    M llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchELFObjectWriter.cpp
    A llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchFixupKinds.h
    M llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchMCCodeEmitter.cpp
    A llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchMCExpr.cpp
    A llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchMCExpr.h
    M llvm/test/CodeGen/LoongArch/analyze-branch.ll
    M llvm/test/CodeGen/LoongArch/bnez-beqz.ll
    M llvm/test/CodeGen/LoongArch/calling-conv-lp64d.ll
    M llvm/test/CodeGen/LoongArch/eh-dwarf-cfa.ll
    M llvm/test/CodeGen/LoongArch/frame.ll
    M llvm/test/CodeGen/LoongArch/fsqrt.ll
    M llvm/test/CodeGen/LoongArch/ir-instruction/call.ll
    M llvm/test/CodeGen/LoongArch/ir-instruction/double-convert.ll
    M llvm/test/CodeGen/LoongArch/ir-instruction/float-convert.ll
    M llvm/test/CodeGen/LoongArch/ir-instruction/load-store-atomic.ll
    M llvm/test/CodeGen/LoongArch/ir-instruction/load-store.ll
    M llvm/test/CodeGen/LoongArch/ir-instruction/sdiv-udiv-srem-urem.ll
    M llvm/test/CodeGen/LoongArch/vararg.ll
    M llvm/test/MC/LoongArch/Basic/Integer/invalid.s
    M llvm/test/MC/LoongArch/Basic/Integer/invalid64.s
    A llvm/test/MC/LoongArch/Relocations/relocations.s
    M llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/loongarch_generated_funcs.ll.generated.expected
    M llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/loongarch_generated_funcs.ll.nogenerated.expected

  Log Message:
  -----------
  [LoongArch] Add some fixups and relocations

This patch only add %pc_hi20/%pc_lo12/%plt relocations in order
to be able to generate gnu ld linkable relocation file for the
`hello world` IR :
```
@.str = private unnamed_addr constant [14 x i8] c"Hello world!\0A\00", align 1

define dso_local signext i32 @main() nounwind {
entry:
  %call = call signext i32 (ptr, ...) @printf(ptr noundef @.str)
  ret i32 0
}

declare dso_local signext i32 @printf(ptr noundef, ...)
```

This patch also updates some test cases due to new modifiers introduced.
New test: test/MC/LoongArch/Relocations/relocations.s

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




More information about the All-commits mailing list