cse.c (169690) | cse.c (235623) |
---|---|
1/* Common subexpression elimination for GNU compiler. 2 Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998 3 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. 4 5This file is part of GCC. 6 7GCC is free software; you can redistribute it and/or modify it under 8the terms of the GNU General Public License as published by the Free --- 569 unchanged lines hidden (view full) --- 578static int preferable (int, int, int, int); 579static void new_basic_block (void); 580static void make_new_qty (unsigned int, enum machine_mode); 581static void make_regs_eqv (unsigned int, unsigned int); 582static void delete_reg_equiv (unsigned int); 583static int mention_regs (rtx); 584static int insert_regs (rtx, struct table_elt *, int); 585static void remove_from_table (struct table_elt *, unsigned); | 1/* Common subexpression elimination for GNU compiler. 2 Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998 3 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. 4 5This file is part of GCC. 6 7GCC is free software; you can redistribute it and/or modify it under 8the terms of the GNU General Public License as published by the Free --- 569 unchanged lines hidden (view full) --- 578static int preferable (int, int, int, int); 579static void new_basic_block (void); 580static void make_new_qty (unsigned int, enum machine_mode); 581static void make_regs_eqv (unsigned int, unsigned int); 582static void delete_reg_equiv (unsigned int); 583static int mention_regs (rtx); 584static int insert_regs (rtx, struct table_elt *, int); 585static void remove_from_table (struct table_elt *, unsigned); |
586static struct table_elt *lookup (rtx, unsigned, enum machine_mode); | 586static void remove_pseudo_from_table (rtx, unsigned); 587static struct table_elt *lookup (rtx, unsigned, enum machine_mode); |
587static struct table_elt *lookup_for_remove (rtx, unsigned, enum machine_mode); 588static rtx lookup_as_function (rtx, enum rtx_code); 589static struct table_elt *insert (rtx, struct table_elt *, unsigned, 590 enum machine_mode); 591static void merge_equiv_classes (struct table_elt *, struct table_elt *); 592static void invalidate (rtx, enum machine_mode); 593static int cse_rtx_varies_p (rtx, int); 594static void remove_invalid_refs (unsigned int); --- 781 unchanged lines hidden (view full) --- 1376 1377 /* Now add it to the free element chain. */ 1378 elt->next_same_hash = free_element_chain; 1379 free_element_chain = elt; 1380 1381 table_size--; 1382} 1383 | 588static struct table_elt *lookup_for_remove (rtx, unsigned, enum machine_mode); 589static rtx lookup_as_function (rtx, enum rtx_code); 590static struct table_elt *insert (rtx, struct table_elt *, unsigned, 591 enum machine_mode); 592static void merge_equiv_classes (struct table_elt *, struct table_elt *); 593static void invalidate (rtx, enum machine_mode); 594static int cse_rtx_varies_p (rtx, int); 595static void remove_invalid_refs (unsigned int); --- 781 unchanged lines hidden (view full) --- 1377 1378 /* Now add it to the free element chain. */ 1379 elt->next_same_hash = free_element_chain; 1380 free_element_chain = elt; 1381 1382 table_size--; 1383} 1384 |
1385/* Same as above, but X is a pseudo-register. */ 1386 1387static void 1388remove_pseudo_from_table (rtx x, unsigned int hash) 1389{ 1390 struct table_elt *elt; 1391 1392 /* Because a pseudo-register can be referenced in more than one 1393 mode, we might have to remove more than one table entry. */ 1394 while ((elt = lookup_for_remove (x, hash, VOIDmode))) 1395 remove_from_table (elt, hash); 1396} 1397 |
|
1384/* Look up X in the hash table and return its table element, 1385 or 0 if X is not in the table. 1386 1387 MODE is the machine-mode of X, or if X is an integer constant 1388 with VOIDmode then MODE is the mode with which X will be used. 1389 1390 Here we are satisfied to find an expression whose tree structure 1391 looks like X. */ --- 310 unchanged lines hidden (view full) --- 1702 hash = HASH (exp, mode); 1703 1704 if (REG_P (exp)) 1705 { 1706 need_rehash = REGNO_QTY_VALID_P (REGNO (exp)); 1707 delete_reg_equiv (REGNO (exp)); 1708 } 1709 | 1398/* Look up X in the hash table and return its table element, 1399 or 0 if X is not in the table. 1400 1401 MODE is the machine-mode of X, or if X is an integer constant 1402 with VOIDmode then MODE is the mode with which X will be used. 1403 1404 Here we are satisfied to find an expression whose tree structure 1405 looks like X. */ --- 310 unchanged lines hidden (view full) --- 1716 hash = HASH (exp, mode); 1717 1718 if (REG_P (exp)) 1719 { 1720 need_rehash = REGNO_QTY_VALID_P (REGNO (exp)); 1721 delete_reg_equiv (REGNO (exp)); 1722 } 1723 |
1710 remove_from_table (elt, hash); | 1724 if (REG_P (exp) && REGNO (exp) >= FIRST_PSEUDO_REGISTER) 1725 remove_pseudo_from_table (exp, hash); 1726 else 1727 remove_from_table (elt, hash); |
1711 1712 if (insert_regs (exp, class1, 0) || need_rehash) 1713 { 1714 rehash_using_reg (exp); 1715 hash = HASH (exp, mode); 1716 } 1717 new = insert (exp, class1, hash, mode); 1718 new->in_memory = hash_arg_in_memory; --- 79 unchanged lines hidden (view full) --- 1798 registers are in the table, we must remove any REG entries that 1799 overlap these registers. */ 1800 1801 delete_reg_equiv (regno); 1802 REG_TICK (regno)++; 1803 SUBREG_TICKED (regno) = -1; 1804 1805 if (regno >= FIRST_PSEUDO_REGISTER) | 1728 1729 if (insert_regs (exp, class1, 0) || need_rehash) 1730 { 1731 rehash_using_reg (exp); 1732 hash = HASH (exp, mode); 1733 } 1734 new = insert (exp, class1, hash, mode); 1735 new->in_memory = hash_arg_in_memory; --- 79 unchanged lines hidden (view full) --- 1815 registers are in the table, we must remove any REG entries that 1816 overlap these registers. */ 1817 1818 delete_reg_equiv (regno); 1819 REG_TICK (regno)++; 1820 SUBREG_TICKED (regno) = -1; 1821 1822 if (regno >= FIRST_PSEUDO_REGISTER) |
1806 { 1807 /* Because a register can be referenced in more than one mode, 1808 we might have to remove more than one table entry. */ 1809 struct table_elt *elt; 1810 1811 while ((elt = lookup_for_remove (x, hash, GET_MODE (x)))) 1812 remove_from_table (elt, hash); 1813 } | 1823 remove_pseudo_from_table (x, hash); |
1814 else 1815 { 1816 HOST_WIDE_INT in_table 1817 = TEST_HARD_REG_BIT (hard_regs_in_table, regno); 1818 unsigned int endregno 1819 = regno + hard_regno_nregs[regno][GET_MODE (x)]; 1820 unsigned int tregno, tendregno, rn; 1821 struct table_elt *p, *next; --- 6246 unchanged lines hidden --- | 1824 else 1825 { 1826 HOST_WIDE_INT in_table 1827 = TEST_HARD_REG_BIT (hard_regs_in_table, regno); 1828 unsigned int endregno 1829 = regno + hard_regno_nregs[regno][GET_MODE (x)]; 1830 unsigned int tregno, tendregno, rn; 1831 struct table_elt *p, *next; --- 6246 unchanged lines hidden --- |