summaryrefslogtreecommitdiff
path: root/gcc/tree-loop-linear.c
diff options
context:
space:
mode:
authorlauras <lauras@138bc75d-0d04-0410-961f-82ee72b054a4>2007-09-07 01:33:41 +0000
committerlauras <lauras@138bc75d-0d04-0410-961f-82ee72b054a4>2007-09-07 01:33:41 +0000
commit3026d558160171c8e324325f3e31e2a4e5b1a41d (patch)
tree90465e7e91a5775e8c20ea92e5e97726c297376d /gcc/tree-loop-linear.c
parent68a556d6cb1ebf7290514725565d2cf4723ab59f (diff)
downloadgcc-3026d558160171c8e324325f3e31e2a4e5b1a41d.tar.gz
2007-09-06 Laurynas Biveinis <laurynas.biveinis@gmail.com>
* tree-loop-linear.c: Include obstack.h. (linear_transform_loops): New obstack lambda_obstack. Initialize it, pass it to gcc_loopnest_to_lambda_loopnest, lambda_loopnest_transform, lambda_loopnest_to_gcc_loopnest calls and free afterwards. * lambda.h (struct obstack): New forward declaration. (lambda_linear_expression_new): New parameter of type struct obstack *. (lambda_loopnest_new): Likewise. (lambda_loopnest_transform): Likewise. (lambda_body_vector_new): Likewise. (lambda_body_vector_compute_new): Likewise. (gcc_loopnest_to_lambda_loopnest): Likewise. (lambda_loopnest_to_gcc_loopnest): Likewise. * lambda-code.c: Include obstack.h. (lambda_lattice_new): New parameter lambda_obstack. Use it for allocation of ret. (lambda_body_vector_new): Likewise. (lambda_linear_expression_new): Likewise. (lambda_lattice_new): Likewise. (lambda_loopnest_new): Likewise. Additionally use obstack to allocate LN_LOOPS(ret). (lambda_lattice_compute_base): New parameter lambda_obstack. Pass it to lambda_lattice_new. (lambda_body_vector_compute_new): New parameter lambda_obstack. Pass it to lambda_body_vector_new. (lambda_lattice_compute_base): New paramater lambda_obstack. Pass it to lambda_lattice_new. (compute_nest_using_fourier_motzkin): New parameter lambda_obstack. Pass it to lambda_loopnest_new, lambda_linear_expression_new. (lambda_compute_target_space): Likewise. (lambda_compute_auxillary_space): New parameter lambda_obstack. Pass it to lambda_lattice_compute_base and compute_nest_using_fourieer_motzkin. (lambda_loopnest_transform): New parameter lambda_obstack. Pass it to lambda_lattice_compute_base, lambda_lattice_auxillary_space and lambda_lattice_compute_target_space. (gcc_tree_to_linear_expression): Nex parameter lambda_obstack. Pass it to lambda_linear_expression_new. (gcc_loop_to_lambda_loop): New parameter lambda_obstack. Pass it to gcc_tree_to_linear_expression. (gcc_loopnest_to_lambda_loopnest): New parameter lambda_obstack. Pass it to gcc_loop_to_lambda_loop and lambda_loopnest_new. (lambda_loopnest_to_gcc_loopnest): New parameter lambda_obstack. Pass it to lambda_body_vector_new and lambda_body_vector_compute_new. * Makefile.in (tree-loop-linear.o): Add $(OBSTACK_H) dependency. (lambda-code.o): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@128219 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-loop-linear.c')
-rw-r--r--gcc/tree-loop-linear.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/gcc/tree-loop-linear.c b/gcc/tree-loop-linear.c
index 3fb4d05dbe1..d04045ded4f 100644
--- a/gcc/tree-loop-linear.c
+++ b/gcc/tree-loop-linear.c
@@ -30,6 +30,7 @@ along with GCC; see the file COPYING3. If not see
#include "rtl.h"
#include "basic-block.h"
#include "diagnostic.h"
+#include "obstack.h"
#include "tree-flow.h"
#include "tree-dump.h"
#include "timevar.h"
@@ -253,7 +254,7 @@ linear_transform_loops (void)
VEC(tree,heap) *oldivs = NULL;
VEC(tree,heap) *invariants = NULL;
struct loop *loop_nest;
-
+
FOR_EACH_LOOP (li, loop_nest, 0)
{
unsigned int depth = 0;
@@ -263,6 +264,9 @@ linear_transform_loops (void)
lambda_loopnest before, after;
lambda_trans_matrix trans;
bool problem = false;
+ struct obstack lambda_obstack;
+ gcc_obstack_init (&lambda_obstack);
+
/* If it's not a loop nest, we don't want it.
We also don't handle sibling loops properly,
which are loops of the following form:
@@ -327,7 +331,7 @@ linear_transform_loops (void)
}
before = gcc_loopnest_to_lambda_loopnest (loop_nest, &oldivs,
- &invariants);
+ &invariants, &lambda_obstack);
if (!before)
goto free_and_continue;
@@ -338,7 +342,7 @@ linear_transform_loops (void)
print_lambda_loopnest (dump_file, before, 'i');
}
- after = lambda_loopnest_transform (before, trans);
+ after = lambda_loopnest_transform (before, trans, &lambda_obstack);
if (dump_file)
{
@@ -347,13 +351,14 @@ linear_transform_loops (void)
}
lambda_loopnest_to_gcc_loopnest (loop_nest, oldivs, invariants,
- after, trans);
+ after, trans, &lambda_obstack);
modified = true;
if (dump_file)
fprintf (dump_file, "Successfully transformed loop.\n");
free_and_continue:
+ obstack_free (&lambda_obstack, NULL);
free_dependence_relations (dependence_relations);
free_data_refs (datarefs);
}