Commit 2749c8f6 by Bill Schmidt Committed by William Schmidt

re PR tree-optimization/46556 (Code size regression in struct access)

gcc:

	PR tree-optimization/46556
	* gimple-ssa-strength-reduction.c (enum cand_kind): Add CAND_REF.
	(base_cand_map): Change to hash table.
	(base_cand_hash): New function.
	(base_cand_free): Likewise.
	(base_cand_eq): Likewise.
	(lookup_cand): Change base_cand_map to hash table.
	(find_basis_for_candidate): Likewise.
	(base_cand_from_table): Exclude CAND_REF.
	(restructure_reference): New function.
	(slsr_process_ref): Likewise.
	(find_candidates_in_block): Call slsr_process_ref.
	(dump_candidate): Handle CAND_REF.
	(base_cand_dump_callback): New function.
	(dump_cand_chains): Change base_cand_map to hash table.
	(replace_ref): New function.
	(replace_refs): Likewise.
	(analyze_candidates_and_replace): Call replace_refs.
	(execute_strength_reduction): Change base_cand_map to hash table.

gcc/testsuite:

	PR tree-optimization/46556
	* testsuite/gcc.dg/tree-ssa/slsr-27.c: New.
	* testsuite/gcc.dg/tree-ssa/slsr-28.c: New.
	* testsuite/gcc.dg/tree-ssa/slsr-29.c: New.

From-SVN: r190037
parent 85add0cf
2012-08-01 Bill Schmidt <wschmidt@linux.ibm.com>
PR tree-optimization/46556
* gimple-ssa-strength-reduction.c (enum cand_kind): Add CAND_REF.
(base_cand_map): Change to hash table.
(base_cand_hash): New function.
(base_cand_free): Likewise.
(base_cand_eq): Likewise.
(lookup_cand): Change base_cand_map to hash table.
(find_basis_for_candidate): Likewise.
(base_cand_from_table): Exclude CAND_REF.
(restructure_reference): New function.
(slsr_process_ref): Likewise.
(find_candidates_in_block): Call slsr_process_ref.
(dump_candidate): Handle CAND_REF.
(base_cand_dump_callback): New function.
(dump_cand_chains): Change base_cand_map to hash table.
(replace_ref): New function.
(replace_refs): Likewise.
(analyze_candidates_and_replace): Call replace_refs.
(execute_strength_reduction): Change base_cand_map to hash table.
2012-08-01 Uros Bizjak <ubizjak@gmail.com>
* config/i386/i386.c (ix86_address_subreg_operand): Reject
......
2012-08-01 Bill Schmidt <wschmidt@linux.ibm.com>
PR tree-optimization/46556
* testsuite/gcc.dg/tree-ssa/slsr-27.c: New.
* testsuite/gcc.dg/tree-ssa/slsr-28.c: New.
* testsuite/gcc.dg/tree-ssa/slsr-29.c: New.
2012-07-31 Janus Weil <janus@gcc.gnu.org>
PR fortran/42418
......
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-dom2" } */
struct x
{
int a[16];
int b[16];
int c[16];
};
extern void foo (int, int, int);
void
f (struct x *p, unsigned int n)
{
foo (p->a[n], p->c[n], p->b[n]);
}
/* { dg-final { scan-tree-dump-times "\\* 4;" 1 "dom2" } } */
/* { dg-final { scan-tree-dump-times "p_\\d\+\\(D\\) \\+ D" 1 "dom2" } } */
/* { dg-final { scan-tree-dump-times "MEM\\\[\\(struct x \\*\\)D" 3 "dom2" } } */
/* { dg-final { cleanup-tree-dump "dom2" } } */
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-dom2" } */
struct x
{
int a[16];
int b[16];
int c[16];
};
extern void foo (int, int, int);
void
f (struct x *p, unsigned int n)
{
foo (p->a[n], p->c[n], p->b[n]);
if (n > 12)
foo (p->a[n], p->c[n], p->b[n]);
else if (n > 3)
foo (p->b[n], p->a[n], p->c[n]);
}
/* { dg-final { scan-tree-dump-times "\\* 4;" 1 "dom2" } } */
/* { dg-final { scan-tree-dump-times "p_\\d\+\\(D\\) \\+ D" 1 "dom2" } } */
/* { dg-final { scan-tree-dump-times "MEM\\\[\\(struct x \\*\\)D" 9 "dom2" } } */
/* { dg-final { cleanup-tree-dump "dom2" } } */
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-dom2" } */
struct x
{
int a[16];
int b[16];
int c[16];
};
extern void foo (int, int, int);
void
f (struct x *p, unsigned int n)
{
foo (p->a[n], p->c[n], p->b[n]);
if (n > 3)
{
foo (p->a[n], p->c[n], p->b[n]);
if (n > 12)
foo (p->b[n], p->a[n], p->c[n]);
}
}
/* { dg-final { scan-tree-dump-times "\\* 4;" 1 "dom2" } } */
/* { dg-final { scan-tree-dump-times "p_\\d\+\\(D\\) \\+ D" 1 "dom2" } } */
/* { dg-final { scan-tree-dump-times "MEM\\\[\\(struct x \\*\\)D" 9 "dom2" } } */
/* { dg-final { cleanup-tree-dump "dom2" } } */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment