From 5f121199c3c6c06ae12046dfe4919ba760ba9902 Mon Sep 17 00:00:00 2001 From: wilson Date: Thu, 17 Mar 2005 03:51:09 +0000 Subject: [PATCH] patch to fix extraneous nop at function start, bug from David Mosberger * config/ia64/ia64.c (issue_nops_and_insn): Check first_insn attribute, and return without creating new state if before_nops_num is nonzero. * config/ia64/ia64.md (first_insn): New attribute. (alloc): Set it to yes. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@96597 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 7 +++++++ gcc/config/ia64/ia64.c | 11 +++++++++++ gcc/config/ia64/ia64.md | 8 +++++++- 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 215b5532bb5..d00f7ca2a38 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2005-03-16 James E. Wilson + + * config/ia64/ia64.c (issue_nops_and_insn): Check first_insn attribute, + and return without creating new state if before_nops_num is nonzero. + * config/ia64/ia64.md (first_insn): New attribute. + (alloc): Set it to yes. + 2005-03-16 Daniel Berlin * tree-vectorizer.c (new_vec_stmt_info): Initialize diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c index bca447ba91a..0b28464afe8 100644 --- a/gcc/config/ia64/ia64.c +++ b/gcc/config/ia64/ia64.c @@ -6433,6 +6433,17 @@ issue_nops_and_insn (struct bundle_state *originator, int before_nops_num, } else { + /* If this is an insn that must be first in a group, then don't allow + nops to be emitted before it. Currently, alloc is the only such + supported instruction. */ + /* ??? The bundling automatons should handle this for us, but they do + not yet have support for the first_insn attribute. */ + if (before_nops_num > 0 && get_attr_first_insn (insn) == FIRST_INSN_YES) + { + free_bundle_state (curr_state); + return; + } + state_transition (curr_state->dfa_state, dfa_pre_cycle_insn); state_transition (curr_state->dfa_state, NULL); curr_state->cost++; diff --git a/gcc/config/ia64/ia64.md b/gcc/config/ia64/ia64.md index cb5dd10abc2..365c0a8ce24 100644 --- a/gcc/config/ia64/ia64.md +++ b/gcc/config/ia64/ia64.md @@ -163,6 +163,11 @@ (define_attr "empty" "no,yes" (const_string "no")) +;; True iff this insn must be the first insn of an instruction group. +;; This is true for the alloc instruction, and will also be true of others +;; when we have full intrinsics support. + +(define_attr "first_insn" "no,yes" (const_string "no")) ;; DFA descriptions of ia64 processors used for insn scheduling and ;; bundling. @@ -5703,7 +5708,8 @@ "" "alloc %0 = ar.pfs, %1, %2, %3, %4" [(set_attr "itanium_class" "syst_m0") - (set_attr "predicable" "no")]) + (set_attr "predicable" "no") + (set_attr "first_insn" "yes")]) ;; Modifies ar.unat (define_expand "gr_spill" -- 2.11.0