Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Zwinkau
libfirm
Commits
c6182ec2
Commit
c6182ec2
authored
Dec 03, 2012
by
Christoph Mallon
Browse files
ir: Remove unnecessary mode_b checks of Cond selectors.
All Conds are boolean.
parent
847c1b62
Changes
6
Hide whitespace changes
Inline
Side-by-side
ir/be/amd64/amd64_transform.c
View file @
c6182ec2
...
...
@@ -217,16 +217,9 @@ static ir_node *gen_Cmp(ir_node *node)
*/
static
ir_node
*
gen_Cond
(
ir_node
*
node
)
{
ir_node
*
selector
=
get_Cond_selector
(
node
);
ir_mode
*
mode
=
get_irn_mode
(
selector
);
if
(
mode
!=
mode_b
)
{
panic
(
"create_Switch not implemented yet!"
);
// return gen_SwitchJmp(node);
}
ir_node
*
const
block
=
be_transform_node
(
get_nodes_block
(
node
));
dbg_info
*
const
dbgi
=
get_irn_dbg_info
(
node
);
ir_node
*
const
selector
=
get_Cond_selector
(
node
);
ir_node
*
const
flag_node
=
be_transform_node
(
selector
);
ir_relation
const
relation
=
get_Cmp_relation
(
selector
);
return
new_bd_amd64_Jcc
(
dbgi
,
block
,
flag_node
,
relation
);
...
...
ir/ir/irdump.c
View file @
c6182ec2
...
...
@@ -880,11 +880,9 @@ static void dump_node_nodeattr(FILE *F, const ir_node *n)
proj_nr
=
get_Proj_proj
(
n
);
code
=
get_irn_opcode
(
pred
);
if
(
code
==
iro_Proj
&&
get_irn_opcode
(
get_Proj_pred
(
pred
))
==
iro_Start
)
if
(
code
==
iro_Proj
&&
get_irn_opcode
(
get_Proj_pred
(
pred
))
==
iro_Start
)
{
fprintf
(
F
,
"Arg %ld "
,
proj_nr
);
else
if
(
code
==
iro_Cond
&&
get_irn_mode
(
get_Cond_selector
(
pred
))
!=
mode_b
)
fprintf
(
F
,
"%ld "
,
proj_nr
);
else
{
}
else
{
unsigned
i
,
j
,
f
=
0
;
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
proj_lut
);
++
i
)
{
...
...
ir/ir/iropt.c
View file @
c6182ec2
...
...
@@ -3332,8 +3332,8 @@ static ir_node *transform_node_Cond(ir_node *n)
ta
=
compute_cmp_ext
(
a
);
}
if
(
ta
!=
tarval_bad
&&
get_irn_mode
(
a
)
==
mode_b
)
{
/* It's
a boolean Cond,
branching on a boolean constant.
if
(
ta
!=
tarval_bad
)
{
/* It's branching on a boolean constant.
Replace it by a tuple (Bad, Jmp) or (Jmp, Bad) */
ir_node
*
blk
=
get_nodes_block
(
n
);
jmp
=
new_r_Jmp
(
blk
);
...
...
ir/opt/boolopt.c
View file @
c6182ec2
...
...
@@ -583,8 +583,6 @@ restart:
ir_node
*
lower_block
;
ir_node
*
lower_cf
;
ir_node
*
cond
;
ir_node
*
cond_selector
;
ir_node
*
lower_pred
;
lower_cf
=
get_Block_cfgpred
(
block
,
low_idx
);
lower_cf
=
skip_empty_blocks
(
lower_cf
);
...
...
@@ -603,12 +601,8 @@ restart:
if
(
get_Block_mark
(
lower_block
))
continue
;
cond_selector
=
get_Cond_selector
(
cond
);
if
(
get_irn_mode
(
cond_selector
)
!=
mode_b
)
continue
;
lower_pred
=
get_Block_cfgpred_block
(
lower_block
,
0
);
ir_node
*
const
cond_selector
=
get_Cond_selector
(
cond
);
ir_node
*
const
lower_pred
=
get_Block_cfgpred_block
(
lower_block
,
0
);
for
(
up_idx
=
0
;
up_idx
<
n_cfgpreds
;
++
up_idx
)
{
ir_node
*
upper_block
;
ir_node
*
upper_cf
;
...
...
@@ -625,11 +619,6 @@ restart:
if
(
!
block_dominates
(
upper_block
,
block
))
continue
;
ir_node
*
const
upper_cond
=
get_Proj_pred
(
upper_cf
);
ir_node
*
const
upper_cond_selector
=
get_Cond_selector
(
upper_cond
);
if
(
get_irn_mode
(
upper_cond_selector
)
!=
mode_b
)
continue
;
/* we have found the structure */
/* check Phis: There must be NO Phi in block that
depends on the existence of low block */
...
...
@@ -637,6 +626,8 @@ restart:
continue
;
/* all fine, try it */
ir_node
*
const
upper_cond
=
get_Proj_pred
(
upper_cf
);
ir_node
*
const
upper_cond_selector
=
get_Cond_selector
(
upper_cond
);
if
(
!
find_cond_pair
(
cond_selector
,
upper_cond_selector
,
&
cpair
))
continue
;
...
...
ir/opt/cfopt.c
View file @
c6182ec2
...
...
@@ -78,13 +78,6 @@ static bool is_Block_removable(const ir_node *block)
return
get_Block_mark
(
block
);
}
/** checks if a given Cond node is a switch Cond. */
static
bool
is_switch_Cond
(
const
ir_node
*
cond
)
{
ir_node
*
sel
=
get_Cond_selector
(
cond
);
return
get_irn_mode
(
sel
)
!=
mode_b
;
}
/** Walker: clear link fields and mark all blocks as removable. */
static
void
clear_link_and_mark_blocks_removable
(
ir_node
*
node
,
void
*
ctx
)
{
...
...
@@ -548,7 +541,6 @@ static bool optimize_pred_cond(ir_node *block, int i, int j)
if
(
!
is_Cond
(
cond
))
return
false
;
if
(
cond
!=
get_Proj_pred
(
projB
))
return
false
;
if
(
is_switch_Cond
(
cond
))
return
false
;
/* cond should actually be a Jmp */
pred_block
=
get_nodes_block
(
cond
);
...
...
ir/opt/ifconv.c
View file @
c6182ec2
...
...
@@ -296,9 +296,6 @@ restart:
if
(
!
is_Cond
(
cond
))
continue
;
/* We only handle boolean decisions, no switches */
if
(
get_irn_mode
(
get_Cond_selector
(
cond
))
!=
mode_b
)
continue
;
for
(
j
=
i
+
1
;
j
<
arity
;
++
j
)
{
ir_node
*
projx1
;
ir_node
*
sel
;
...
...
Write
Preview
Supports
Markdown
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