diff options
author | hjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-11-25 10:55:54 +0000 |
---|---|---|
committer | hjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-11-25 10:55:54 +0000 |
commit | 48e1416a24d50cacbb2a5e06a9ee61dd8cbee313 (patch) | |
tree | 4375f002b368e9044a1d9ca874026be04b7c3105 /gcc/tree-ssa-coalesce.c | |
parent | 7f0f96af0499f0a9f8ee7198823d311f1a66ca9b (diff) | |
download | gcc-48e1416a24d50cacbb2a5e06a9ee61dd8cbee313.tar.gz |
Remove trailing white spaces.
2009-11-25 H.J. Lu <hongjiu.lu@intel.com>
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@154645 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-coalesce.c')
-rw-r--r-- | gcc/tree-ssa-coalesce.c | 114 |
1 files changed, 57 insertions, 57 deletions
diff --git a/gcc/tree-ssa-coalesce.c b/gcc/tree-ssa-coalesce.c index 5841aa07522..867e15c06e0 100644 --- a/gcc/tree-ssa-coalesce.c +++ b/gcc/tree-ssa-coalesce.c @@ -36,8 +36,8 @@ along with GCC; see the file COPYING3. If not see /* This set of routines implements a coalesce_list. This is an object which is used to track pairs of ssa_names which are desirable to coalesce - together to avoid copies. Costs are associated with each pair, and when - all desired information has been collected, the object can be used to + together to avoid copies. Costs are associated with each pair, and when + all desired information has been collected, the object can be used to order the pairs for processing. */ /* This structure defines a pair entry. */ @@ -59,7 +59,7 @@ typedef struct cost_one_pair_d /* This structure maintains the list of coalesce pairs. */ -typedef struct coalesce_list_d +typedef struct coalesce_list_d { htab_t list; /* Hash table. */ coalesce_pair_p *sorted; /* List when sorted. */ @@ -91,7 +91,7 @@ coalesce_cost (int frequency, bool optimize_for_size) /* Return the cost of executing a copy instruction in basic block BB. */ -static inline int +static inline int coalesce_cost_bb (basic_block bb) { return coalesce_cost (bb->frequency, optimize_bb_for_size_p (bb)); @@ -100,7 +100,7 @@ coalesce_cost_bb (basic_block bb) /* Return the cost of executing a copy instruction on edge E. */ -static inline int +static inline int coalesce_cost_edge (edge e) { int mult = 1; @@ -133,12 +133,12 @@ coalesce_cost_edge (edge e) } } - return coalesce_cost (EDGE_FREQUENCY (e), + return coalesce_cost (EDGE_FREQUENCY (e), optimize_edge_for_size_p (e)) * mult; } -/* Retrieve a pair to coalesce from the cost_one_list in CL. Returns the +/* Retrieve a pair to coalesce from the cost_one_list in CL. Returns the 2 elements via P1 and P2. 1 is returned by the function if there is a pair, NO_BEST_COALESCE is returned if there aren't any. */ @@ -160,7 +160,7 @@ pop_cost_one_pair (coalesce_list_p cl, int *p1, int *p2) return 1; } -/* Retrieve the most expensive remaining pair to coalesce from CL. Returns the +/* Retrieve the most expensive remaining pair to coalesce from CL. Returns the 2 elements via P1 and P2. Their calculated cost is returned by the function. NO_BEST_COALESCE is returned if the coalesce list is empty. */ @@ -190,7 +190,7 @@ pop_best_coalesce (coalesce_list_p cl, int *p1, int *p2) /* Hash function for coalesce list. Calculate hash for PAIR. */ -static unsigned int +static unsigned int coalesce_pair_map_hash (const void *pair) { hashval_t a = (hashval_t)(((const_coalesce_pair_p)pair)->first_element); @@ -203,7 +203,7 @@ coalesce_pair_map_hash (const void *pair) /* Equality function for coalesce list hash table. Compare PAIR1 and PAIR2, returning TRUE if the two pairs are equivalent. */ -static int +static int coalesce_pair_map_eq (const void *pair1, const void *pair2) { const_coalesce_pair_p const p1 = (const_coalesce_pair_p) pair1; @@ -216,13 +216,13 @@ coalesce_pair_map_eq (const void *pair1, const void *pair2) /* Create a new empty coalesce list object and return it. */ -static inline coalesce_list_p +static inline coalesce_list_p create_coalesce_list (void) { coalesce_list_p list; unsigned size = num_ssa_names * 3; - if (size < 40) + if (size < 40) size = 40; list = (coalesce_list_p) xmalloc (sizeof (struct coalesce_list_d)); @@ -237,7 +237,7 @@ create_coalesce_list (void) /* Delete coalesce list CL. */ -static inline void +static inline void delete_coalesce_list (coalesce_list_p cl) { gcc_assert (cl->cost_one_list == NULL); @@ -249,8 +249,8 @@ delete_coalesce_list (coalesce_list_p cl) } -/* Find a matching coalesce pair object in CL for the pair P1 and P2. If - one isn't found, return NULL if CREATE is false, otherwise create a new +/* Find a matching coalesce pair object in CL for the pair P1 and P2. If + one isn't found, return NULL if CREATE is false, otherwise create a new coalesce pair object and return it. */ static coalesce_pair_p @@ -259,7 +259,7 @@ find_coalesce_pair (coalesce_list_p cl, int p1, int p2, bool create) struct coalesce_pair p, *pair; void **slot; unsigned int hash; - + /* Normalize so that p1 is the smaller value. */ if (p2 < p1) { @@ -271,8 +271,8 @@ find_coalesce_pair (coalesce_list_p cl, int p1, int p2, bool create) p.first_element = p1; p.second_element = p2; } - - + + hash = coalesce_pair_map_hash (&p); pair = (struct coalesce_pair *) htab_find_with_hash (cl->list, &p, hash); @@ -305,7 +305,7 @@ add_cost_one_coalesce (coalesce_list_p cl, int p1, int p2) /* Add a coalesce between P1 and P2 in list CL with a cost of VALUE. */ -static inline void +static inline void add_coalesce (coalesce_list_p cl, int p1, int p2, int value) { coalesce_pair_p node; @@ -329,7 +329,7 @@ add_coalesce (coalesce_list_p cl, int p1, int p2, int value) /* Comparison function to allow qsort to sort P1 and P2 in Ascending order. */ -static int +static int compare_pairs (const void *p1, const void *p2) { const_coalesce_pair_p const *const pp1 = (const_coalesce_pair_p const *) p1; @@ -458,7 +458,7 @@ sort_coalesce_list (coalesce_list_p cl) /* Send debug info for coalesce list CL to file F. */ -static void +static void dump_coalesce_list (FILE *f, coalesce_list_p cl) { coalesce_pair_p node; @@ -498,7 +498,7 @@ dump_coalesce_list (FILE *f, coalesce_list_p cl) } -/* This represents a conflict graph. Implemented as an array of bitmaps. +/* This represents a conflict graph. Implemented as an array of bitmaps. A full matrix is used for conflicts rather than just upper triangular form. this make sit much simpler and faster to perform conflict merges. */ @@ -639,15 +639,15 @@ ssa_conflicts_dump (FILE *file, ssa_conflicts_p ptr) } -/* This structure is used to efficiently record the current status of live - SSA_NAMES when building a conflict graph. +/* This structure is used to efficiently record the current status of live + SSA_NAMES when building a conflict graph. LIVE_BASE_VAR has a bit set for each base variable which has at least one ssa version live. - LIVE_BASE_PARTITIONS is an array of bitmaps using the basevar table as an - index, and is used to track what partitions of each base variable are - live. This makes it easy to add conflicts between just live partitions - with the same base variable. - The values in LIVE_BASE_PARTITIONS are only valid if the base variable is + LIVE_BASE_PARTITIONS is an array of bitmaps using the basevar table as an + index, and is used to track what partitions of each base variable are + live. This makes it easy to add conflicts between just live partitions + with the same base variable. + The values in LIVE_BASE_PARTITIONS are only valid if the base variable is marked as being live. This delays clearing of these bitmaps until they are actually needed again. */ @@ -721,7 +721,7 @@ live_track_add_partition (live_track_p ptr, int partition) int root; root = basevar_index (ptr->map, partition); - /* If this base var wasn't live before, it is now. Clear the element list + /* If this base var wasn't live before, it is now. Clear the element list since it was delayed until needed. */ if (!bitmap_bit_p (ptr->live_base_var, root)) { @@ -729,7 +729,7 @@ live_track_add_partition (live_track_p ptr, int partition) bitmap_clear (ptr->live_base_partitions[root]); } bitmap_set_bit (ptr->live_base_partitions[root], partition); - + } @@ -764,7 +764,7 @@ live_track_live_p (live_track_p ptr, tree var) } -/* This routine will add USE to PTR. USE will be marked as live in both the +/* This routine will add USE to PTR. USE will be marked as live in both the ssa live map and the live bitmap for the root of USE. */ static inline void @@ -782,7 +782,7 @@ live_track_process_use (live_track_p ptr, tree use) /* This routine will process a DEF in PTR. DEF will be removed from the live - lists, and if there are any other live partitions with the same base + lists, and if there are any other live partitions with the same base variable, conflicts will be added to GRAPH. */ static inline void @@ -838,8 +838,8 @@ live_track_clear_base_vars (live_track_p ptr) /* Build a conflict graph based on LIVEINFO. Any partitions which are in the - partition view of the var_map liveinfo is based on get entries in the - conflict graph. Only conflicts between ssa_name partitions with the same + partition view of the var_map liveinfo is based on get entries in the + conflict graph. Only conflicts between ssa_name partitions with the same base variable are added. */ static ssa_conflicts_p @@ -868,12 +868,12 @@ build_ssa_conflict_graph (tree_live_info_p liveinfo) tree var; gimple stmt = gsi_stmt (gsi); - /* A copy between 2 partitions does not introduce an interference - by itself. If they did, you would never be able to coalesce - two things which are copied. If the two variables really do - conflict, they will conflict elsewhere in the program. - - This is handled by simply removing the SRC of the copy from the + /* A copy between 2 partitions does not introduce an interference + by itself. If they did, you would never be able to coalesce + two things which are copied. If the two variables really do + conflict, they will conflict elsewhere in the program. + + This is handled by simply removing the SRC of the copy from the live list, and processing the stmt normally. */ if (is_gimple_assign (stmt)) { @@ -894,11 +894,11 @@ build_ssa_conflict_graph (tree_live_info_p liveinfo) live_track_process_use (live, var); } - /* If result of a PHI is unused, looping over the statements will not + /* If result of a PHI is unused, looping over the statements will not record any conflicts since the def was never live. Since the PHI node is going to be translated out of SSA form, it will insert a copy. - There must be a conflict recorded between the result of the PHI and - any variables that are live. Otherwise the out-of-ssa translation + There must be a conflict recorded between the result of the PHI and + any variables that are live. Otherwise the out-of-ssa translation may create incorrect code. */ for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi)) { @@ -932,7 +932,7 @@ print_exprs (FILE *f, const char *str1, tree expr1, const char *str2, /* Called if a coalesce across and abnormal edge cannot be performed. PHI is - the phi node at fault, I is the argument index at fault. A message is + the phi node at fault, I is the argument index at fault. A message is printed and compilation is then terminated. */ static inline void @@ -1016,7 +1016,7 @@ create_outofssa_var_map (coalesce_list_p cl, bitmap used_in_copy) ver = SSA_NAME_VERSION (res); register_ssa_partition (map, res); - /* Register ssa_names and coalesces between the args and the result + /* Register ssa_names and coalesces between the args and the result of all PHI. */ for (i = 0; i < gimple_phi_num_args (phi); i++) { @@ -1024,7 +1024,7 @@ create_outofssa_var_map (coalesce_list_p cl, bitmap used_in_copy) arg = PHI_ARG_DEF (phi, i); if (TREE_CODE (arg) == SSA_NAME) register_ssa_partition (map, arg); - if (TREE_CODE (arg) == SSA_NAME + if (TREE_CODE (arg) == SSA_NAME && SSA_NAME_VAR (arg) == SSA_NAME_VAR (res)) { saw_copy = true; @@ -1120,7 +1120,7 @@ create_outofssa_var_map (coalesce_list_p cl, bitmap used_in_copy) if (SSA_NAME_VAR (outputs[match]) == SSA_NAME_VAR (input)) { - cost = coalesce_cost (REG_BR_PROB_BASE, + cost = coalesce_cost (REG_BR_PROB_BASE, optimize_bb_for_size_p (bb)); add_coalesce (cl, v1, v2, cost); bitmap_set_bit (used_in_copy, v1); @@ -1133,7 +1133,7 @@ create_outofssa_var_map (coalesce_list_p cl, bitmap used_in_copy) default: break; } - + #ifdef ENABLE_CHECKING /* Mark real uses and defs. */ FOR_EACH_SSA_TREE_OPERAND (var, stmt, iter, (SSA_OP_DEF|SSA_OP_USE)) @@ -1141,7 +1141,7 @@ create_outofssa_var_map (coalesce_list_p cl, bitmap used_in_copy) /* Validate that virtual ops don't get used in funny ways. */ if (gimple_vuse (stmt)) - bitmap_set_bit (used_in_virtual_ops, + bitmap_set_bit (used_in_virtual_ops, DECL_UID (SSA_NAME_VAR (gimple_vuse (stmt)))); #endif /* ENABLE_CHECKING */ } @@ -1228,7 +1228,7 @@ attempt_coalesce (var_map map, ssa_conflicts_p graph, int x, int y, print_generic_expr (debug, partition_to_var (map, p2), TDF_SLIM); } - if (p1 == p2) + if (p1 == p2) { if (debug) fprintf (debug, ": Already Coalesced.\n"); @@ -1251,7 +1251,7 @@ attempt_coalesce (var_map map, ssa_conflicts_p graph, int x, int y, return false; } - /* z is the new combined partition. Remove the other partition from + /* z is the new combined partition. Remove the other partition from the list, and merge the conflicts. */ if (z == p1) ssa_conflicts_merge (graph, p1, p2); @@ -1270,11 +1270,11 @@ attempt_coalesce (var_map map, ssa_conflicts_p graph, int x, int y, } -/* Attempt to Coalesce partitions in MAP which occur in the list CL using +/* Attempt to Coalesce partitions in MAP which occur in the list CL using GRAPH. Debug output is sent to DEBUG if it is non-NULL. */ static void -coalesce_partitions (var_map map, ssa_conflicts_p graph, coalesce_list_p cl, +coalesce_partitions (var_map map, ssa_conflicts_p graph, coalesce_list_p cl, FILE *debug) { int x = 0, y = 0; @@ -1285,7 +1285,7 @@ coalesce_partitions (var_map map, ssa_conflicts_p graph, coalesce_list_p cl, edge_iterator ei; /* First, coalesce all the copies across abnormal edges. These are not placed - in the coalesce list because they do not need to be sorted, and simply + in the coalesce list because they do not need to be sorted, and simply consume extra memory/compilation time in large programs. */ FOR_EACH_BB (bb) @@ -1432,14 +1432,14 @@ coalesce_ssa_name (void) dump_coalesce_list (dump_file, cl); } - /* First, coalesce all live on entry variables to their base variable. + /* First, coalesce all live on entry variables to their base variable. This will ensure the first use is coming from the correct location. */ if (dump_file && (dump_flags & TDF_DETAILS)) dump_var_map (dump_file, map); /* Now coalesce everything in the list. */ - coalesce_partitions (map, graph, cl, + coalesce_partitions (map, graph, cl, ((dump_flags & TDF_DETAILS) ? dump_file : NULL)); |