summaryrefslogtreecommitdiffhomepage
path: root/ir/lower
diff options
context:
space:
mode:
authorChristoph Mallon <christoph.mallon@gmx.de>2016-11-04 16:27:43 +0100
committerChristoph Mallon <christoph.mallon@gmx.de>2016-11-04 16:32:41 +0100
commit9bcf83b3c7d1b844180746c6470c8f3eaf23863a (patch)
treef294a473240fc7594410f5b86dac4d1fc9545d6a /ir/lower
parent731a6fc90fb0a66b068c0c0c67547c837b2fae78 (diff)
ir: Factor out 'is_Const(x) && is_Const_null(x)' into the new function 'is_irn_null()'.
Diffstat (limited to 'ir/lower')
-rw-r--r--ir/lower/lower_dw.c2
-rw-r--r--ir/lower/lower_intrinsics.c16
2 files changed, 9 insertions, 9 deletions
diff --git a/ir/lower/lower_dw.c b/ir/lower/lower_dw.c
index de1b158..c211a46 100644
--- a/ir/lower/lower_dw.c
+++ b/ir/lower/lower_dw.c
@@ -1073,7 +1073,7 @@ static bool is_equality_cmp(const ir_node *node)
return true;
/* Unsigned x > 0 behaves like !=. */
- if (is_Const(right) && is_Const_null(right) && !mode_is_signed(mode))
+ if (is_irn_null(right) && !mode_is_signed(mode))
return relation == ir_relation_greater;
return false;
diff --git a/ir/lower/lower_intrinsics.c b/ir/lower/lower_intrinsics.c
index cb52116..e9c36d5 100644
--- a/ir/lower/lower_intrinsics.c
+++ b/ir/lower/lower_intrinsics.c
@@ -300,7 +300,7 @@ int i_mapper_exp(ir_node *call)
{
ir_node *val = get_Call_param(call, 0);
- if (is_Const(val) && is_Const_null(val)) {
+ if (is_irn_null(val)) {
/* exp(0.0) = 1.0 */
ir_graph *irg = get_irn_irg(val);
ir_mode *mode = get_irn_mode(val);
@@ -330,7 +330,7 @@ static int i_mapper_zero_to_zero(ir_node *call)
{
ir_node *val = get_Call_param(call, 0);
- if (is_Const(val) && is_Const_null(val)) {
+ if (is_irn_null(val)) {
/* f(0.0) = 0.0 */
ir_node *mem = get_Call_mem(call);
DBG_OPT_ALGSIM0(call, val);
@@ -392,7 +392,7 @@ static int i_mapper_symmetric_zero_to_one(ir_node *call)
changed = 1;
}
- if (is_Const(val) && is_Const_null(val)) {
+ if (is_irn_null(val)) {
/* f(0.0) = 1.0 */
ir_graph *irg = get_irn_irg(val);
ir_mode *mode = get_irn_mode(val);
@@ -823,7 +823,7 @@ int i_mapper_strncmp(ir_node *call)
ir_node *len = get_Call_param(call, 2);
ir_node *irn;
- if (left == right || (is_Const(len) && is_Const_null(len))) {
+ if (left == right || is_irn_null(len)) {
/* a strncmp(s, s, len) ==> 0 OR
a strncmp(a, b, 0) ==> 0 */
ir_graph *irg = get_irn_irg(call);
@@ -865,7 +865,7 @@ int i_mapper_memcpy(ir_node *call)
ir_node *src = get_Call_param(call, 1);
ir_node *len = get_Call_param(call, 2);
- if (dst == src || (is_Const(len) && is_Const_null(len))) {
+ if (dst == src || is_irn_null(len)) {
/* a memcpy(d, d, len) ==> d OR
a memcpy(d, s, 0) ==> d */
ir_node *mem = get_Call_mem(call);
@@ -883,7 +883,7 @@ int i_mapper_memmove(ir_node *call)
ir_node *src = get_Call_param(call, 1);
ir_node *len = get_Call_param(call, 2);
- if (dst == src || (is_Const(len) && is_Const_null(len))) {
+ if (dst == src || is_irn_null(len)) {
/* a memmove(d, d, len) ==> d OR
a memmove(d, s, 0) ==> d */
ir_node *mem = get_Call_mem(call);
@@ -899,7 +899,7 @@ int i_mapper_memset(ir_node *call)
{
ir_node *len = get_Call_param(call, 2);
- if (is_Const(len) && is_Const_null(len)) {
+ if (is_irn_null(len)) {
/* a memset(d, C, 0) ==> d */
ir_node *mem = get_Call_mem(call);
ir_node *dst = get_Call_param(call, 0);
@@ -918,7 +918,7 @@ int i_mapper_memcmp(ir_node *call)
ir_node *len = get_Call_param(call, 2);
ir_node *irn;
- if (left == right || (is_Const(len) && is_Const_null(len))) {
+ if (left == right || is_irn_null(len)) {
/* a memcmp(s, s, len) ==> 0 OR
a memcmp(a, b, 0) ==> 0 */
ir_graph *irg = get_irn_irg(call);