On 10/27/23 13:04, Robin Dapp wrote:
After working with Sam off-list (thanks) I managed to get hppa to
build.  Initially it looked as if hppa just had a very small number of
instruction patterns so we wouldn't generate all 10 output files.
However, the actual issue (which we will only hit with a low
pattern count) was with counting all the patterns vs only counting
the patterns that will be output.  A wrong pattern count lead to
prematurely stopping to write output files.

With that corrected, hppa "just works" until I hit linker errors
due to relocations - most likely unrelated:

bin/ld: unwind-dw2-fde-dip_s.o(.data.rel.ro+0): cannot handle
R_PARISC_FPTR64 for __pthread_key_create@@GLIBC_2.34

Attached is v3 that has been bootstrapped and tested on x86 and power10,
aarch64 bootstrap was ok, testsuite is still running.  A riscv build and
testsuite run was successful as well.

Regards
  Robin

 From 248744c328440bff9cc339d2bf622852cbaac343 Mon Sep 17 00:00:00 2001
From: Robin Dapp <rd...@ventanamicro.com>
Date: Thu, 12 Oct 2023 11:23:26 +0200
Subject: [PATCH v3] genemit: Split insn-emit.cc into several partitions.

On riscv insn-emit.cc has grown to over 1.2 mio lines of code and
compiling it takes considerable time.
Therefore, this patch adjust genemit to create several partitions
(insn-emit-1.cc to insn-emit-n.cc).  The available patterns are
written to the given files in a sequential fashion.

Similar to match.pd a configure option --with-emitinsn-partitions=num
is introduced that makes the number of partition configurable.

gcc/ChangeLog:

        PR bootstrap/84402
        PR target/111600

        * Makefile.in: Handle split insn-emit.cc.
        * configure: Regenerate.
        * configure.ac: Add --with-insnemit-partitions.
        * genemit.cc (output_peephole2_scratches): Print to file instead
        of stdout.
        (print_code): Ditto.
        (gen_rtx_scratch): Ditto.
        (gen_exp): Ditto.
        (gen_emit_seq): Ditto.
        (emit_c_code): Ditto.
        (gen_insn): Ditto.
        (gen_expand): Ditto.
        (gen_split): Ditto.
        (output_add_clobbers): Ditto.
        (output_added_clobbers_hard_reg_p): Ditto.
        (print_overload_arguments): Ditto.
        (print_overload_test): Ditto.
        (handle_overloaded_code_for): Ditto.
        (handle_overloaded_gen): Ditto.
        (print_header): New function.
        (handle_arg): New function.
        (main): Split output into 10 files.
        * gensupport.cc (count_patterns): New function.
        * gensupport.h (count_patterns): Define.
        * read-md.cc (md_reader::print_md_ptr_loc): Add file argument.
        * read-md.h (class md_reader): Change definition.
Just one note on testing. I threw this into my tester which ran through its usual set of crosses as well as native emulated builds of alpha, hppa, m68k, sh4, sh4eb, riscv, aarch64. s390x and ppc64le are in progress, and have progressed beyond their build phase. Note that the emulated natives other than risc-v are 3-stage bootstrapped.

OK for the trunk. Thanks for taking care of this. I guess I'll need to time a risc-v bootstrap again. It's currently using --disable-bootstrap at configure time in my tester.


jeff

Reply via email to