[llvm] [LoongArch] Allow delayed decision for ADD/SUB relocations (PR #72960)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 21 08:48:27 PST 2023


================
@@ -106,7 +106,20 @@ enum Fixups {
   // 20-bit fixup corresponding to %gd_pc_hi20(foo) for instruction pcalau12i.
   fixup_loongarch_tls_gd_pc_hi20,
   // 20-bit fixup corresponding to %gd_hi20(foo) for instruction lu12i.w.
-  fixup_loongarch_tls_gd_hi20
+  fixup_loongarch_tls_gd_hi20,
+  // ADD and SUB fixups.
+  fixup_loongarch_add6 = FirstLiteralRelocationKind + ELF::R_LARCH_ADD6,
+  fixup_loongarch_sub6 = FirstLiteralRelocationKind + ELF::R_LARCH_SUB6,
+  fixup_loongarch_add8 = FirstLiteralRelocationKind + ELF::R_LARCH_ADD8,
+  fixup_loongarch_sub8 = FirstLiteralRelocationKind + ELF::R_LARCH_SUB8,
+  fixup_loongarch_add16 = FirstLiteralRelocationKind + ELF::R_LARCH_ADD16,
----------------
MaskRay wrote:

We don't need these fixup kinds. Just use `FirstLiteralRelocationKind + ELF::R_LARCH_ADD16` at the call site.

https://github.com/llvm/llvm-project/pull/72960


More information about the llvm-commits mailing list