-
- Downloads
LoongArch: Use explicit relocs for GOT access when -mexplicit-relocs=auto and...
LoongArch: Use explicit relocs for GOT access when -mexplicit-relocs=auto and LTO during a final link with linker plugin If we are performing LTO for a final link and linker plugin is enabled, then we are sure any GOT access may resolve to a symbol out of the link unit (otherwise the linker plugin will tell us the symbol should be resolved locally and we'll use PC-relative access instead). Produce machine instructions with explicit relocs instead of la.global for better scheduling. gcc/ChangeLog: * config/loongarch/loongarch-protos.h (loongarch_explicit_relocs_p): Declare new function. * config/loongarch/loongarch.cc (loongarch_explicit_relocs_p): Implement. (loongarch_symbol_insns): Call loongarch_explicit_relocs_p for SYMBOL_GOT_DISP, instead of using TARGET_EXPLICIT_RELOCS. (loongarch_split_symbol): Call loongarch_explicit_relocs_p for deciding if return early, instead of using TARGET_EXPLICIT_RELOCS. (loongarch_output_move): CAll loongarch_explicit_relocs_p instead of using TARGET_EXPLICIT_RELOCS. * config/loongarch/loongarch.md (*low<mode>): Remove TARGET_EXPLICIT_RELOCS from insn condition. (@ld_from_got<mode>): Likewise. * config/loongarch/predicates.md (move_operand): Call loongarch_explicit_relocs_p instead of using TARGET_EXPLICIT_RELOCS. gcc/testsuite/ChangeLog: * gcc.target/loongarch/explicit-relocs-auto-lto.c: New test.
Showing
- gcc/config/loongarch/loongarch-protos.h 1 addition, 0 deletionsgcc/config/loongarch/loongarch-protos.h
- gcc/config/loongarch/loongarch.cc 27 additions, 7 deletionsgcc/config/loongarch/loongarch.cc
- gcc/config/loongarch/loongarch.md 2 additions, 2 deletionsgcc/config/loongarch/loongarch.md
- gcc/config/loongarch/predicates.md 3 additions, 5 deletionsgcc/config/loongarch/predicates.md
- gcc/testsuite/gcc.target/loongarch/explicit-relocs-auto-lto.c 26 additions, 0 deletions...testsuite/gcc.target/loongarch/explicit-relocs-auto-lto.c
Loading
Please register or sign in to comment