[PATCH] D132108: [LoongArch] Add some fixups and relocations

Ray Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 18 00:34:54 PDT 2022


wangleiat created this revision.
wangleiat added reviewers: xen0n, SixWeining, xry111, gonglingqin, MaskRay.
Herald added subscribers: StephenFan, hiraditya, arichardson, mgorny.
Herald added a project: All.
wangleiat requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

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 updated some test cases due to new modifiers.
New test: test/MC/LoongArch/Relocations/relocations.s


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D132108

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D132108.453547.patch
Type: text/x-patch
Size: 70476 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220818/b29b3d39/attachment.bin>


More information about the llvm-commits mailing list