OSDN Git Service

patch to fix extraneous nop at function start, bug from David Mosberger
authorwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 17 Mar 2005 03:51:09 +0000 (03:51 +0000)
committerwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 17 Mar 2005 03:51:09 +0000 (03:51 +0000)
* 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
gcc/config/ia64/ia64.c
gcc/config/ia64/ia64.md

index 215b553..d00f7ca 100644 (file)
@@ -1,3 +1,10 @@
+2005-03-16  James E. Wilson  <wilson@specifixinc.com>
+
+       * 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  <dberlin@dberlin.org>
 
        * tree-vectorizer.c (new_vec_stmt_info): Initialize
index bca447b..0b28464 100644 (file)
@@ -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++;
index cb5dd10..365c0a8 100644 (file)
 
 (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"))
 \f
 ;; DFA descriptions of ia64 processors used for insn scheduling and
 ;; bundling.
   ""
   "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"