/* Instruction scheduling pass. Selective scheduler and pipeliner.
- Copyright (C) 2006-2015 Free Software Foundation, Inc.
+ Copyright (C) 2006-2016 Free Software Foundation, Inc.
This file is part of GCC.
#include "config.h"
#include "system.h"
#include "coretypes.h"
-#include "tm.h"
-#include "diagnostic-core.h"
+#include "backend.h"
+#include "cfghooks.h"
+#include "tree.h"
#include "rtl.h"
+#include "df.h"
#include "tm_p.h"
-#include "hard-reg-set.h"
-#include "regs.h"
-#include "function.h"
-#include "predict.h"
-#include "dominance.h"
-#include "cfg.h"
#include "cfgrtl.h"
#include "cfganal.h"
#include "cfgbuild.h"
-#include "basic-block.h"
-#include "flags.h"
#include "insn-config.h"
#include "insn-attr.h"
-#include "except.h"
#include "recog.h"
#include "params.h"
#include "target.h"
#include "sched-int.h"
-#include "symtab.h"
-#include "tree.h"
-#include "langhooks.h"
-#include "rtlhooks-def.h"
#include "emit-rtl.h" /* FIXME: Can go away once crtl is moved to rtl.h. */
#ifdef INSN_SCHEDULING
+#include "regset.h"
+#include "cfgloop.h"
#include "sel-sched-ir.h"
/* We don't have to use it except for sel_print_insn. */
#include "sel-sched-dump.h"
sel_region_bb_info = vNULL;
/* A pool for allocating all lists. */
-pool_allocator<_list_node> sched_lists_pool ("sel-sched-lists", 500);
+object_allocator<_list_node> sched_lists_pool ("sel-sched-lists");
/* This contains information about successors for compute_av_set. */
struct succs_info current_succs;
regset_pool.v[regset_pool.n++] = rs;
}
-#ifdef ENABLE_CHECKING
/* This is used as a qsort callback for sorting regset pool stacks.
X and XX are addresses of two regsets. They are never equal. */
static int
return -1;
gcc_unreachable ();
}
-#endif
-/* Free the regset pool possibly checking for memory leaks. */
+/* Free the regset pool possibly checking for memory leaks. */
void
free_regset_pool (void)
{
-#ifdef ENABLE_CHECKING
- {
- regset *v = regset_pool.v;
- int i = 0;
- int n = regset_pool.n;
+ if (flag_checking)
+ {
+ regset *v = regset_pool.v;
+ int i = 0;
+ int n = regset_pool.n;
- regset *vv = regset_pool.vv;
- int ii = 0;
- int nn = regset_pool.nn;
+ regset *vv = regset_pool.vv;
+ int ii = 0;
+ int nn = regset_pool.nn;
- int diff = 0;
+ int diff = 0;
- gcc_assert (n <= nn);
+ gcc_assert (n <= nn);
- /* Sort both vectors so it will be possible to compare them. */
- qsort (v, n, sizeof (*v), cmp_v_in_regset_pool);
- qsort (vv, nn, sizeof (*vv), cmp_v_in_regset_pool);
+ /* Sort both vectors so it will be possible to compare them. */
+ qsort (v, n, sizeof (*v), cmp_v_in_regset_pool);
+ qsort (vv, nn, sizeof (*vv), cmp_v_in_regset_pool);
- while (ii < nn)
- {
- if (v[i] == vv[ii])
- i++;
- else
- /* VV[II] was lost. */
- diff++;
+ while (ii < nn)
+ {
+ if (v[i] == vv[ii])
+ i++;
+ else
+ /* VV[II] was lost. */
+ diff++;
- ii++;
- }
+ ii++;
+ }
- gcc_assert (diff == regset_pool.diff);
- }
-#endif
+ gcc_assert (diff == regset_pool.diff);
+ }
/* If not true - we have a memory leak. */
gcc_assert (regset_pool.diff == 0);
return sel_bb_head_p (insn) && sel_bb_end_p (insn);
}
-#ifdef ENABLE_CHECKING
/* Check that the region we're scheduling still has at most one
backedge. */
static void
gcc_assert (n <= 1);
}
}
-#endif
\f
/* Functions to work with control flow. */
sel_recompute_toporder ();
}
-#ifdef ENABLE_CHECKING
- verify_backedges ();
- verify_dominators (CDI_DOMINATORS);
-#endif
+ /* TODO: use separate flag for CFG checking. */
+ if (flag_checking)
+ {
+ verify_backedges ();
+ verify_dominators (CDI_DOMINATORS);
+ }
return changed;
}