public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Andrey Belevantsev <abel@ispras.ru>
To: GCC Patches <gcc-patches@gcc.gnu.org>
Cc: Jim Wilson <wilson@tuliptree.org>,
	  Vladimir Makarov <vmakarov@redhat.com>,
	 Ayal Zaks <ZAKS@il.ibm.com>
Subject: Re: Selective scheduling pass - target changes (ia64 & rs6000) [3/3]
Date: Fri, 22 Aug 2008 16:04:00 -0000	[thread overview]
Message-ID: <48AEDCA5.1080909@ispras.ru> (raw)
In-Reply-To: <484552F7.9040801@ispras.ru>

[-- Attachment #1: Type: text/plain, Size: 6719 bytes --]

Hello,

This is the updated patch which I resend with the other parts.  I think 
the only change is that the flag_selective_scheduling option is turned 
on in ia64_optimization_options, not in ia64_override_options.

This is actually the last part of the selective scheduler patch that did 
not get reviewed yet.  Maybe a global write maintainer and a rs6000 
maintainer could have a look?

Thanks, Andrey

2008-08-22  Andrey Belevantsev  <abel@ispras.ru>
	    Dmitry Melnik  <dm@ispras.ru>
	    Dmitry Zhurikhin  <zhur@ispras.ru>
	    Alexander Monakov  <amonakov@ispras.ru>
	    Maxim Kuvyrkov  <maxim@codesourcery.com>

	* config/ia64/ia64.c: Include sel-sched.h.  Rewrite speculation hooks.
	(ia64_gen_spec_insn): Removed.
	(get_spec_check_gen_function, insn_can_be_in_speculative_p,
	ia64_gen_spec_check): New static functions.
	(ia64_alloc_sched_context, ia64_init_sched_context,
	ia64_set_sched_context, ia64_clear_sched_context,
	ia64_free_sched_context, ia64_get_insn_spec_ds,
	ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions.
	(ia64_needs_block_p): Change prototype.
	(ia64_gen_check): Rename to ia64_gen_spec_check.
	(ia64_adjust_cost): Rename to ia64_adjust_cost_2.  Add new parameter
	into declaration, add special memory dependencies handling.
	(TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT,
	TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT,
	TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS,
	TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P):
	Define new target hooks.
	(TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK.
	(ia64_optimization_options): Turn on selective scheduling with -O3,
	disable -fauto-inc-dec.
	(ia64_override_options): Initialize align_loops and align_functions
	to 32 and 64, respectively.  Set global selective scheduling flags
	according to target-dependent flags.
	(rtx_needs_barrier): Support UNSPEC_LDS_A.
	(group_barrier_needed): Use new mstop-bit-before-check flag.
	Add heuristic.
	(dfa_state_size): Make global.
	(spec_check_no, max_uid): Remove.
         (mem_ops_in_group, current_cycle): New variables.
	(ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload.
         Initialize new variables.
         (is_load_p, record_memory_reference): New functions.
         (ia64_dfa_sched_reorder): Lower priority of loads when limit is
         reached.
	(ia64_variable_issue): Change use of current_sched_info to
	sched_deps_info.  Update comment.  Note if a load or a store is issued.
         (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require 
a cycle
         advance if maximal number of loads or stores was issued on current
         cycle.
	(scheduled_good_insn): New static helper function.
         (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when
         a group barrier is needed.  Fix vertical spacing.  Guard the code
         doing state transition with last_scheduled_insn check. 

         Mark that a stop bit should be before current insn if there was a
         cycle advance.  Update current_cycle and mem_ops_in_group.
	(ia64_h_i_d_extended): Change use of current_sched_info to
         sched_deps_info. Reallocate stops_p by larger chunks.
	(struct _ia64_sched_context): New structure.
	(ia64_sched_context_t): New typedef.
	(ia64_alloc_sched_context, ia64_init_sched_context,
	ia64_set_sched_context, ia64_clear_sched_context,
	ia64_free_sched_context): New static functions.
	(gen_func_t): New typedef.
	(get_spec_load_gen_function): New function.
	(SPEC_GEN_EXTEND_OFFSET): Declare.	
	(ia64_set_sched_flags): Check common_sched_info instead of *flags.
	(get_mode_no_for_insn): Change the condition that prevents use of
	special hardware registers so it can now handle pseudos.
	(get_spec_unspec_code): New function.
	(ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds,
	ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions.
	(ia64_speculate_insn, ia64_needs_block_p): Support branchy checks
	during selective scheduling.
	(ia64_speculate_insn): Use ds_get_speculation_types when
	determining whether we need to change the pattern.
	(SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare.
	(ia64_spec_check_src_p): Support new speculation/check codes.
	(struct bundle_state): New field.
	(issue_nops_and_insn): Initialize it.
	(insert_bundle_state): Minimize mid-bundle stop bits.
	(important_for_bundling_p): New function.
	(get_next_important_insn): Use important_for_bundling_p.
	(bundling): When shifting TImode from unimportant insns, ignore
	also group barriers.  Assert that best state is found before
	the backward bundling pass.  Print number of mid-bundle stop bits.
	Minimize mid-bundle stop bits.  Check correct calculation of
	mid-bundle stop bits.
	(ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting.
	(final_emit_insn_group_barriers): Emit stop bits before insns starting
	a new cycle.
	(sel2_run): New variable.
	(ia64_reorg): When flag_selective_scheduling is set, run the selective
	scheduling pass instead of schedule_ebbs.  Adjust for
	flag_selective_scheduling2.
	(ia64_optimization_options): Declare new parameter.
	
	* config/ia64/ia64.md (speculable1, speculable2): New attributes.
	(UNSPEC_LDS_A): New UNSPEC.
	(movqi_internal, movhi_internal, movsi_internal, movdi_internal,
	movti_internal, movsf_internal, movdf_internal,
	movxf_internal): Make visible.  Add speculable* attributes.
	(output_c_nc): New mode attribute.
	(mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a,
	mov<mode>_nc, zero_extend<mode>di2_nc,
	advanced_load_check_nc_<mode>): New insns.
	(zero_extend*): Add speculable* attributes.

	* config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option.
	(msched-stop-bits-after-every-cycle): Likewise.
	(mstop-bit-before-check): Likewise.
	(msched-max-memory-insns,
         msched-max-memory-insns-hard-limit): Likewise.
	(msched-spec-verbose, msched-prefer-non-data-spec-insns,
         msched-prefer-non-control-spec-insns, 
msched-count-spec-in-critical-path,
         msel-sched-renaming, msel-sched-substitution, 
msel-sched-data-spec,
         msel-sched-control-spec, msel-sched-dont-check-control-spec): 
Use Target
         Report Var instead of Common Report Var.

	* config/ia64/itanium2.md: Remove strange bypass.
	
	* config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h.

	* config/rs6000/rs6000.c (rs6000_init_sched_context,
	rs6000_alloc_sched_context, rs6000_set_sched_context,
	rs6000_free_sched_context): New functions.
	(struct _rs6000_sched_context): New.
	(rs6000_sched_reorder2): Do not modify INSN_PRIORITY for selective
	scheduling.
	(rs6000_sched_finish): Do not run for selective scheduling.


[-- Attachment #2: sel-sched-target.diff.gz --]
[-- Type: application/gzip, Size: 21401 bytes --]

  reply	other threads:[~2008-08-22 15:35 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-03 14:24 [RFC] Selective scheduling pass Andrey Belevantsev
2008-06-03 14:26 ` Selective scheduling pass - middle end changes [1/1] Andrey Belevantsev
2008-06-11  1:04   ` Ian Lance Taylor
2008-06-11 13:40     ` Andrey Belevantsev
2008-06-11 14:30       ` Ian Lance Taylor
2008-06-27 13:10         ` Andrey Belevantsev
2008-06-30 16:16           ` Ian Lance Taylor
2008-07-08 14:54             ` Andrey Belevantsev
2008-07-08 15:29               ` Ian Lance Taylor
2008-08-22 15:55     ` Andrey Belevantsev
2008-06-03 14:27 ` Selective scheduling pass - scheduler changes [2/3] Andrey Belevantsev
2008-06-03 22:03   ` Vladimir Makarov
2008-08-22 15:52     ` Andrey Belevantsev
2008-06-03 14:28 ` Selective scheduling pass - target changes (ia64 & rs6000) [3/3] Andrey Belevantsev
2008-08-22 16:04   ` Andrey Belevantsev [this message]
2008-08-29 13:41     ` [Ping] [GWP/ia64/rs6000 maintainer needed] " Andrey Belevantsev
2008-08-29 15:01       ` Mark Mitchell
2008-09-25 22:39     ` sje
2008-09-26 14:57       ` Andrey Belevantsev
2008-10-03 22:22         ` Steve Ellcey
2008-10-06 17:26           ` Andrey Belevantsev
2008-06-03 22:03 ` [RFC] Selective scheduling pass Vladimir Makarov
2008-06-04 16:55 ` Mark Mitchell
2008-06-04 20:50   ` Andrey Belevantsev
2008-06-05  3:45 ` Seongbae Park (박성배, 朴成培)
2008-06-05 13:49   ` Andrey Belevantsev
2008-08-29 15:10 Selective scheduling pass - target changes (ia64 & rs6000) [3/3] David Edelsohn
2008-08-31 13:35 ` Andrey Belevantsev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48AEDCA5.1080909@ispras.ru \
    --to=abel@ispras.ru \
    --cc=ZAKS@il.ibm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=vmakarov@redhat.com \
    --cc=wilson@tuliptree.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).