Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
97c116dc
Commit
97c116dc
authored
Apr 24, 2013
by
Marek Polacek
Committed by
Marek Polacek
Apr 24, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prune SCEV
From-SVN: r198233
parent
a378996b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
134 deletions
+9
-134
gcc/ChangeLog
+9
-0
gcc/tree-scalar-evolution.c
+0
-133
gcc/tree-scalar-evolution.h
+0
-1
No files found.
gcc/ChangeLog
View file @
97c116dc
2013-04-24 Marek Polacek <polacek@redhat.com>
* tree-scalar-evolution.h (analyze_scalar_evolution): Remove.
* tree-scalar-evolution.c (get_exit_conditions_rec): Likewise.
(select_loops_exit_conditions): Likewise.
(number_of_iterations_for_all_loops): Likewise.
(analyze_scalar_evolution_for_all_loop_phi_nodes): Likewise.
(scev_analysis): Likewise.
2013-04-02 Catherine Moore <clm@codesourcery.com>
2013-04-02 Catherine Moore <clm@codesourcery.com>
Chao-ying Fu <fu@mips.com>
Chao-ying Fu <fu@mips.com>
...
...
gcc/tree-scalar-evolution.c
View file @
97c116dc
...
@@ -868,39 +868,6 @@ get_loop_exit_condition (const struct loop *loop)
...
@@ -868,39 +868,6 @@ get_loop_exit_condition (const struct loop *loop)
return
res
;
return
res
;
}
}
/* Recursively determine and enqueue the exit conditions for a loop. */
static
void
get_exit_conditions_rec
(
struct
loop
*
loop
,
vec
<
gimple
>
*
exit_conditions
)
{
if
(
!
loop
)
return
;
/* Recurse on the inner loops, then on the next (sibling) loops. */
get_exit_conditions_rec
(
loop
->
inner
,
exit_conditions
);
get_exit_conditions_rec
(
loop
->
next
,
exit_conditions
);
if
(
single_exit
(
loop
))
{
gimple
loop_condition
=
get_loop_exit_condition
(
loop
);
if
(
loop_condition
)
exit_conditions
->
safe_push
(
loop_condition
);
}
}
/* Select the candidate loop nests for the analysis. This function
initializes the EXIT_CONDITIONS array. */
static
void
select_loops_exit_conditions
(
vec
<
gimple
>
*
exit_conditions
)
{
struct
loop
*
function_body
=
current_loops
->
tree_root
;
get_exit_conditions_rec
(
function_body
->
inner
,
exit_conditions
);
}
/* Depth first search algorithm. */
/* Depth first search algorithm. */
...
@@ -2882,41 +2849,6 @@ number_of_exit_cond_executions (struct loop *loop)
...
@@ -2882,41 +2849,6 @@ number_of_exit_cond_executions (struct loop *loop)
return
ret
;
return
ret
;
}
}
/* One of the drivers for testing the scalar evolutions analysis.
This function computes the number of iterations for all the loops
from the EXIT_CONDITIONS array. */
static
void
number_of_iterations_for_all_loops
(
vec
<
gimple
>
*
exit_conditions
)
{
unsigned
int
i
;
unsigned
nb_chrec_dont_know_loops
=
0
;
unsigned
nb_static_loops
=
0
;
gimple
cond
;
FOR_EACH_VEC_ELT
(
*
exit_conditions
,
i
,
cond
)
{
tree
res
=
number_of_latch_executions
(
loop_containing_stmt
(
cond
));
if
(
chrec_contains_undetermined
(
res
))
nb_chrec_dont_know_loops
++
;
else
nb_static_loops
++
;
}
if
(
dump_file
)
{
fprintf
(
dump_file
,
"
\n
(
\n
"
);
fprintf
(
dump_file
,
"-----------------------------------------
\n
"
);
fprintf
(
dump_file
,
"%d
\t
nb_chrec_dont_know_loops
\n
"
,
nb_chrec_dont_know_loops
);
fprintf
(
dump_file
,
"%d
\t
nb_static_loops
\n
"
,
nb_static_loops
);
fprintf
(
dump_file
,
"%d
\t
nb_total_loops
\n
"
,
number_of_loops
());
fprintf
(
dump_file
,
"-----------------------------------------
\n
"
);
fprintf
(
dump_file
,
")
\n\n
"
);
print_loops
(
dump_file
,
3
);
}
}
/* Counters for the stats. */
/* Counters for the stats. */
...
@@ -3028,54 +2960,6 @@ gather_chrec_stats (tree chrec, struct chrec_stats *stats)
...
@@ -3028,54 +2960,6 @@ gather_chrec_stats (tree chrec, struct chrec_stats *stats)
fprintf
(
dump_file
,
")
\n
"
);
fprintf
(
dump_file
,
")
\n
"
);
}
}
/* One of the drivers for testing the scalar evolutions analysis.
This function analyzes the scalar evolution of all the scalars
defined as loop phi nodes in one of the loops from the
EXIT_CONDITIONS array.
TODO Optimization: A loop is in canonical form if it contains only
a single scalar loop phi node. All the other scalars that have an
evolution in the loop are rewritten in function of this single
index. This allows the parallelization of the loop. */
static
void
analyze_scalar_evolution_for_all_loop_phi_nodes
(
vec
<
gimple
>
*
exit_conditions
)
{
unsigned
int
i
;
struct
chrec_stats
stats
;
gimple
cond
,
phi
;
gimple_stmt_iterator
psi
;
reset_chrecs_counters
(
&
stats
);
FOR_EACH_VEC_ELT
(
*
exit_conditions
,
i
,
cond
)
{
struct
loop
*
loop
;
basic_block
bb
;
tree
chrec
;
loop
=
loop_containing_stmt
(
cond
);
bb
=
loop
->
header
;
for
(
psi
=
gsi_start_phis
(
bb
);
!
gsi_end_p
(
psi
);
gsi_next
(
&
psi
))
{
phi
=
gsi_stmt
(
psi
);
if
(
!
virtual_operand_p
(
PHI_RESULT
(
phi
)))
{
chrec
=
instantiate_parameters
(
loop
,
analyze_scalar_evolution
(
loop
,
PHI_RESULT
(
phi
)));
if
(
dump_file
&&
(
dump_flags
&
TDF_STATS
))
gather_chrec_stats
(
chrec
,
&
stats
);
}
}
}
if
(
dump_file
&&
(
dump_flags
&
TDF_STATS
))
dump_chrecs_stats
(
dump_file
,
&
stats
);
}
/* Callback for htab_traverse, gathers information on chrecs in the
/* Callback for htab_traverse, gathers information on chrecs in the
hashtable. */
hashtable. */
...
@@ -3254,23 +3138,6 @@ simple_iv (struct loop *wrto_loop, struct loop *use_loop, tree op,
...
@@ -3254,23 +3138,6 @@ simple_iv (struct loop *wrto_loop, struct loop *use_loop, tree op,
return
true
;
return
true
;
}
}
/* Runs the analysis of scalar evolutions. */
void
scev_analysis
(
void
)
{
vec
<
gimple
>
exit_conditions
;
exit_conditions
.
create
(
37
);
select_loops_exit_conditions
(
&
exit_conditions
);
if
(
dump_file
&&
(
dump_flags
&
TDF_STATS
))
analyze_scalar_evolution_for_all_loop_phi_nodes
(
&
exit_conditions
);
number_of_iterations_for_all_loops
(
&
exit_conditions
);
exit_conditions
.
release
();
}
/* Finalize the scalar evolution analysis. */
/* Finalize the scalar evolution analysis. */
void
void
...
...
gcc/tree-scalar-evolution.h
View file @
97c116dc
...
@@ -34,7 +34,6 @@ extern tree analyze_scalar_evolution (struct loop *, tree);
...
@@ -34,7 +34,6 @@ extern tree analyze_scalar_evolution (struct loop *, tree);
extern
tree
instantiate_scev
(
basic_block
,
struct
loop
*
,
tree
);
extern
tree
instantiate_scev
(
basic_block
,
struct
loop
*
,
tree
);
extern
tree
resolve_mixers
(
struct
loop
*
,
tree
);
extern
tree
resolve_mixers
(
struct
loop
*
,
tree
);
extern
void
gather_stats_on_scev_database
(
void
);
extern
void
gather_stats_on_scev_database
(
void
);
extern
void
scev_analysis
(
void
);
extern
unsigned
int
scev_const_prop
(
void
);
extern
unsigned
int
scev_const_prop
(
void
);
extern
bool
expression_expensive_p
(
tree
);
extern
bool
expression_expensive_p
(
tree
);
extern
bool
simple_iv
(
struct
loop
*
,
struct
loop
*
,
tree
,
affine_iv
*
,
bool
);
extern
bool
simple_iv
(
struct
loop
*
,
struct
loop
*
,
tree
,
affine_iv
*
,
bool
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment