[PATCH 1/2] New pass to partition single function into multiple sections

Revital1 Eres ERES@il.ibm.com
Mon Aug 18 09:03:00 GMT 2008


Hello,

> I am currently testing the patch on powerpc64, SPU and x86_64.
> Comments more than are welcome. OK for mainline once testing completes?

Attached is an updated version of the patch (which contains a minor
change in cfgrtl.c).
It passes full bootstrap and regtest on powerpc64 and x86_64. On SPU it
passes regtest (c, c++, and fortran). It also passes bootstrap with the
new flag enabled on x86_64.

OK for mainline?

Thanks,
Revital

Changelog:

        * doc/invoke: Document -fpartition-functions-into-sections
        new flag.
        * tree-pass.h (pass_partition_functions): Add new RTL pass.
        (TODO_check_sections): Define.
        * target.h (est_section_overhead, est_instruction_size
        part_func_to_sections_flags, begin_critical_section,
        end_critical_section, record_jump_table): Declare new
        machine-dependent functions to support function partitioning.
        * final.c (final_scan_insn): Support new functionality.
        (pass_clean_state): Add TODO_check_sections to todo_flags_start.?
        field.
        * toplev.c (general_init): Disable
        -fpartition-functions-into-sections if profile_flag is set or
        -ffunction-sections is not supported.
        * opts.c (common_handle_option): Handle
        OPT_fpartition_functions_into_sections.
        (decode_options): Disable the new functionality if
        HAS_LONG_COND_BRANCH or HAS_LONG_UNCOND_BRANCH are not defined
        or target does not supports have_named_sections.  Issue a
        warning that it doesn't work.
        * timevar.def (TV_FUNCTION_PARTITION): New.
        * function.h (section_start_labels, section_end_labels,
        unlikely_part_text_section_name, part_text_section_name,
        number_of_sections, first_text_section_part_changed): New fields?
        to function_subsections struct.
        (char_p): Define and DEF_VEC.
        * print-rtl.c (print_rtx): Avoid printing the basic-block number?
        if -fpartition-functions-into-sections is set.
        * common.opt (fpartition-functions-into-sections): Document
        new flag.
        * varasm.c (last_part_text_section_name): New variable.
        (in_part_section_p): Likewise.
        (initialize_part_section_name, text_part_section,
        output_sections): New functions.
        (function_section, current_function_section,
        assemble_start_function, assemble_end_function,
        default_section_type_flags): Support new functionality.
        * target-def.h (TARGET_EST_SECTION_OVERHEAD,
        TARGET_EST_INSTRUCTION_SIZE, TARGET_PART_FUNC_TO_SECTIONS_FLAGS,?
        TARGET_BEGIN_CRITICAL_SECTION, TARGET_END_CRITICAL_SECTION,
        TARGET_RECORD_JUMP_TABLE): Define.
        * rtl.h (NOTE_TEXT_SECTION): Define to hold the section id.
        * output.h (text_part_section): Add declaration.
        * bb-reorder.c (cfgloop.h, langhooks.h, hashtab.h, vec.h):.
        New includes.
        (loop_info_def, funcpart_basic_block_data_def, insn_aux,):.
        critical_sections_aux): New structures.
        (insns_aux, estimate_section_overhead, estimate_max_section_size,,
        fbb_data_size, fbb_data): New static variables.
        (critical_sections, loop_info): New typedef.
        (validate_fbb_data_element, est_size_of_insns_in_bb,
        split_bb, insert_section_boundary_note_in_function,,
        start_new_section, start_new_section_for_loop,
        in_critical_section, first_bb_in_critical_section,,,
        start_new_section_for_critical_section, iaux_info_hash,
        iaux_info_eq, create_sections, calculate_loop_boundary,
        loop_size_is_less, record_insns_size_estimation,
        record_loops_boundaries, close_critical_sections,
        record_tablejump, record_critical_sections, free_fbb_data,
        check_unexpected_insns, partition_function_into_sections,,
        get_est_section_overhead, instruction_size_exceeds_threshold,
        gate_handle_partition_functions,
        rest_of_handle_partition_functions, check_sections): New functions.
        (insert_section_boundary_note): Avoid
        emitting NOTE_INSN_SWITCH_TEXT_SECTIONS if
        -fpartition-functions-into-sections is set.
        (pass_partition_functions): New pass.
        * Makefile.in (bb-reorder.o): Add CFGLOOP_H,
        LANGHOOKS_DEF_H, HASHTAB_H, vec.h to dependencies.):
        * basic-block.h (bb_flags): Add new BB_FIRST_AFTER_SECTION_SWITCH
        flag.
        (check_sections): Add declaration.
        * passes.c (pass_partition_functions): New.
        (execute_todo): Call to check_sections function.
        * config/spu/spu.c (part_func_to_sections_flags,
        spu_est_instruction_size, spu_est_section_overhead,
        spu_record_jump_table, spu_end_critical_section,
        spu_begin_critical_section, get_stub_size): New functions.
        (TARGET_EST_SECTION_OVERHEAD, TARGET_EST_INSTRUCTION_SIZE,
        TARGET_PART_FUNC_TO_SECTIONS_FLAGS, TARGET_BEGIN_CRITICAL_SECTION,.
        TARGET_END_CRITICAL_SECTION, TARGET_RECORD_JUMP_TABLE): Override.,.
        (CRITICAL_EVENT_MASK, CRITICAL_DMA_SEQ): New definitions.
        * config/spu/spu.h (HAS_LONG_COND_BRANCH, HAS_LONG_UNCOND_BRANCH):.
        Define.
        * config/spu/spu.opt (mstub-size): New flag.
        * cfgrtl.c (rtl_verify_flow_info_1, rtl_verify_flow_info):
        Consider NOTE_INSN_VAR_LOCATION note.


(See attached file: patch_sections_part1_7_8.txt)(See attached file:
patch_testsuite_sections_7_8.txt)

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch_sections_part1_7_8.txt
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20080818/f1acbe31/attachment.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch_testsuite_sections_7_8.txt
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20080818/f1acbe31/attachment-0001.txt>


More information about the Gcc-patches mailing list