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
c9bacfdb
Commit
c9bacfdb
authored
Aug 11, 2000
by
Kazu Hirata
Committed by
Jeff Law
Aug 11, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* flow.c: Fix formatting.
From-SVN: r35631
parent
b333f246
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
124 additions
and
112 deletions
+124
-112
gcc/ChangeLog
+4
-0
gcc/flow.c
+120
-112
No files found.
gcc/ChangeLog
View file @
c9bacfdb
2000-08-11 Kazu Hirata <kazu@hxi.com>
* flow.c: Fix formatting.
2000-08-11 Richard Henderson <rth@cygnus.com>
* reload.c (push_secondary_reload): When invoking a reload_{in,out}
...
...
gcc/flow.c
View file @
c9bacfdb
...
...
@@ -19,7 +19,6 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* This file contains the data flow analysis pass of the compiler. It
computes data flow information which tells combine_instructions
which insns to consider combining and controls register allocation.
...
...
@@ -144,7 +143,6 @@ Boston, MA 02111-1307, USA. */
#define obstack_chunk_alloc xmalloc
#define obstack_chunk_free free
/* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
the stack pointer does not matter. The value is tested only in
functions that have frame pointers.
...
...
@@ -787,7 +785,7 @@ find_basic_blocks_1 (f)
break
;
}
}
/* F
ALLTHRU
*/
/* F
all through.
*/
default
:
if
(
GET_RTX_CLASS
(
code
)
==
'i'
)
...
...
@@ -970,7 +968,7 @@ clear_edges ()
{
basic_block
bb
=
BASIC_BLOCK
(
i
);
for
(
e
=
bb
->
succ
;
e
;
e
=
n
)
for
(
e
=
bb
->
succ
;
e
;
e
=
n
)
{
n
=
e
->
succ_next
;
free
(
e
);
...
...
@@ -980,7 +978,7 @@ clear_edges ()
bb
->
pred
=
0
;
}
for
(
e
=
ENTRY_BLOCK_PTR
->
succ
;
e
;
e
=
n
)
for
(
e
=
ENTRY_BLOCK_PTR
->
succ
;
e
;
e
=
n
)
{
n
=
e
->
succ_next
;
free
(
e
);
...
...
@@ -1159,7 +1157,7 @@ make_edges (label_value_list)
than 0 is guaranteed not to perform a non-local goto. */
rtx
note
=
find_reg_note
(
insn
,
REG_EH_REGION
,
NULL_RTX
);
if
(
!
note
||
INTVAL
(
XEXP
(
note
,
0
))
>=
0
)
for
(
x
=
nonlocal_goto_handler_labels
;
x
;
x
=
XEXP
(
x
,
1
))
for
(
x
=
nonlocal_goto_handler_labels
;
x
;
x
=
XEXP
(
x
,
1
))
make_label_edge
(
edge_cache
,
bb
,
XEXP
(
x
,
0
),
EDGE_ABNORMAL
|
EDGE_ABNORMAL_CALL
);
}
...
...
@@ -1212,7 +1210,7 @@ make_edge (edge_cache, src, dst, flags)
/* Make sure we don't add duplicate edges. */
if
(
!
use_edge_cache
||
TEST_BIT
(
edge_cache
[
src
->
index
],
dst
->
index
))
for
(
e
=
src
->
succ
;
e
;
e
=
e
->
succ_next
)
for
(
e
=
src
->
succ
;
e
;
e
=
e
->
succ_next
)
if
(
e
->
dest
==
dst
)
{
e
->
flags
|=
flags
;
...
...
@@ -1343,7 +1341,7 @@ record_active_eh_regions (f)
int
i
=
0
;
basic_block
bb
=
BASIC_BLOCK
(
0
);
for
(
insn
=
f
;
insn
;
insn
=
NEXT_INSN
(
insn
))
for
(
insn
=
f
;
insn
;
insn
=
NEXT_INSN
(
insn
))
{
if
(
bb
->
head
==
insn
)
bb
->
eh_beg
=
(
eh_list
?
NOTE_EH_HANDLER
(
XEXP
(
eh_list
,
0
))
:
-
1
);
...
...
@@ -1393,7 +1391,7 @@ mark_critical_edges ()
/* (1) Critical edges must have a source with multiple successors. */
if
(
bb
->
succ
&&
bb
->
succ
->
succ_next
)
{
for
(
e
=
bb
->
succ
;
e
;
e
=
e
->
succ_next
)
for
(
e
=
bb
->
succ
;
e
;
e
=
e
->
succ_next
)
{
/* (2) Critical edges must have a destination with multiple
predecessors. Note that we know there is at least one
...
...
@@ -1406,7 +1404,7 @@ mark_critical_edges ()
}
else
{
for
(
e
=
bb
->
succ
;
e
;
e
=
e
->
succ_next
)
for
(
e
=
bb
->
succ
;
e
;
e
=
e
->
succ_next
)
e
->
flags
&=
~
EDGE_CRITICAL
;
}
...
...
@@ -1493,7 +1491,7 @@ split_edge (edge_in)
if
((
edge_in
->
flags
&
EDGE_FALLTHRU
)
==
0
)
{
edge
e
;
for
(
e
=
edge_out
->
pred_next
;
e
;
e
=
e
->
pred_next
)
for
(
e
=
edge_out
->
pred_next
;
e
;
e
=
e
->
pred_next
)
if
(
e
->
flags
&
EDGE_FALLTHRU
)
break
;
...
...
@@ -1557,7 +1555,6 @@ split_edge (edge_in)
Where we place the note can have a noticable impact on the generated
code. Consider this cfg:
E
|
0
...
...
@@ -1677,7 +1674,7 @@ insert_insn_on_edge (pattern, e)
emit_insn
(
pattern
);
e
->
insns
=
get_insns
();
end_sequence
();
end_sequence
();
}
/* Update the CFG for the instructions queued on edge E. */
...
...
@@ -1814,7 +1811,7 @@ commit_edge_insertions ()
{
edge
e
,
next
;
for
(
e
=
bb
->
succ
;
e
;
e
=
next
)
for
(
e
=
bb
->
succ
;
e
;
e
=
next
)
{
next
=
e
->
succ_next
;
if
(
e
->
insns
)
...
...
@@ -1849,7 +1846,7 @@ delete_unreachable_blocks ()
be only one. It isn't inconcievable that we might one day directly
support Fortran alternate entry points. */
for
(
e
=
ENTRY_BLOCK_PTR
->
succ
;
e
;
e
=
e
->
succ_next
)
for
(
e
=
ENTRY_BLOCK_PTR
->
succ
;
e
;
e
=
e
->
succ_next
)
{
*
tos
++
=
e
->
dest
;
...
...
@@ -1863,7 +1860,7 @@ delete_unreachable_blocks ()
{
basic_block
b
=
*--
tos
;
for
(
e
=
b
->
succ
;
e
;
e
=
e
->
succ_next
)
for
(
e
=
b
->
succ
;
e
;
e
=
e
->
succ_next
)
if
(
!
e
->
dest
->
aux
)
{
*
tos
++
=
e
->
dest
;
...
...
@@ -1909,8 +1906,8 @@ delete_eh_regions ()
for
(
insn
=
get_insns
();
insn
;
insn
=
NEXT_INSN
(
insn
))
if
(
GET_CODE
(
insn
)
==
NOTE
)
{
if
((
NOTE_LINE_NUMBER
(
insn
)
==
NOTE_INSN_EH_REGION_BEG
)
||
(
NOTE_LINE_NUMBER
(
insn
)
==
NOTE_INSN_EH_REGION_END
))
if
((
NOTE_LINE_NUMBER
(
insn
)
==
NOTE_INSN_EH_REGION_BEG
)
||
(
NOTE_LINE_NUMBER
(
insn
)
==
NOTE_INSN_EH_REGION_END
))
{
int
num
=
NOTE_EH_HANDLER
(
insn
);
/* A NULL handler indicates a region is no longer needed,
...
...
@@ -2041,7 +2038,7 @@ flow_delete_block (b)
{
edge
e
,
next
,
*
q
;
for
(
e
=
b
->
pred
;
e
;
e
=
next
)
for
(
e
=
b
->
pred
;
e
;
e
=
next
)
{
for
(
q
=
&
e
->
src
->
succ
;
*
q
!=
e
;
q
=
&
(
*
q
)
->
succ_next
)
continue
;
...
...
@@ -2050,7 +2047,7 @@ flow_delete_block (b)
n_edges
--
;
free
(
e
);
}
for
(
e
=
b
->
succ
;
e
;
e
=
next
)
for
(
e
=
b
->
succ
;
e
;
e
=
next
)
{
for
(
q
=
&
e
->
dest
->
pred
;
*
q
!=
e
;
q
=
&
(
*
q
)
->
pred_next
)
continue
;
...
...
@@ -2139,13 +2136,13 @@ can_delete_label_p (label)
if
(
LABEL_PRESERVE_P
(
label
))
return
0
;
for
(
x
=
forced_labels
;
x
;
x
=
XEXP
(
x
,
1
))
for
(
x
=
forced_labels
;
x
;
x
=
XEXP
(
x
,
1
))
if
(
label
==
XEXP
(
x
,
0
))
return
0
;
for
(
x
=
label_value_list
;
x
;
x
=
XEXP
(
x
,
1
))
for
(
x
=
label_value_list
;
x
;
x
=
XEXP
(
x
,
1
))
if
(
label
==
XEXP
(
x
,
0
))
return
0
;
for
(
x
=
exception_handler_labels
;
x
;
x
=
XEXP
(
x
,
1
))
for
(
x
=
exception_handler_labels
;
x
;
x
=
XEXP
(
x
,
1
))
if
(
label
==
XEXP
(
x
,
0
))
return
0
;
...
...
@@ -2162,7 +2159,7 @@ tail_recursion_label_p (label)
{
rtx
x
;
for
(
x
=
tail_recursion_label_list
;
x
;
x
=
XEXP
(
x
,
1
))
for
(
x
=
tail_recursion_label_list
;
x
;
x
=
XEXP
(
x
,
1
))
if
(
label
==
XEXP
(
x
,
0
))
return
1
;
...
...
@@ -2247,7 +2244,7 @@ merge_blocks_nomove (a, b)
remove_edge
(
a
->
succ
);
/* Adjust the edges out of B for the new owner. */
for
(
e
=
b
->
succ
;
e
;
e
=
e
->
succ_next
)
for
(
e
=
b
->
succ
;
e
;
e
=
e
->
succ_next
)
e
->
src
=
a
;
a
->
succ
=
b
->
succ
;
...
...
@@ -2314,8 +2311,8 @@ merge_blocks_move_predecessor_nojumps (a, b)
/* Swap the records for the two blocks around. Although we are deleting B,
A is now where B was and we want to compact the BB array from where
A used to be. */
BASIC_BLOCK
(
a
->
index
)
=
b
;
BASIC_BLOCK
(
b
->
index
)
=
a
;
BASIC_BLOCK
(
a
->
index
)
=
b
;
BASIC_BLOCK
(
b
->
index
)
=
a
;
index
=
a
->
index
;
a
->
index
=
b
->
index
;
b
->
index
=
index
;
...
...
@@ -2430,12 +2427,12 @@ merge_blocks (e, b, c)
edges, one normal, one abnormal as only having one edge for
block merging purposes. */
for
(
tmp_edge
=
c
->
succ
;
tmp_edge
;
tmp_edge
=
tmp_edge
->
succ_next
)
for
(
tmp_edge
=
c
->
succ
;
tmp_edge
;
tmp_edge
=
tmp_edge
->
succ_next
)
if
(
tmp_edge
->
flags
&
EDGE_FALLTHRU
)
break
;
c_has_outgoing_fallthru
=
(
tmp_edge
!=
NULL
);
for
(
tmp_edge
=
b
->
pred
;
tmp_edge
;
tmp_edge
=
tmp_edge
->
pred_next
)
for
(
tmp_edge
=
b
->
pred
;
tmp_edge
;
tmp_edge
=
tmp_edge
->
pred_next
)
if
(
tmp_edge
->
flags
&
EDGE_FALLTHRU
)
break
;
b_has_incoming_fallthru
=
(
tmp_edge
!=
NULL
);
...
...
@@ -2487,7 +2484,7 @@ try_merge_blocks ()
has only one successor, and the successor has only one predecessor,
they may be combined. */
for
(
i
=
0
;
i
<
n_basic_blocks
;
)
for
(
i
=
0
;
i
<
n_basic_blocks
;)
{
basic_block
c
,
b
=
BASIC_BLOCK
(
i
);
edge
s
;
...
...
@@ -2672,7 +2669,7 @@ life_analysis (f, file, flags)
is not immediately handy. */
if
(
flags
&
PROP_REG_INFO
)
memset
(
regs_ever_live
,
0
,
sizeof
(
regs_ever_live
));
memset
(
regs_ever_live
,
0
,
sizeof
(
regs_ever_live
));
update_life_info
(
NULL
,
UPDATE_LIFE_GLOBAL
,
flags
);
/* Clean up. */
...
...
@@ -2887,6 +2884,7 @@ free_basic_block_vars (keep_head_end_p)
}
/* Return nonzero if the destination of SET equals the source. */
static
int
set_noop_p
(
set
)
rtx
set
;
...
...
@@ -2908,6 +2906,7 @@ set_noop_p (set)
/* Return nonzero if an insn consists only of SETs, each of which only sets a
value to itself. */
static
int
noop_move_p
(
insn
)
rtx
insn
;
...
...
@@ -3010,6 +3009,7 @@ notice_stack_pointer_modification (f)
/* Mark a register in SET. Hard registers in large modes get all
of their component registers set as well. */
static
void
mark_reg
(
reg
,
xset
)
rtx
reg
;
...
...
@@ -3032,6 +3032,7 @@ mark_reg (reg, xset)
/* Mark those regs which are needed at the end of the function as live
at the end of the last basic block. */
static
void
mark_regs_live_at_end
(
set
)
regset
set
;
...
...
@@ -3178,7 +3179,7 @@ calculate_global_regs_live (blocks_in, blocks_out, flags)
/* Begin by propogating live_at_start from the successor blocks. */
CLEAR_REG_SET
(
new_live_at_end
);
for
(
e
=
bb
->
succ
;
e
;
e
=
e
->
succ_next
)
for
(
e
=
bb
->
succ
;
e
;
e
=
e
->
succ_next
)
{
basic_block
sb
=
e
->
dest
;
IOR_REG_SET
(
new_live_at_end
,
sb
->
global_live_at_start
);
...
...
@@ -3276,7 +3277,7 @@ calculate_global_regs_live (blocks_in, blocks_out, flags)
/* Queue all predecessors of BB so that we may re-examine
their live_at_end. */
for
(
e
=
bb
->
pred
;
e
;
e
=
e
->
pred_next
)
for
(
e
=
bb
->
pred
;
e
;
e
=
e
->
pred_next
)
{
basic_block
pb
=
e
->
src
;
if
(
pb
->
aux
==
NULL
)
...
...
@@ -3648,7 +3649,7 @@ init_propagate_block_info (bb, live, local_set, flags)
regset
local_set
;
int
flags
;
{
struct
propagate_block_info
*
pbi
=
xmalloc
(
sizeof
(
*
pbi
));
struct
propagate_block_info
*
pbi
=
xmalloc
(
sizeof
(
*
pbi
));
pbi
->
bb
=
bb
;
pbi
->
reg_live
=
live
;
...
...
@@ -3835,7 +3836,7 @@ propagate_block (bb, live, local_set, flags)
/* Scan the block an insn at a time from end to beginning. */
for
(
insn
=
bb
->
end
;
;
insn
=
prev
)
for
(
insn
=
bb
->
end
;;
insn
=
prev
)
{
/* If this is a call to `setjmp' et al, warn if any
non-volatile datum is live. */
...
...
@@ -3876,7 +3877,7 @@ insn_dead_p (pbi, x, call_ok, notes)
expresions into account. */
if
(
reload_completed
)
{
for
(
;
notes
;
notes
=
XEXP
(
notes
,
1
))
for
(;
notes
;
notes
=
XEXP
(
notes
,
1
))
{
if
(
REG_NOTE_KIND
(
notes
)
==
REG_INC
)
{
...
...
@@ -4223,7 +4224,7 @@ mark_set_regs (pbi, x, insn)
sub
=
COND_EXEC_CODE
(
sub
);
if
(
GET_CODE
(
sub
)
!=
SET
&&
GET_CODE
(
sub
)
!=
CLOBBER
)
break
;
/* F
ALLTHRU
*/
/* F
all through.
*/
case
SET
:
case
CLOBBER
:
...
...
@@ -4285,7 +4286,7 @@ mark_set_1 (pbi, code, reg, cond, insn, flags)
if
(
GET_CODE
(
reg
)
==
MEM
)
break
;
not_dead
=
REGNO_REG_SET_P
(
pbi
->
reg_live
,
REGNO
(
reg
));
/* F
ALLTHRU
*/
/* F
all through.
*/
case
REG
:
regno_last
=
regno_first
=
REGNO
(
reg
);
...
...
@@ -4574,8 +4575,8 @@ mark_set_1 (pbi, code, reg, cond, insn, flags)
}
#ifdef HAVE_conditional_execution
/* Mark REGNO conditionally dead.
Return true if the register is
now unconditionally dead. */
/* Mark REGNO conditionally dead.
Return true if the register is
now unconditionally dead. */
static
int
mark_regno_cond_dead
(
pbi
,
regno
,
cond
)
...
...
@@ -4611,8 +4612,7 @@ mark_regno_cond_dead (pbi, regno, cond)
/* The register was unconditionally live previously.
Record the current condition as the condition under
which it is dead. */
rcli
=
(
struct
reg_cond_life_info
*
)
xmalloc
(
sizeof
(
*
rcli
));
rcli
=
(
struct
reg_cond_life_info
*
)
xmalloc
(
sizeof
(
*
rcli
));
rcli
->
condition
=
alloc_EXPR_LIST
(
0
,
cond
,
NULL_RTX
);
splay_tree_insert
(
pbi
->
reg_cond_dead
,
regno
,
(
splay_tree_value
)
rcli
);
...
...
@@ -4745,7 +4745,7 @@ ior_reg_cond (old, x)
abort
();
/* Search the expression for an existing sub-expression of X_REG. */
for
(
c
=
old
;
c
;
c
=
XEXP
(
c
,
1
))
for
(
c
=
old
;
c
;
c
=
XEXP
(
c
,
1
))
{
rtx
y
=
XEXP
(
c
,
0
);
if
(
REGNO
(
XEXP
(
y
,
0
))
==
REGNO
(
x_reg
))
...
...
@@ -4801,7 +4801,7 @@ nand_reg_cond (old, x)
/* Search the expression for an existing sub-expression of X_REG. */
for
(
c
=
*
(
prev
=
&
old
);
c
;
c
=
*
(
prev
=
&
XEXP
(
c
,
1
)))
for
(
c
=
*
(
prev
=
&
old
);
c
;
c
=
*
(
prev
=
&
XEXP
(
c
,
1
)))
{
rtx
y
=
XEXP
(
c
,
0
);
if
(
REGNO
(
XEXP
(
y
,
0
))
==
REGNO
(
x_reg
))
...
...
@@ -4941,8 +4941,7 @@ attempt_auto_inc (pbi, inc, insn, mem, incr, incr_reg)
auto-inc, so update the status. First, record that this insn
has an implicit side effect. */
REG_NOTES
(
insn
)
=
alloc_EXPR_LIST
(
REG_INC
,
incr_reg
,
REG_NOTES
(
insn
));
REG_NOTES
(
insn
)
=
alloc_EXPR_LIST
(
REG_INC
,
incr_reg
,
REG_NOTES
(
insn
));
/* Modify the old increment-insn to simply copy
the already-incremented value of our register. */
...
...
@@ -5037,7 +5036,7 @@ find_auto_inc (pbi, x, insn)
attempt_auto_inc
(
pbi
,
gen_rtx_POST_INC
(
Pmode
,
addr
),
insn
,
x
,
incr
,
addr
);
else
if
(
HAVE_POST_DECREMENT
&&
(
INTVAL
(
inc_val
)
==
-
size
&&
offset
==
0
))
&&
(
INTVAL
(
inc_val
)
==
-
size
&&
offset
==
0
))
attempt_auto_inc
(
pbi
,
gen_rtx_POST_DEC
(
Pmode
,
addr
),
insn
,
x
,
incr
,
addr
);
else
if
(
HAVE_PRE_INCREMENT
...
...
@@ -5045,7 +5044,7 @@ find_auto_inc (pbi, x, insn)
attempt_auto_inc
(
pbi
,
gen_rtx_PRE_INC
(
Pmode
,
addr
),
insn
,
x
,
incr
,
addr
);
else
if
(
HAVE_PRE_DECREMENT
&&
(
INTVAL
(
inc_val
)
==
-
size
&&
offset
==
-
size
))
&&
(
INTVAL
(
inc_val
)
==
-
size
&&
offset
==
-
size
))
attempt_auto_inc
(
pbi
,
gen_rtx_PRE_DEC
(
Pmode
,
addr
),
insn
,
x
,
incr
,
addr
);
else
if
(
HAVE_POST_MODIFY_DISP
&&
offset
==
0
)
...
...
@@ -5328,7 +5327,8 @@ mark_used_regs (pbi, x, cond, insn)
something that can be stored into. */
if
(
GET_CODE
(
XEXP
(
x
,
0
))
==
SYMBOL_REF
&&
CONSTANT_POOL_ADDRESS_P
(
XEXP
(
x
,
0
)))
;
/* needn't clear the memory set list */
/* Needn't clear the memory set list. */
;
else
{
rtx
temp
=
pbi
->
mem_set_list
;
...
...
@@ -5379,7 +5379,7 @@ mark_used_regs (pbi, x, cond, insn)
x
=
SUBREG_REG
(
x
);
if
(
GET_CODE
(
x
)
!=
REG
)
goto
retry
;
/* F
ALLTHRU
*/
/* F
all through.
*/
case
REG
:
/* See a register other than being set => mark it as needed. */
...
...
@@ -5825,11 +5825,11 @@ dump_flow_info (file)
i
,
INSN_UID
(
bb
->
head
),
INSN_UID
(
bb
->
end
),
bb
->
loop_depth
,
bb
->
count
);
fprintf
(
file
,
"Predecessors: "
);
for
(
e
=
bb
->
pred
;
e
;
e
=
e
->
pred_next
)
for
(
e
=
bb
->
pred
;
e
;
e
=
e
->
pred_next
)
dump_edge_info
(
file
,
e
,
0
);
fprintf
(
file
,
"
\n
Successors: "
);
for
(
e
=
bb
->
succ
;
e
;
e
=
e
->
succ_next
)
for
(
e
=
bb
->
succ
;
e
;
e
=
e
->
succ_next
)
dump_edge_info
(
file
,
e
,
1
);
fprintf
(
file
,
"
\n
Registers live at start:"
);
...
...
@@ -5838,10 +5838,10 @@ dump_flow_info (file)
fprintf
(
file
,
"
\n
Registers live at end:"
);
dump_regset
(
bb
->
global_live_at_end
,
file
);
putc
(
'\n'
,
file
);
putc
(
'\n'
,
file
);
}
putc
(
'\n'
,
file
);
putc
(
'\n'
,
file
);
}
void
...
...
@@ -5885,7 +5885,7 @@ dump_edge_info (file, e, do_succ)
if
(
comma
)
fputc
(
','
,
file
);
if
(
i
<
(
int
)(
sizeof
(
bitnames
)
/
sizeof
(
*
bitnames
)))
if
(
i
<
(
int
)
(
sizeof
(
bitnames
)
/
sizeof
(
*
bitnames
)))
fputs
(
bitnames
[
i
],
file
);
else
fprintf
(
file
,
"%d"
,
i
);
...
...
@@ -5895,8 +5895,8 @@ dump_edge_info (file, e, do_succ)
}
}
/* Print out one basic block with live information at start and end. */
void
dump_bb
(
bb
,
outf
)
basic_block
bb
;
...
...
@@ -5913,7 +5913,7 @@ dump_bb (bb, outf)
putc
(
'\n'
,
outf
);
fputs
(
";; Predecessors: "
,
outf
);
for
(
e
=
bb
->
pred
;
e
;
e
=
e
->
pred_next
)
for
(
e
=
bb
->
pred
;
e
;
e
=
e
->
pred_next
)
dump_edge_info
(
outf
,
e
,
0
);
putc
(
'\n'
,
outf
);
...
...
@@ -5947,7 +5947,7 @@ void
debug_bb_n
(
n
)
int
n
;
{
dump_bb
(
BASIC_BLOCK
(
n
),
stderr
);
dump_bb
(
BASIC_BLOCK
(
n
),
stderr
);
}
/* Like print_rtl, but also print out live information for the start of each
...
...
@@ -5984,9 +5984,9 @@ print_rtl_with_bb (outf, rtx_first)
for
(
x
=
bb
->
head
;
x
!=
NULL_RTX
;
x
=
NEXT_INSN
(
x
))
{
enum
bb_state
state
=
IN_MULTIPLE_BB
;
if
(
in_bb_p
[
INSN_UID
(
x
)]
==
NOT_IN_BB
)
if
(
in_bb_p
[
INSN_UID
(
x
)]
==
NOT_IN_BB
)
state
=
IN_ONE_BB
;
in_bb_p
[
INSN_UID
(
x
)]
=
state
;
in_bb_p
[
INSN_UID
(
x
)]
=
state
;
if
(
x
==
bb
->
end
)
break
;
...
...
@@ -6006,11 +6006,11 @@ print_rtl_with_bb (outf, rtx_first)
putc
(
'\n'
,
outf
);
}
if
(
in_bb_p
[
INSN_UID
(
tmp_rtx
)]
==
NOT_IN_BB
if
(
in_bb_p
[
INSN_UID
(
tmp_rtx
)]
==
NOT_IN_BB
&&
GET_CODE
(
tmp_rtx
)
!=
NOTE
&&
GET_CODE
(
tmp_rtx
)
!=
BARRIER
)
fprintf
(
outf
,
";; Insn is not within a basic block
\n
"
);
else
if
(
in_bb_p
[
INSN_UID
(
tmp_rtx
)]
==
IN_MULTIPLE_BB
)
else
if
(
in_bb_p
[
INSN_UID
(
tmp_rtx
)]
==
IN_MULTIPLE_BB
)
fprintf
(
outf
,
";; Insn is in multiple basic blocks
\n
"
);
did_output
=
print_rtl_single
(
outf
,
tmp_rtx
);
...
...
@@ -6042,6 +6042,7 @@ print_rtl_with_bb (outf, rtx_first)
}
/* Compute dominator relationships using new flow graph structures. */
void
compute_flow_dominators
(
dominators
,
post_dominators
)
sbitmap
*
dominators
;
...
...
@@ -6245,25 +6246,25 @@ compute_immediate_dominators (idom, dominators)
tmp
=
sbitmap_vector_alloc
(
n_basic_blocks
,
n_basic_blocks
);
/* Begin with tmp(n) = dom(n) - { n }. */
for
(
b
=
n_basic_blocks
;
--
b
>=
0
;
)
for
(
b
=
n_basic_blocks
;
--
b
>=
0
;)
{
sbitmap_copy
(
tmp
[
b
],
dominators
[
b
]);
RESET_BIT
(
tmp
[
b
],
b
);
}
/* Subtract out all of our dominator's dominators. */
for
(
b
=
n_basic_blocks
;
--
b
>=
0
;
)
for
(
b
=
n_basic_blocks
;
--
b
>=
0
;)
{
sbitmap
tmp_b
=
tmp
[
b
];
int
s
;
for
(
s
=
n_basic_blocks
;
--
s
>=
0
;
)
for
(
s
=
n_basic_blocks
;
--
s
>=
0
;)
if
(
TEST_BIT
(
tmp_b
,
s
))
sbitmap_difference
(
tmp_b
,
tmp_b
,
tmp
[
s
]);
}
/* Find the one bit set in the bitmap and put it in the output array. */
for
(
b
=
n_basic_blocks
;
--
b
>=
0
;
)
for
(
b
=
n_basic_blocks
;
--
b
>=
0
;)
{
int
t
;
EXECUTE_IF_SET_IN_SBITMAP
(
tmp
[
b
],
0
,
t
,
{
idom
[
b
]
=
t
;
});
...
...
@@ -6333,7 +6334,7 @@ count_or_remove_death_notes (blocks, kill)
bb
=
BASIC_BLOCK
(
i
);
for
(
insn
=
bb
->
head
;
;
insn
=
NEXT_INSN
(
insn
))
for
(
insn
=
bb
->
head
;;
insn
=
NEXT_INSN
(
insn
))
{
if
(
INSN_P
(
insn
))
{
...
...
@@ -6356,7 +6357,7 @@ count_or_remove_death_notes (blocks, kill)
n
=
HARD_REGNO_NREGS
(
REGNO
(
reg
),
GET_MODE
(
reg
));
count
+=
n
;
}
/* F
ALLTHRU
*/
/* F
all through.
*/
case
REG_UNUSED
:
if
(
kill
)
...
...
@@ -6366,7 +6367,7 @@ count_or_remove_death_notes (blocks, kill)
*
pprev
=
link
=
next
;
break
;
}
/* F
ALLTHRU
*/
/* F
all through.
*/
default
:
pprev
=
&
XEXP
(
link
,
1
);
...
...
@@ -6466,7 +6467,7 @@ verify_flow_info ()
/* Work backwards from the end to the head of the basic block
to verify the head is in the RTL chain. */
for
(
;
x
!=
NULL_RTX
;
x
=
PREV_INSN
(
x
))
for
(;
x
!=
NULL_RTX
;
x
=
PREV_INSN
(
x
))
{
/* While walking over the insn chain, verify insns appear
in only one basic block and initialize the BB_INFO array
...
...
@@ -6504,7 +6505,8 @@ verify_flow_info ()
{
if
(
e
->
src
!=
bb
)
{
fprintf
(
stderr
,
"verify_flow_info: Basic block %d succ edge is corrupted
\n
"
,
fprintf
(
stderr
,
"verify_flow_info: Basic block %d succ edge is corrupted
\n
"
,
bb
->
index
);
fprintf
(
stderr
,
"Predecessor: "
);
dump_edge_info
(
stderr
,
e
,
0
);
...
...
@@ -6679,6 +6681,7 @@ verify_flow_info ()
/* This functions initializes the edge list. Basically the entire
flowgraph is processed, and all edges are assigned a number,
and the data structure is filled in. */
struct
edge_list
*
create_edge_list
()
{
...
...
@@ -6734,6 +6737,7 @@ create_edge_list ()
}
/* This function free's memory associated with an edge list. */
void
free_edge_list
(
elist
)
struct
edge_list
*
elist
;
...
...
@@ -6746,33 +6750,35 @@ free_edge_list (elist)
}
/* This function provides debug output showing an edge list. */
void
print_edge_list
(
f
,
elist
)
FILE
*
f
;
struct
edge_list
*
elist
;
{
int
x
;
fprintf
(
f
,
"Compressed edge list, %d BBs + entry & exit, and %d edges
\n
"
,
fprintf
(
f
,
"Compressed edge list, %d BBs + entry & exit, and %d edges
\n
"
,
elist
->
num_blocks
-
2
,
elist
->
num_edges
);
for
(
x
=
0
;
x
<
elist
->
num_edges
;
x
++
)
{
fprintf
(
f
,
" %-4d - edge("
,
x
);
if
(
INDEX_EDGE_PRED_BB
(
elist
,
x
)
==
ENTRY_BLOCK_PTR
)
fprintf
(
f
,
"entry,"
);
fprintf
(
f
,
"entry,"
);
else
fprintf
(
f
,
"%d,"
,
INDEX_EDGE_PRED_BB
(
elist
,
x
)
->
index
);
fprintf
(
f
,
"%d,"
,
INDEX_EDGE_PRED_BB
(
elist
,
x
)
->
index
);
if
(
INDEX_EDGE_SUCC_BB
(
elist
,
x
)
==
EXIT_BLOCK_PTR
)
fprintf
(
f
,
"exit)
\n
"
);
fprintf
(
f
,
"exit)
\n
"
);
else
fprintf
(
f
,
"%d)
\n
"
,
INDEX_EDGE_SUCC_BB
(
elist
,
x
)
->
index
);
fprintf
(
f
,
"%d)
\n
"
,
INDEX_EDGE_SUCC_BB
(
elist
,
x
)
->
index
);
}
}
/* This function provides an internal consistency check of an edge list,
verifying that all edges are present, and that there are no
extra edges. */
void
verify_edge_list
(
f
,
elist
)
FILE
*
f
;
...
...
@@ -6792,7 +6798,7 @@ verify_edge_list (f, elist)
index
=
EDGE_INDEX
(
elist
,
e
->
src
,
e
->
dest
);
if
(
index
==
EDGE_INDEX_NO_EDGE
)
{
fprintf
(
f
,
"*p* No index for edge from %d to %d
\n
"
,
pred
,
succ
);
fprintf
(
f
,
"*p* No index for edge from %d to %d
\n
"
,
pred
,
succ
);
continue
;
}
if
(
INDEX_EDGE_PRED_BB
(
elist
,
index
)
->
index
!=
pred
)
...
...
@@ -6810,7 +6816,7 @@ verify_edge_list (f, elist)
index
=
EDGE_INDEX
(
elist
,
e
->
src
,
e
->
dest
);
if
(
index
==
EDGE_INDEX_NO_EDGE
)
{
fprintf
(
f
,
"*p* No index for edge from %d to %d
\n
"
,
pred
,
succ
);
fprintf
(
f
,
"*p* No index for edge from %d to %d
\n
"
,
pred
,
succ
);
continue
;
}
if
(
INDEX_EDGE_PRED_BB
(
elist
,
index
)
->
index
!=
pred
)
...
...
@@ -6823,8 +6829,8 @@ verify_edge_list (f, elist)
/* We've verified that all the edges are in the list, no lets make sure
there are no spurious edges in the list. */
for
(
pred
=
0
;
pred
<
n_basic_blocks
;
pred
++
)
for
(
succ
=
0
;
succ
<
n_basic_blocks
;
succ
++
)
for
(
pred
=
0
;
pred
<
n_basic_blocks
;
pred
++
)
for
(
succ
=
0
;
succ
<
n_basic_blocks
;
succ
++
)
{
basic_block
p
=
BASIC_BLOCK
(
pred
);
basic_block
s
=
BASIC_BLOCK
(
succ
);
...
...
@@ -6853,7 +6859,7 @@ verify_edge_list (f, elist)
pred
,
succ
,
EDGE_INDEX
(
elist
,
BASIC_BLOCK
(
pred
),
BASIC_BLOCK
(
succ
)));
}
for
(
succ
=
0
;
succ
<
n_basic_blocks
;
succ
++
)
for
(
succ
=
0
;
succ
<
n_basic_blocks
;
succ
++
)
{
basic_block
p
=
ENTRY_BLOCK_PTR
;
basic_block
s
=
BASIC_BLOCK
(
succ
);
...
...
@@ -6882,7 +6888,7 @@ verify_edge_list (f, elist)
succ
,
EDGE_INDEX
(
elist
,
ENTRY_BLOCK_PTR
,
BASIC_BLOCK
(
succ
)));
}
for
(
pred
=
0
;
pred
<
n_basic_blocks
;
pred
++
)
for
(
pred
=
0
;
pred
<
n_basic_blocks
;
pred
++
)
{
basic_block
p
=
BASIC_BLOCK
(
pred
);
basic_block
s
=
EXIT_BLOCK_PTR
;
...
...
@@ -6915,6 +6921,7 @@ verify_edge_list (f, elist)
/* This routine will determine what, if any, edge there is between
a specified predecessor and successor. */
int
find_edge_index
(
edge_list
,
pred
,
succ
)
struct
edge_list
*
edge_list
;
...
...
@@ -6931,6 +6938,7 @@ find_edge_index (edge_list, pred, succ)
}
/* This function will remove an edge from the flow graph. */
void
remove_edge
(
e
)
edge
e
;
...
...
@@ -6968,12 +6976,13 @@ remove_edge (e)
/* This routine will remove any fake successor edges for a basic block.
When the edge is removed, it is also removed from whatever predecessor
list it is in. */
static
void
remove_fake_successors
(
bb
)
basic_block
bb
;
{
edge
e
;
for
(
e
=
bb
->
succ
;
e
;
)
for
(
e
=
bb
->
succ
;
e
;
)
{
edge
tmp
=
e
;
e
=
e
->
succ_next
;
...
...
@@ -6985,6 +6994,7 @@ remove_fake_successors (bb)
/* This routine will remove all fake edges from the flow graph. If
we remove all fake successors, it will automatically remove all
fake predecessors. */
void
remove_fake_edges
()
{
...
...
@@ -7000,6 +7010,7 @@ remove_fake_edges ()
/* This function will add a fake edge between any block which has no
successors, and the exit block. Some data flow equations require these
edges to exist. */
void
add_noreturn_fake_exit_edges
()
{
...
...
@@ -7020,6 +7031,7 @@ add_noreturn_fake_exit_edges ()
number of inserted fake edges. To reduce the number of fake edges
to insert, add fake edges from _innermost_ loops containing only
nodes not reachable from the exit block. */
void
connect_infinite_loops_to_exit
()
{
...
...
@@ -7048,6 +7060,7 @@ connect_infinite_loops_to_exit ()
}
/* Redirect an edge's successor from one block to another. */
void
redirect_edge_succ
(
e
,
new_succ
)
edge
e
;
...
...
@@ -7056,7 +7069,7 @@ redirect_edge_succ (e, new_succ)
edge
*
pe
;
/* Disconnect the edge from the old successor block. */
for
(
pe
=
&
e
->
dest
->
pred
;
*
pe
!=
e
;
pe
=
&
(
*
pe
)
->
pred_next
)
for
(
pe
=
&
e
->
dest
->
pred
;
*
pe
!=
e
;
pe
=
&
(
*
pe
)
->
pred_next
)
continue
;
*
pe
=
(
*
pe
)
->
pred_next
;
...
...
@@ -7067,6 +7080,7 @@ redirect_edge_succ (e, new_succ)
}
/* Redirect an edge's predecessor from one block to another. */
void
redirect_edge_pred
(
e
,
new_pred
)
edge
e
;
...
...
@@ -7075,7 +7089,7 @@ redirect_edge_pred (e, new_pred)
edge
*
pe
;
/* Disconnect the edge from the old predecessor block. */
for
(
pe
=
&
e
->
src
->
succ
;
*
pe
!=
e
;
pe
=
&
(
*
pe
)
->
succ_next
)
for
(
pe
=
&
e
->
src
->
succ
;
*
pe
!=
e
;
pe
=
&
(
*
pe
)
->
succ_next
)
continue
;
*
pe
=
(
*
pe
)
->
succ_next
;
...
...
@@ -7086,6 +7100,7 @@ redirect_edge_pred (e, new_pred)
}
/* Dump the list of basic blocks in the bitmap NODES. */
static
void
flow_nodes_print
(
str
,
nodes
,
file
)
const
char
*
str
;
...
...
@@ -7099,8 +7114,8 @@ flow_nodes_print (str, nodes, file)
fputs
(
"}
\n
"
,
file
);
}
/* Dump the list of exiting edges in the array EDGES. */
static
void
flow_exits_print
(
str
,
edges
,
num_edges
,
file
)
const
char
*
str
;
...
...
@@ -7116,8 +7131,8 @@ flow_exits_print (str, edges, num_edges, file)
fputs
(
"}
\n
"
,
file
);
}
/* Dump loop related CFG information. */
static
void
flow_loops_cfg_dump
(
loops
,
file
)
const
struct
loops
*
loops
;
...
...
@@ -7138,7 +7153,6 @@ flow_loops_cfg_dump (loops, file)
flow_nodes_print
(
"} dom"
,
loops
->
cfg
.
dom
[
i
],
file
);
}
/* Dump the DFS node order. */
if
(
loops
->
cfg
.
dfs_order
)
{
...
...
@@ -7157,8 +7171,8 @@ flow_loops_cfg_dump (loops, file)
}
}
/* Return non-zero if the nodes of LOOP are a subset of OUTER. */
static
int
flow_loop_nested_p
(
outer
,
loop
)
struct
loop
*
outer
;
...
...
@@ -7167,8 +7181,8 @@ flow_loop_nested_p (outer, loop)
return
sbitmap_a_subset_b_p
(
loop
->
nodes
,
outer
->
nodes
);
}
/* Dump the loop information specified by LOOPS to the stream FILE. */
void
flow_loops_dump
(
loops
,
file
,
verbose
)
const
struct
loops
*
loops
;
...
...
@@ -7249,8 +7263,8 @@ flow_loops_dump (loops, file, verbose)
flow_loops_cfg_dump
(
loops
,
file
);
}
/* Free all the memory allocated for LOOPS. */
void
flow_loops_free
(
loops
)
struct
loops
*
loops
;
...
...
@@ -7284,10 +7298,10 @@ flow_loops_free (loops)
}
}
/* Find the exits from the loop using the bitmap of loop nodes NODES
and store in EXITS array. Return the number of exits from the
loop. */
static
int
flow_loop_exits_find
(
nodes
,
exits
)
const
sbitmap
nodes
;
...
...
@@ -7333,10 +7347,10 @@ flow_loop_exits_find (nodes, exits)
return
num_exits
;
}
/* Find the nodes contained within the loop with header HEADER and
latch LATCH and store in NODES. Return the number of nodes within
the loop. */
static
int
flow_loop_nodes_find
(
header
,
latch
,
nodes
)
basic_block
header
;
...
...
@@ -7391,13 +7405,13 @@ flow_loop_nodes_find (header, latch, nodes)
return
num_nodes
;
}
/* Compute the depth first search order and store in the array
DFS_ORDER if non-zero, marking the nodes visited in VISITED. If
RC_ORDER is non-zero, return the reverse completion number for each
node. Returns the number of nodes visited. A depth first search
tries to get as far away from the starting point as quickly as
possible. */
static
int
flow_depth_first_order_compute
(
dfs_order
,
rc_order
)
int
*
dfs_order
;
...
...
@@ -7487,7 +7501,6 @@ flow_depth_first_order_compute (dfs_order, rc_order)
return
dfsnum
;
}
/* Compute the depth first search order on the _reverse_ graph and
store in the array DFS_ORDER, marking the nodes visited in VISITED.
Returns the number of nodes visited.
...
...
@@ -7524,13 +7537,12 @@ flow_dfs_compute_reverse_init (data)
{
/* Allocate stack for back-tracking up CFG. */
data
->
stack
=
(
basic_block
*
)
xmalloc
((
n_basic_blocks
-
(
INVALID_BLOCK
+
1
))
(
basic_block
*
)
xmalloc
((
n_basic_blocks
-
(
INVALID_BLOCK
+
1
))
*
sizeof
(
basic_block
));
data
->
sp
=
0
;
/* Allocate bitmap to track nodes that have been visited. */
data
->
visited_blocks
=
sbitmap_alloc
(
n_basic_blocks
-
(
INVALID_BLOCK
+
1
));
data
->
visited_blocks
=
sbitmap_alloc
(
n_basic_blocks
-
(
INVALID_BLOCK
+
1
));
/* None of the nodes in the CFG have been visited yet. */
sbitmap_zero
(
data
->
visited_blocks
);
...
...
@@ -7555,6 +7567,7 @@ flow_dfs_compute_reverse_add_bb (data, bb)
with the block at the stack's top and ending when the stack is
empty. Visited nodes are marked. Returns an unvisited basic
block, or NULL if there is none available. */
static
basic_block
flow_dfs_compute_reverse_execute
(
data
)
depth_first_search_ds
data
;
...
...
@@ -7568,9 +7581,9 @@ flow_dfs_compute_reverse_execute (data)
bb
=
data
->
stack
[
--
data
->
sp
];
/* Mark that we have visited this node. */
if
(
!
TEST_BIT
(
data
->
visited_blocks
,
bb
->
index
-
(
INVALID_BLOCK
+
1
)))
if
(
!
TEST_BIT
(
data
->
visited_blocks
,
bb
->
index
-
(
INVALID_BLOCK
+
1
)))
{
SET_BIT
(
data
->
visited_blocks
,
bb
->
index
-
(
INVALID_BLOCK
+
1
));
SET_BIT
(
data
->
visited_blocks
,
bb
->
index
-
(
INVALID_BLOCK
+
1
));
/* Perform depth-first search on adjacent vertices. */
for
(
e
=
bb
->
pred
;
e
;
e
=
e
->
pred_next
)
...
...
@@ -7579,9 +7592,9 @@ flow_dfs_compute_reverse_execute (data)
}
/* Determine if there are unvisited basic blocks. */
for
(
i
=
n_basic_blocks
-
(
INVALID_BLOCK
+
1
);
--
i
>=
0
;
)
for
(
i
=
n_basic_blocks
-
(
INVALID_BLOCK
+
1
);
--
i
>=
0
;
)
if
(
!
TEST_BIT
(
data
->
visited_blocks
,
i
))
return
BASIC_BLOCK
(
i
+
(
INVALID_BLOCK
+
1
));
return
BASIC_BLOCK
(
i
+
(
INVALID_BLOCK
+
1
));
return
NULL
;
}
...
...
@@ -7600,6 +7613,7 @@ flow_dfs_compute_reverse_finish (data)
/* Return the block for the pre-header of the loop with header
HEADER where DOM specifies the dominator information. Return NULL if
there is no pre-header. */
static
basic_block
flow_loop_pre_header_find
(
header
,
dom
)
basic_block
header
;
...
...
@@ -7632,10 +7646,10 @@ flow_loop_pre_header_find (header, dom)
return
pre_header
;
}
/* Add LOOP to the loop hierarchy tree where PREVLOOP was the loop
previously added. The insertion algorithm assumes that the loops
are added in the order found by a depth first search of the CFG. */
static
void
flow_loop_tree_node_add
(
prevloop
,
loop
)
struct
loop
*
prevloop
;
...
...
@@ -7664,8 +7678,8 @@ flow_loop_tree_node_add (prevloop, loop)
loop
->
outer
=
NULL
;
}
/* Build the loop hierarchy tree for LOOPS. */
static
void
flow_loops_tree_build
(
loops
)
struct
loops
*
loops
;
...
...
@@ -7688,10 +7702,10 @@ flow_loops_tree_build (loops)
flow_loop_tree_node_add
(
&
loops
->
array
[
i
-
1
],
&
loops
->
array
[
i
]);
}
/* Helper function to compute loop nesting depth and enclosed loop level
for the natural loop specified by LOOP at the loop depth DEPTH.
Returns the loop level. */
static
int
flow_loop_level_compute
(
loop
,
depth
)
struct
loop
*
loop
;
...
...
@@ -7722,7 +7736,6 @@ flow_loop_level_compute (loop, depth)
return
level
;
}
/* Compute the loop nesting depth and enclosed loop level for the loop
hierarchy tree specfied by LOOPS. Return the maximum enclosed loop
level. */
...
...
@@ -7745,7 +7758,6 @@ flow_loops_level_compute (loops)
return
levels
;
}
/* Find all the natural loops in the function and save in LOOPS structure
and recalculate loop_depth information in basic block structures.
Return the number of natural loops found. */
...
...
@@ -7880,8 +7892,7 @@ flow_loops_find (loops)
=
flow_loop_exits_find
(
loop
->
nodes
,
&
loop
->
exits
);
/* Look to see if the loop has a pre-header node. */
loop
->
pre_header
=
flow_loop_pre_header_find
(
header
,
dom
);
loop
->
pre_header
=
flow_loop_pre_header_find
(
header
,
dom
);
num_loops
++
;
}
...
...
@@ -7916,7 +7927,6 @@ flow_loops_find (loops)
return
num_loops
;
}
/* Return non-zero if edge E enters header of LOOP from outside of LOOP. */
int
...
...
@@ -7930,7 +7940,6 @@ flow_loop_outside_edge_p (loop, e)
||
!
TEST_BIT
(
loop
->
nodes
,
e
->
src
->
index
);
}
/* Clear LOG_LINKS fields of insns in a chain.
Also clear the global_live_at_{start,end} fields of the basic block
structures. */
...
...
@@ -7978,4 +7987,3 @@ reg_set_to_hard_reg_set (to, from)
SET_HARD_REG_BIT
(
*
to
,
i
);
});
}
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