From 6b6f234c9115dd601d3de99c1f462e6452eadb07 Mon Sep 17 00:00:00 2001 From: dberlin Date: Thu, 26 Aug 2004 17:10:50 +0000 Subject: 2004-08-26 Daniel Berlin * Makefile.in (lambda-code.o): New. (lambda-trans.o): Ditto. (TREE_DATA_REF_H): Ditto. (LAMBDA_H): Ditto. (lambda-mat.o): Use LAMBDA_H. (tree-data-ref.o): Ditto. * lambda-code.c: New file. Lambda code generation algorithm. * lambda-trans.c: Ditto. Lambda transformation matrix support. * lambda.h: Add lambda loop structures. Add lambda loopnest structures. Add lambda body vector structure. Add lambda linear expression structures. Add prototypes for functions in new files. * lambda-mat.c: Include tree.h 2004-08-26 Daniel Berlin Sebastian Pop * tree-data-ref.h: Include lambda.h (free_dependence_relation): Declared here. (free_dependence_relations): Ditto. (free_data_refs): Ditto. * tree-data-ref.c (free_dependence_relation): New function. (free_dependence_relations): Ditto. (free_data_refs): Ditot. (analyze_all_data_dependences): Free datarefs and dependence_relations. (build_classic_dist_vector): Store in the dependence_relations the information. Each arc in the dependence_relations graph is labelled with the distance and direction vectors. (build_classic_dir_vector): Ditto. (compute_rw_wr_ww_dependences): Renamed again compute_all_dependences. Now computes again the whole dependence graph including read-read relations. (compute_data_dependences_for_loop): Now dependence_relations contains all the data, and thus it doesn't need to initialize the classic_dir and classic_dist vectors. (analyze_all_data_dependences): Adjusted for using the new interface of compute_data_dependences_for_loop. Remove the statistics dump. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@86627 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/lambda-trans.c | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 gcc/lambda-trans.c (limited to 'gcc/lambda-trans.c') diff --git a/gcc/lambda-trans.c b/gcc/lambda-trans.c new file mode 100644 index 00000000000..5195bb61c8f --- /dev/null +++ b/gcc/lambda-trans.c @@ -0,0 +1,71 @@ +/* Lambda matrix transformations. + Copyright (C) 2003, 2004 Free Software Foundation, Inc. + Contributed by Daniel Berlin . + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 2, or (at your option) any later +version. + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ + +#include "config.h" +#include "system.h" +#include "coretypes.h" +#include "tm.h" +#include "errors.h" +#include "ggc.h" +#include "tree.h" +#include "target.h" +#include "varray.h" +#include "lambda.h" + +/* Allocate a new transformation matrix. */ + +lambda_trans_matrix +lambda_trans_matrix_new (int colsize, int rowsize) +{ + lambda_trans_matrix ret; + + ret = ggc_alloc (sizeof (*ret)); + LTM_MATRIX (ret) = lambda_matrix_new (rowsize, colsize); + LTM_ROWSIZE (ret) = rowsize; + LTM_COLSIZE (ret) = colsize; + LTM_DENOMINATOR (ret) = 1; + return ret; +} + +/* Compute the inverse of the transformation. */ + +lambda_trans_matrix +lambda_trans_matrix_inverse (lambda_trans_matrix mat) +{ + lambda_trans_matrix inverse; + int determinant; + + inverse = lambda_trans_matrix_new (LTM_ROWSIZE (mat), LTM_COLSIZE (mat)); + determinant = lambda_matrix_inverse (LTM_MATRIX (mat), LTM_MATRIX (inverse), + LTM_ROWSIZE (mat)); + LTM_DENOMINATOR (inverse) = determinant; + return inverse; +} + + +/* Print out a transformation matrix. */ + +void +print_lambda_trans_matrix (FILE *outfile, lambda_trans_matrix mat) +{ + print_lambda_matrix (outfile, LTM_MATRIX (mat), LTM_ROWSIZE (mat), + LTM_COLSIZE (mat)); +} -- cgit v1.2.1