[llvm-commits] [llvm-gcc-4.2] r51724 - in /llvm-gcc-4.2/trunk/gcc: config/spu/spu.c ddg.c sched-deps.c sched-ebb.c sched-int.h

Scott Michel scottm at aero.org
Thu May 29 19:30:56 PDT 2008


Author: pingbak
Date: Thu May 29 21:30:54 2008
New Revision: 51724

URL: http://llvm.org/viewvc/llvm-project?rev=51724&view=rev
Log:
If gcc's instruction scheduler is going to be disabled, don't stop with a mere
flesh wound. Put a proper stake through the heart of the beast.

Otherwise, references to struct h_i_d and the shorten_branches function show
up at link time when they ought not.

Modified:
    llvm-gcc-4.2/trunk/gcc/config/spu/spu.c
    llvm-gcc-4.2/trunk/gcc/ddg.c
    llvm-gcc-4.2/trunk/gcc/sched-deps.c
    llvm-gcc-4.2/trunk/gcc/sched-ebb.c
    llvm-gcc-4.2/trunk/gcc/sched-int.h

Modified: llvm-gcc-4.2/trunk/gcc/config/spu/spu.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/spu/spu.c?rev=51724&r1=51723&r2=51724&view=diff

==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/spu/spu.c (original)
+++ llvm-gcc-4.2/trunk/gcc/config/spu/spu.c Thu May 29 21:30:54 2008
@@ -56,6 +56,12 @@
 #include "tm-constrs.h"
 #include "spu-builtins.h"
 
+/* LLVM LOCAL begin */
+#ifdef ENABLE_LLVM
+#undef INSN_SCHEDULING
+#endif
+/* LLVM LOCAL end */
+
 /* Builtin types, data and prototypes. */
 struct spu_builtin_range
 {
@@ -92,11 +98,15 @@
 static rtx frame_emit_load (int regno, rtx addr, HOST_WIDE_INT offset);
 static rtx frame_emit_add_imm (rtx dst, rtx src, HOST_WIDE_INT imm,
 			       rtx scratch);
+/* LLVM LOCAL begin */
+#ifndef ENABLE_LLVM
 static void emit_nop_for_insn (rtx insn);
 static bool insn_clobbers_hbr (rtx insn);
 static void spu_emit_branch_hint (rtx before, rtx branch, rtx target,
 				  int distance);
 static rtx get_branch_target (rtx branch);
+#endif
+/* LLVM LOCAL end */
 static void insert_branch_hints (void);
 static void insert_nops (void);
 static void spu_machine_dependent_reorg (void);
@@ -130,8 +140,12 @@
 static bool spu_return_in_memory (tree type, tree fntype);
 static void fix_range (const char *);
 static void spu_encode_section_info (tree, rtx, int);
+/* LLVM LOCAL begin */
+#ifndef ENABLE_LLVM
 static tree spu_builtin_mul_widen_even (tree);
 static tree spu_builtin_mul_widen_odd (tree);
+#endif
+/* LLVM LOCAL end */
 static tree spu_builtin_mask_for_load (void);
 
 extern const char *reg_names[];
@@ -1804,6 +1818,8 @@
   basic_block bb;		/* the original block. */
 };
 
+/* LLVM LOCAL begin */
+#ifndef ENABLE_LLVM
 /* The special $hbr register is used to prevent the insn scheduler from
    moving hbr insns across instructions which invalidate them.  It
    should only be used in a clobber, and this function searches for
@@ -1933,10 +1949,14 @@
     }
   return 0;
 }
+#endif
+/* LLVM LOCAL end */
 
 static void
 insert_branch_hints (void)
 {
+/* LLVM LOCAL begin */
+#ifndef ENABLE_LLVM
   struct spu_bb_info *spu_bb_info;
   rtx branch, insn, next;
   rtx branch_target = 0;
@@ -2107,8 +2127,12 @@
       }
   }
   free (spu_bb_info);
+#endif
+/* LLVM LOCAL end */
 }
 
+/* LLVM LOCAL begin */
+#ifndef ENABLE_LLVM
 /* Emit a nop for INSN such that the two will dual issue.  This assumes
    INSN is 8-byte aligned.  When INSN is inline asm we emit an lnop.
    We check for TImode to handle a MULTI1 insn which has dual issued its
@@ -2129,12 +2153,16 @@
   else
     new_insn = emit_insn_after (gen_lnop (), insn);
 }
+#endif
+/* LLVM LOCAL end */
 
 /* Insert nops in basic blocks to meet dual issue alignment
    requirements. */
 static void
 insert_nops (void)
 {
+/* LLVM LOCAL begin */
+#ifndef ENABLE_LLVM
   rtx insn, next_insn, prev_insn;
   int length;
   int addr;
@@ -2162,6 +2190,8 @@
 	}
       prev_insn = insn;
     }
+#endif
+/* LLVM LOCAL end */
 }
 
 static void
@@ -2255,6 +2285,8 @@
 spu_sched_adjust_cost (rtx insn, rtx link ATTRIBUTE_UNUSED,
 		       rtx dep_insn ATTRIBUTE_UNUSED, int cost)
 {
+/* LLVM LOCAL begin */
+#ifdef INSN_SCHEDULING
   if (GET_CODE (insn) == CALL_INSN)
     return cost - 2;
   /* The dfa scheduler sets cost to 0 for all anti-dependencies and the
@@ -2264,6 +2296,12 @@
   if (GET_CODE (insn) == JUMP_INSN && REG_NOTE_KIND (link) == REG_DEP_ANTI)
     return INSN_COST (dep_insn) - 3;
   return cost;
+#else
+  /* If INSN_SCHEDULING is not defined, this function is merely a stub, so
+     return something reasonable to make the compiler happy. */
+  return cost;
+#endif
+/* LLVM LOCAL end */
 }
 
 /* Create a CONST_DOUBLE from a string.  */
@@ -5002,6 +5040,8 @@
   abort ();
 }
 
+/* LLVM LOCAL begin */
+#ifndef ENABLE_LLVM
 /* Implement targetm.vectorize.builtin_mul_widen_even.  */
 static tree
 spu_builtin_mul_widen_even (tree type)
@@ -5035,6 +5075,8 @@
       return NULL_TREE;
     }
 }
+#endif /* ENABLE_LLVM */
+/* LLVM LOCAL end */
 
 /* Implement targetm.vectorize.builtin_mask_for_load.  */
 static tree

Modified: llvm-gcc-4.2/trunk/gcc/ddg.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/ddg.c?rev=51724&r1=51723&r2=51724&view=diff

==============================================================================
--- llvm-gcc-4.2/trunk/gcc/ddg.c (original)
+++ llvm-gcc-4.2/trunk/gcc/ddg.c Thu May 29 21:30:54 2008
@@ -46,6 +46,13 @@
 #include "df.h"
 #include "ddg.h"
 
+/* LLVM LOCAL begin comment out most of this file */
+#ifdef ENABLE_LLVM
+#undef INSN_SCHEDULING
+#endif
+
+#ifdef ISNS_SCHEDULING
+/* LLVM LOCAL end */
 /* A flag indicating that a ddg edge belongs to an SCC or not.  */
 enum edge_flag {NOT_IN_SCC = 0, IN_SCC};
 
@@ -1053,3 +1060,6 @@
   sbitmap_free (tmp);
   return result;
 }
+/* LLVM LOCAL begin */
+#endif /* INSN_SCHEDULING */
+/* LLVM LOCAL end */

Modified: llvm-gcc-4.2/trunk/gcc/sched-deps.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/sched-deps.c?rev=51724&r1=51723&r2=51724&view=diff

==============================================================================
--- llvm-gcc-4.2/trunk/gcc/sched-deps.c (original)
+++ llvm-gcc-4.2/trunk/gcc/sched-deps.c Thu May 29 21:30:54 2008
@@ -45,6 +45,13 @@
 #include "df.h"
 
 
+/* LLVM LOCAL begin comment out most of this file */
+#ifdef ENABLE_LLVM
+#undef INSN_SCHEDULING
+#endif
+
+#ifdef INSN_SCHEDULING
+/* LLVM LOCAL end */
 static regset reg_pending_sets;
 static regset reg_pending_clobbers;
 static regset reg_pending_uses;
@@ -2125,6 +2132,7 @@
 
   return ds;
 }
+#endif
 
 #ifdef INSN_SCHEDULING
 #ifdef ENABLE_CHECKING
@@ -2199,4 +2207,6 @@
     }
 }
 #endif
-#endif  
+/* LLVM LOCAL begin */
+#endif  /* INSN_SCHEDULING */
+/* LLVM LOCAL end */

Modified: llvm-gcc-4.2/trunk/gcc/sched-ebb.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/sched-ebb.c?rev=51724&r1=51723&r2=51724&view=diff

==============================================================================
--- llvm-gcc-4.2/trunk/gcc/sched-ebb.c (original)
+++ llvm-gcc-4.2/trunk/gcc/sched-ebb.c Thu May 29 21:30:54 2008
@@ -43,6 +43,13 @@
 #include "target.h"
 #include "output.h"
 
+/* LLVM LOCAL begin comment out most of this file */
+#ifdef ENABLE_LLVM
+#undef INSN_SCHEDULING
+#endif
+
+#ifdef INSN_SCHEDULING
+/* LLVM LOCAL end */
 /* The number of insns scheduled so far.  */
 static int sched_n_insns;
 
@@ -773,3 +780,6 @@
     return bitmap_bit_p (&ebb_tail, bb->index);
 }
 #endif /* ENABLE_CHECKING  */
+/* LLVM LOCAL begin */
+#endif /* INSN_SCHEDULING */
+/* LLVM LOCAL end */

Modified: llvm-gcc-4.2/trunk/gcc/sched-int.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/sched-int.h?rev=51724&r1=51723&r2=51724&view=diff

==============================================================================
--- llvm-gcc-4.2/trunk/gcc/sched-int.h (original)
+++ llvm-gcc-4.2/trunk/gcc/sched-int.h Thu May 29 21:30:54 2008
@@ -30,6 +30,14 @@
 /* For reg_note.  */
 #include "rtl.h"
 
+/* LLVM LOCAL begin comment out most of this file */
+#ifdef ENABLE_LLVM
+#undef INSN_SCHEDULING
+#endif
+
+#ifdef INSN_SCHEDULING
+/* LLVM LOCAL end */
+
 /* Pointer to data describing the current DFA state.  */
 extern state_t curr_state;
 
@@ -336,6 +344,7 @@
 };
 
 extern struct haifa_insn_data *h_i_d;
+
 /* Used only if (current_sched_info->flags & USE_GLAT) != 0.
    These regsets store global_live_at_{start, end} information
    for each basic block.  */
@@ -658,4 +667,7 @@
 extern void check_reg_live (bool);
 #endif
 
+/* LLVM LOCAL begin comment out most of this file */
+#endif /* INSN_SCHEDULING */
+/* LLVM LOCAL end */
 #endif /* GCC_SCHED_INT_H */





More information about the llvm-commits mailing list