comparison gcc/tree-ssa-uncprop.c @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 84e7813d76e9
children
comparison
equal deleted inserted replaced
131:84e7813d76e9 145:1830386684a0
1 /* Routines for discovering and unpropagating edge equivalences. 1 /* Routines for discovering and unpropagating edge equivalences.
2 Copyright (C) 2005-2018 Free Software Foundation, Inc. 2 Copyright (C) 2005-2020 Free Software Foundation, Inc.
3 3
4 This file is part of GCC. 4 This file is part of GCC.
5 5
6 GCC is free software; you can redistribute it and/or modify 6 GCC is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by 7 it under the terms of the GNU General Public License as published by
266 the RHS of an assignment). A value may be an SSA_NAME or an 266 the RHS of an assignment). A value may be an SSA_NAME or an
267 invariant. We may have several SSA_NAMEs with the same value, 267 invariant. We may have several SSA_NAMEs with the same value,
268 so with each value we have a list of SSA_NAMEs that have the 268 so with each value we have a list of SSA_NAMEs that have the
269 same value. */ 269 same value. */
270 270
271 271 typedef hash_map<tree_operand_hash, auto_vec<tree> > val_ssa_equiv_t;
272 /* Main structure for recording equivalences into our hash table. */
273 struct equiv_hash_elt
274 {
275 /* The value/key of this entry. */
276 tree value;
277
278 /* List of SSA_NAMEs which have the same value/key. */
279 vec<tree> equivalences;
280 };
281 272
282 /* Global hash table implementing a mapping from invariant values 273 /* Global hash table implementing a mapping from invariant values
283 to a list of SSA_NAMEs which have the same value. We might be 274 to a list of SSA_NAMEs which have the same value. We might be
284 able to reuse tree-vn for this code. */ 275 able to reuse tree-vn for this code. */
285 static hash_map<tree, auto_vec<tree> > *val_ssa_equiv; 276 val_ssa_equiv_t *val_ssa_equiv;
286 277
287 static void uncprop_into_successor_phis (basic_block); 278 static void uncprop_into_successor_phis (basic_block);
288 279
289 /* Remove the most recently recorded equivalency for VALUE. */ 280 /* Remove the most recently recorded equivalency for VALUE. */
290 281
474 basic_block bb; 465 basic_block bb;
475 466
476 associate_equivalences_with_edges (); 467 associate_equivalences_with_edges ();
477 468
478 /* Create our global data structures. */ 469 /* Create our global data structures. */
479 val_ssa_equiv = new hash_map<tree, auto_vec<tree> > (1024); 470 val_ssa_equiv = new val_ssa_equiv_t (1024);
480 471
481 /* We're going to do a dominator walk, so ensure that we have 472 /* We're going to do a dominator walk, so ensure that we have
482 dominance information. */ 473 dominance information. */
483 calculate_dominance_info (CDI_DOMINATORS); 474 calculate_dominance_info (CDI_DOMINATORS);
484 475