[llvm-commits] [llvm-gcc-4.2] r51604 - in /llvm-gcc-4.2/trunk/gcc: combine.c config/i386/i386.h global.c haifa-sched.c local-alloc.c passes.c reload1.c toplev.c
Dale Johannesen
dalej at apple.com
Tue May 27 13:11:10 PDT 2008
Author: johannes
Date: Tue May 27 15:11:08 2008
New Revision: 51604
URL: http://llvm.org/viewvc/llvm-project?rev=51604&view=rev
Log:
Comment out some code that isn't used by llvm-gcc:
RTX combine, scheduler, global & local RAs, pieces
that were already unreacahable but not commented,
RTX version of x87 stack handling.
Modified:
llvm-gcc-4.2/trunk/gcc/combine.c
llvm-gcc-4.2/trunk/gcc/config/i386/i386.h
llvm-gcc-4.2/trunk/gcc/global.c
llvm-gcc-4.2/trunk/gcc/haifa-sched.c
llvm-gcc-4.2/trunk/gcc/local-alloc.c
llvm-gcc-4.2/trunk/gcc/passes.c
llvm-gcc-4.2/trunk/gcc/reload1.c
llvm-gcc-4.2/trunk/gcc/toplev.c
Modified: llvm-gcc-4.2/trunk/gcc/combine.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/combine.c?rev=51604&r1=51603&r2=51604&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/combine.c (original)
+++ llvm-gcc-4.2/trunk/gcc/combine.c Tue May 27 15:11:08 2008
@@ -103,6 +103,9 @@
#include "timevar.h"
#include "tree-pass.h"
+/* LLVM LOCAL begin comment out most of this file */
+#ifndef ENABLE_LLVM
+/* LLVM LOCAL end */
/* Number of attempts to combine instructions in this function. */
static int combine_attempts;
@@ -11622,6 +11625,9 @@
}
}
}
+/* LLVM LOCAL begin following function is used elsewhere */
+#endif
+/* LLVM LOCAL end */
/* Remove register number REGNO from the dead registers list of INSN.
@@ -11641,6 +11647,9 @@
return note;
}
+/* LLVM LOCAL begin comment out most of file */
+#ifndef ENABLE_LLVM
+/* LLVM LOCAL end */
/* For each register (hardware or pseudo) used within expression X, if its
death is in an instruction with cuid between FROM_CUID (inclusive) and
TO_INSN (exclusive), put a REG_DEAD note for that register in the
@@ -12598,6 +12607,9 @@
"\n;; Combiner totals: %d attempts, %d substitutions (%d requiring new space),\n;; %d successes.\n",
total_attempts, total_merges, total_extras, total_successes);
}
+/* LLVM LOCAL begin */
+#endif
+/* LLVM LOCAL end */
static bool
@@ -12610,6 +12622,8 @@
static unsigned int
rest_of_handle_combine (void)
{
+/* LLVM LOCAL begin */
+#ifndef ENABLE_LLVM
int rebuild_jump_labels_after_combine
= combine_instructions (get_insns (), max_reg_num ());
@@ -12625,6 +12639,8 @@
delete_dead_jumptables ();
cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_UPDATE_LIFE);
}
+#endif
+/* LLVM LOCAL end */
return 0;
}
Modified: llvm-gcc-4.2/trunk/gcc/config/i386/i386.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/i386/i386.h?rev=51604&r1=51603&r2=51604&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/i386/i386.h (original)
+++ llvm-gcc-4.2/trunk/gcc/config/i386/i386.h Tue May 27 15:11:08 2008
@@ -791,7 +791,12 @@
/* This processor has special stack-like registers. See reg-stack.c
for details. */
+/* LLVM LOCAL begin We don't need the RTL-based STACK_REGS (x87) mechanism. */
+#ifndef ENABLE_LLVM
#define STACK_REGS
+#endif
+/* LLVM LOCAL end */
+
#define IS_STACK_MODE(MODE) \
(((MODE) == SFmode && (!TARGET_SSE || !TARGET_SSE_MATH)) \
|| ((MODE) == DFmode && (!TARGET_SSE2 || !TARGET_SSE_MATH)) \
Modified: llvm-gcc-4.2/trunk/gcc/global.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/global.c?rev=51604&r1=51603&r2=51604&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/global.c (original)
+++ llvm-gcc-4.2/trunk/gcc/global.c Tue May 27 15:11:08 2008
@@ -40,6 +40,10 @@
#include "timevar.h"
#include "vecprim.h"
+/* LLVM LOCAL begin comment out most of this file */
+#ifndef ENABLE_LLVM
+/* LLVM LOCAL end */
+
/* APPLE LOCAL begin rewrite weight computation */
/* The rewritten weight computation works fine on Darwin, but causes
bootstrap compares to fail on Linux. */
@@ -435,12 +439,6 @@
size_t i;
rtx x;
- /* LLVM LOCAL begin - cc1 code size. */
-#ifdef ENABLE_LLVM
- return 0;
-#endif
- /* LLVM LOCAL end */
-
make_accurate_live_analysis ();
max_allocno = 0;
@@ -3145,6 +3143,10 @@
}
free_bb_info ();
}
+/* LLVM LOCAL begin */
+#endif
+/* LLVM LOCAL end */
+
/* Run old register allocator. Return TRUE if we must exit
rest_of_compilation upon return. */
static unsigned int
@@ -3155,6 +3157,10 @@
/* If optimizing, allocate remaining pseudo-regs. Do the reload
pass fixing up any insns that are invalid. */
+/* LLVM LOCAL begin */
+#ifdef ENABLE_LLVM
+ failure = 0;
+#else
if (optimize)
failure = global_alloc ();
else
@@ -3171,6 +3177,8 @@
}
gcc_assert (reload_completed || failure);
+#endif
+/* LLVM LOCAL end */
reload_completed = !failure;
return 0;
}
Modified: llvm-gcc-4.2/trunk/gcc/haifa-sched.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/haifa-sched.c?rev=51604&r1=51603&r2=51604&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/haifa-sched.c (original)
+++ llvm-gcc-4.2/trunk/gcc/haifa-sched.c Tue May 27 15:11:08 2008
@@ -145,6 +145,11 @@
#include "output.h"
#include "params.h"
+/* LLVM LOCAL begin comment out most of this file */
+#ifndef ENABLE_LLVM
+#undef INSN_SCHEDULING
+#endif
+/* LLVM LOCAL end */
#ifdef INSN_SCHEDULING
/* issue_rate is the number of insns that can be scheduled in the same
Modified: llvm-gcc-4.2/trunk/gcc/local-alloc.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/local-alloc.c?rev=51604&r1=51603&r2=51604&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/local-alloc.c (original)
+++ llvm-gcc-4.2/trunk/gcc/local-alloc.c Tue May 27 15:11:08 2008
@@ -82,6 +82,9 @@
#include "timevar.h"
#include "tree-pass.h"
+/* LLVM LOCAL begin comment out most of this file */
+#ifndef ENABLE_LLVM
+/* LLVM LOCAL end */
/* Next quantity number available for allocation. */
static int next_qty;
@@ -215,7 +218,9 @@
to a subreg of a DImode register. */
static char *reg_offset;
-
+/* LLVM LOCAL begin the following def is referenced elsewhere */
+#endif
+/* LLVM LOCAL end */
/* Vector of substitutions of register numbers,
used to map pseudo regs into hardware regs.
This is set up as a result of register allocation.
@@ -225,6 +230,9 @@
short *reg_renumber;
+/* LLVM LOCAL begin */
+#ifndef ENABLE_LLVM
+/* LLVM LOCAL end */
/* Set of hard registers live at the current point in the scan
of the instructions in a basic block. */
@@ -2557,12 +2565,18 @@
}
#endif
/* APPLE LOCAL end radar 4216496, 4229407, 4120689, 4095567 */
+/* LLVM LOCAL begin */
+#endif
+/* LLVM LOCAL end */
/* Run old register allocator. Return TRUE if we must exit
rest_of_compilation upon return. */
static unsigned int
rest_of_handle_local_alloc (void)
{
+/* LLVM LOCAL begin */
+#ifndef ENABLE_LLVM
+/* LLVM LOCAL end */
int rebuild_notes;
/* Determine if the current function is a leaf before running reload
@@ -2627,6 +2641,9 @@
dump_local_alloc (dump_file);
timevar_pop (TV_DUMP);
}
+/* LLVM LOCAL begin */
+#endif
+/* LLVM LOCAL end */
return 0;
}
Modified: llvm-gcc-4.2/trunk/gcc/passes.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/passes.c?rev=51604&r1=51603&r2=51604&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/passes.c (original)
+++ llvm-gcc-4.2/trunk/gcc/passes.c Tue May 27 15:11:08 2008
@@ -246,8 +246,7 @@
/* LLVM LOCAL begin Dead code strip cc1. */
#ifdef ENABLE_LLVM
return;
-#endif
- /* LLVM LOCAL end Dead code strip cc1. */
+#else
timevar_push (TV_DUMP);
if (profile_arc_flag || flag_test_coverage || flag_branch_probabilities)
@@ -280,6 +279,8 @@
}
timevar_pop (TV_DUMP);
+#endif
+ /* LLVM LOCAL end Dead code strip cc1. */
}
static bool
Modified: llvm-gcc-4.2/trunk/gcc/reload1.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/reload1.c?rev=51604&r1=51603&r2=51604&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/reload1.c (original)
+++ llvm-gcc-4.2/trunk/gcc/reload1.c Tue May 27 15:11:08 2008
@@ -2049,6 +2049,8 @@
inherent space, and no less total space, then the previous slot. */
if (from_reg == -1)
{
+/* LLVM LOCAL begin we've removed this definition */
+#ifndef ENABLE_LLVM
/* APPLE LOCAL begin 4321079 */
extern rtx find_tied_stack_pseudo (int);
/* Ask global reg allocator for a stack slot already assigned
@@ -2056,6 +2058,8 @@
if (from_global)
x = find_tied_stack_pseudo (i);
else
+#endif
+/* LLVM LOCAL end */
x = NULL_RTX;
if (!x)
@@ -3826,7 +3830,11 @@
COPY_HARD_REG_SET (forbidden, bad_spill_regs_global);
IOR_HARD_REG_SET (forbidden, pseudo_forbidden_regs[i]);
IOR_HARD_REG_SET (forbidden, pseudo_previous_regs[i]);
+/* LLVM LOCAL begin we've removed this definition */
+#ifndef ENABLE_LLVM
retry_global_alloc (i, forbidden);
+#endif
+/* LLVM LOCAL end */
if (reg_renumber[i] >= 0)
CLEAR_REGNO_REG_SET (&spilled_pseudos, i);
}
Modified: llvm-gcc-4.2/trunk/gcc/toplev.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/toplev.c?rev=51604&r1=51603&r2=51604&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/toplev.c (original)
+++ llvm-gcc-4.2/trunk/gcc/toplev.c Tue May 27 15:11:08 2008
@@ -2107,8 +2107,7 @@
llvm_lang_dependent_init(name);
init_eh();
return 1; /* don't initialize the RTL backend */
-#endif
- /* LLVM LOCAL end */
+#else
/* These create various _DECL nodes, so need to be called after the
front end is initialized. */
@@ -2144,6 +2143,8 @@
timevar_pop (TV_SYMOUT);
return 1;
+#endif
+ /* LLVM LOCAL end */
}
/* Clean up: close opened files, etc. */
More information about the llvm-commits
mailing list