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
76870bab
Commit
76870bab
authored
Jan 02, 2014
by
Christoph Mallon
Browse files
Use create_zero_const().
parent
3ff9f3c7
Changes
1
Hide whitespace changes
Inline
Side-by-side
ir/ir/iropt.c
View file @
76870bab
...
...
@@ -3050,7 +3050,7 @@ static ir_node *transform_node_Mod(ir_node *n)
if
(
a
==
b
&&
value_not_zero
(
a
,
&
dummy
))
{
/* BEWARE: we can optimize a%a to 0 only if this cannot cause a exception */
value
=
new_r_Const
(
irg
,
get_mode_null
(
mode
)
);
value
=
create_zero_const
(
irg
,
mode
);
DBG_OPT_CSTEVAL
(
n
,
value
);
goto
make_tuple
;
}
else
{
...
...
@@ -3059,7 +3059,7 @@ static ir_node *transform_node_Mod(ir_node *n)
if
(
tv
==
get_mode_minus_one
(
mode
))
{
/* a % -1 = 0 */
value
=
new_r_Const
(
irg
,
get_mode_null
(
mode
)
);
value
=
create_zero_const
(
irg
,
mode
);
DBG_OPT_CSTEVAL
(
n
,
value
);
goto
make_tuple
;
}
...
...
@@ -3823,7 +3823,7 @@ static ir_node *transform_node_Proj_Mod(ir_node *proj)
/* a % a = 0 if a != 0 */
ir_graph
*
irg
=
get_irn_irg
(
proj
);
ir_mode
*
mode
=
get_irn_mode
(
proj
);
ir_node
*
res
=
new_r_Const
(
irg
,
get_mode_null
(
mode
)
);
ir_node
*
res
=
create_zero_const
(
irg
,
mode
);
DBG_OPT_CSTEVAL
(
mod
,
res
);
return
res
;
...
...
@@ -4810,7 +4810,7 @@ static ir_node *transform_node_shift(ir_node *n)
return
new_rd_Shrs
(
dbgi
,
block
,
get_binop_left
(
left
),
cnst
,
mode
);
}
return
new_r_Const
(
irg
,
get_mode_null
(
mode
)
);
return
create_zero_const
(
irg
,
mode
);
}
/* ok, we can replace it */
...
...
@@ -6151,7 +6151,7 @@ handle_tv:;
return
res
;
return
NULL
;
}
return
new_r_Const
(
irg
,
get_mode_null
(
mode
)
);
return
create_zero_const
(
irg
,
mode
);
}
}
}
...
...
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