From b8698a0f3794ca2fda9837dfdd83feea1a4ca75c Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Wed, 25 Nov 2009 10:55:54 +0000 Subject: Remove trailing white spaces. 2009-11-25 H.J. Lu * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645 --- gcc/matrix-reorg.c | 140 ++++++++++++++++++++++++++--------------------------- 1 file changed, 70 insertions(+), 70 deletions(-) (limited to 'gcc/matrix-reorg.c') diff --git a/gcc/matrix-reorg.c b/gcc/matrix-reorg.c index d2687b8..71c7419 100644 --- a/gcc/matrix-reorg.c +++ b/gcc/matrix-reorg.c @@ -2,7 +2,7 @@ Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation, Inc. Contributed by Razya Ladelsky Originally written by Revital Eres and Mustafa Hagog. - + This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under @@ -20,7 +20,7 @@ along with GCC; see the file COPYING3. If not see . */ /* - Matrix flattening optimization tries to replace a N-dimensional + Matrix flattening optimization tries to replace a N-dimensional matrix with its equivalent M-dimensional matrix, where M < N. This first implementation focuses on global matrices defined dynamically. @@ -43,31 +43,31 @@ along with GCC; see the file COPYING3. If not see and transformation. The driver of the optimization is matrix_reorg (). - - + + Analysis phase: =============== - We'll number the dimensions outside-in, meaning the most external - is 0, then 1, and so on. - The analysis part of the optimization determines K, the escape - level of a N-dimensional matrix (K <= N), that allows flattening of + We'll number the dimensions outside-in, meaning the most external + is 0, then 1, and so on. + The analysis part of the optimization determines K, the escape + level of a N-dimensional matrix (K <= N), that allows flattening of the external dimensions 0,1,..., K-1. Escape level 0 means that the whole matrix escapes and no flattening is possible. - - The analysis part is implemented in analyze_matrix_allocation_site() + + The analysis part is implemented in analyze_matrix_allocation_site() and analyze_matrix_accesses(). Transformation phase: ===================== - In this phase we define the new flattened matrices that replace the - original matrices in the code. - Implemented in transform_allocation_sites(), - transform_access_sites(). + In this phase we define the new flattened matrices that replace the + original matrices in the code. + Implemented in transform_allocation_sites(), + transform_access_sites(). Matrix Transposing ================== - The idea of Matrix Transposing is organizing the matrix in a different + The idea of Matrix Transposing is organizing the matrix in a different layout such that the dimensions are reordered. This could produce better cache behavior in some cases. @@ -77,7 +77,7 @@ along with GCC; see the file COPYING3. If not see for (j=0; jmax_malloced_level-1 == level means that we've - seen a malloc statement of level 'level' before. - If the statement is not the same one that we've - seen before, then there's another malloc statement - for the same level, which means that we need to mark + /* This is a call to malloc of level 'level'. + mi->max_malloced_level-1 == level means that we've + seen a malloc statement of level 'level' before. + If the statement is not the same one that we've + seen before, then there's another malloc statement + for the same level, which means that we need to mark it escaping. */ if (mi->malloc_for_level && mi->max_malloced_level-1 == level @@ -864,26 +864,26 @@ analyze_matrix_allocation_site (struct matrix_info *mi, gimple stmt, } /* The transposing decision making. - In order to to calculate the profitability of transposing, we collect two + In order to to calculate the profitability of transposing, we collect two types of information regarding the accesses: 1. profiling information used to express the hotness of an access, that - is how often the matrix is accessed by this access site (count of the - access site). + is how often the matrix is accessed by this access site (count of the + access site). 2. which dimension in the access site is iterated by the inner most loop containing this access. - The matrix will have a calculated value of weighted hotness for each + The matrix will have a calculated value of weighted hotness for each dimension. - Intuitively the hotness level of a dimension is a function of how - many times it was the most frequently accessed dimension in the + Intuitively the hotness level of a dimension is a function of how + many times it was the most frequently accessed dimension in the highly executed access sites of this matrix. As computed by following equation: - m n - __ __ - \ \ dim_hot_level[i] += + m n + __ __ + \ \ dim_hot_level[i] += /_ /_ - j i + j i acc[j]->dim[i]->iter_by_inner_loop * count(j) Where n is the number of dims and m is the number of the matrix @@ -957,7 +957,7 @@ analyze_transpose (void **slot, void *data ATTRIBUTE_UNUSED) return 1; } -/* Find the index which defines the OFFSET from base. +/* Find the index which defines the OFFSET from base. We walk from use to def until we find how the offset was defined. */ static tree get_index_from_offset (tree offset, gimple def_stmt) @@ -1043,9 +1043,9 @@ update_type_size (struct matrix_info *mi, gimple stmt, tree ssa_var, } } -/* USE_STMT represents a GIMPLE_CALL, where one of the arguments is the - ssa var that we want to check because it came from some use of matrix - MI. CURRENT_INDIRECT_LEVEL is the indirection level we reached so +/* USE_STMT represents a GIMPLE_CALL, where one of the arguments is the + ssa var that we want to check because it came from some use of matrix + MI. CURRENT_INDIRECT_LEVEL is the indirection level we reached so far. */ static int @@ -1122,14 +1122,14 @@ analyze_accesses_for_call_stmt (struct matrix_info *mi, tree ssa_var, return current_indirect_level; } -/* USE_STMT represents a phi node of the ssa var that we want to - check because it came from some use of matrix +/* USE_STMT represents a phi node of the ssa var that we want to + check because it came from some use of matrix MI. We check all the escaping levels that get to the PHI node and make sure they are all the same escaping; if not (which is rare) we let the escaping level be the minimum level that gets into that PHI because starting from - that level we cannot expect the behavior of the indirections. + that level we cannot expect the behavior of the indirections. CURRENT_INDIRECT_LEVEL is the indirection level we reached so far. */ static void @@ -1186,8 +1186,8 @@ analyze_accesses_for_phi_node (struct matrix_info *mi, gimple use_stmt, } } -/* USE_STMT represents an assign statement (the rhs or lhs include - the ssa var that we want to check because it came from some use of matrix +/* USE_STMT represents an assign statement (the rhs or lhs include + the ssa var that we want to check because it came from some use of matrix MI. CURRENT_INDIRECT_LEVEL is the indirection level we reached so far. */ static int @@ -1246,7 +1246,7 @@ analyze_accesses_for_assign_stmt (struct matrix_info *mi, tree ssa_var, } return current_indirect_level; } - /* Now, check the right-hand-side, to see how the SSA variable + /* Now, check the right-hand-side, to see how the SSA variable is used. */ if (rhs_acc.var_found) { @@ -1317,8 +1317,8 @@ analyze_accesses_for_assign_stmt (struct matrix_info *mi, tree ssa_var, /* One exception is when we are storing to the matrix variable itself; this is the case of malloc, we must make - sure that it's the one and only one call to malloc so - we call analyze_matrix_allocation_site to check + sure that it's the one and only one call to malloc so + we call analyze_matrix_allocation_site to check this out. */ if (TREE_CODE (lhs) != VAR_DECL || lhs != mi->decl) mark_min_matrix_escape_level (mi, current_indirect_level, @@ -1344,7 +1344,7 @@ analyze_accesses_for_assign_stmt (struct matrix_info *mi, tree ssa_var, return current_indirect_level; } -/* Given a SSA_VAR (coming from a use statement of the matrix MI), +/* Given a SSA_VAR (coming from a use statement of the matrix MI), follow its uses and level of indirection and find out the minimum indirection level it escapes in (the highest dimension) and the maximum level it is accessed in (this will be the actual dimension of the @@ -1400,7 +1400,7 @@ analyze_matrix_accesses (struct matrix_info *mi, tree ssa_var, } } -typedef struct +typedef struct { tree fn; gimple stmt; @@ -1457,7 +1457,7 @@ can_calculate_stmt_before_stmt (gimple stmt, sbitmap visited) case GIMPLE_ASSIGN: code = gimple_assign_rhs_code (stmt); op1 = gimple_assign_rhs1 (stmt); - + switch (code) { case POINTER_PLUS_EXPR: @@ -1804,12 +1804,12 @@ compute_offset (HOST_WIDE_INT orig, HOST_WIDE_INT new_val, tree result) according to the following equation: a[I1][I2]...[Ik] , where D1..Dk is the length of each dimension and the - escaping level is m <= k, and a' is the new allocated matrix, + escaping level is m <= k, and a' is the new allocated matrix, will be translated to : - + b[I(m+1)]...[Ik] - - where + + where b = a' + I1*D2...*Dm + I2*D3...Dm + ... + Im */ @@ -2017,7 +2017,7 @@ sort_dim_hot_level (gcov_type * a, int *dim_map, int n) Make sure that we hold the size in the malloc site inside a new global variable; this way we ensure that the size doesn't change and it is accessible from all the other functions that - uses the matrix. Also, the original calls to free are deleted, + uses the matrix. Also, the original calls to free are deleted, and replaced by a new call to free the flattened matrix. */ static int @@ -2413,7 +2413,7 @@ gate_matrix_reorg (void) return flag_ipa_matrix_reorg && flag_whole_program; } -struct simple_ipa_opt_pass pass_ipa_matrix_reorg = +struct simple_ipa_opt_pass pass_ipa_matrix_reorg = { { SIMPLE_IPA_PASS, -- cgit v1.1