Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Zwinkau
libfirm
Commits
f86e2456
Commit
f86e2456
authored
Mar 15, 2014
by
Christoph Mallon
Browse files
ircons: Add and use new_{r,rd}_Const_null().
parent
033a7b6d
Changes
15
Hide whitespace changes
Inline
Side-by-side
ir/ana/irconsconfirm.c
View file @
f86e2456
...
...
@@ -489,7 +489,7 @@ static void insert_non_null(ir_node *ptr, ir_node *block, env_t *env)
if
(
c
==
NULL
)
{
ir_mode
*
mode
=
get_irn_mode
(
ptr
);
ir_graph
*
irg
=
get_irn_irg
(
block
);
c
=
new_r_Const
(
irg
,
get_mode
_null
(
mode
)
)
;
c
=
new_r_Const_null
(
irg
,
mode
);
c
=
new_r_Confirm
(
block
,
ptr
,
c
,
ir_relation_less_greater
);
}
...
...
ir/be/ia32/ia32_intrinsics.c
View file @
f86e2456
...
...
@@ -13,7 +13,7 @@
#include
"irgmod.h"
#include
"irop.h"
#include
"irnode_t.h"
#include
"ircons.h"
#include
"ircons
_t
.h"
#include
"irprog_t.h"
#include
"iroptimize.h"
#include
"lower_dw.h"
...
...
@@ -228,7 +228,7 @@ static void ia32_lower_conv64(ir_node *node, ir_mode *mode)
/* create to Phis */
ir_node
*
phi_in
[]
=
{
new_r_Const
(
irg
,
get_mode
_null
(
mode
)
)
,
new_r_Const_null
(
irg
,
mode
),
new_r_Const_long
(
irg
,
mode
,
0x80000000
)
};
ir_node
*
int_phi
...
...
ir/be/sparc/bearch_sparc.c
View file @
f86e2456
...
...
@@ -13,7 +13,7 @@
#include
"irgwalk.h"
#include
"irprog.h"
#include
"ircons.h"
#include
"ircons
_t
.h"
#include
"irgmod.h"
#include
"irgopt.h"
#include
"iroptimize.h"
...
...
@@ -256,7 +256,7 @@ static void rewrite_unsigned_float_Conv(ir_node *node)
ir_mode
*
mode_d
=
mode_D
;
ir_node
*
signed_x
=
new_rd_Conv
(
dbgi
,
block
,
unsigned_x
,
mode_s
);
ir_node
*
res
=
new_rd_Conv
(
dbgi
,
block
,
signed_x
,
mode_d
);
ir_node
*
zero
=
new_r_Const
(
irg
,
get_mode
_null
(
mode_s
)
)
;
ir_node
*
zero
=
new_r_Const_null
(
irg
,
mode_s
);
ir_node
*
cmp
=
new_rd_Cmp
(
dbgi
,
block
,
signed_x
,
zero
,
ir_relation_less
);
ir_node
*
cond
=
new_rd_Cond
(
dbgi
,
block
,
cmp
);
...
...
ir/be/sparc/sparc_lower64.c
View file @
f86e2456
...
...
@@ -62,8 +62,8 @@ static void lower64_minus(ir_node *node, ir_mode *mode)
ir_node
*
right_low
=
get_lowered_low
(
op
);
ir_node
*
right_high
=
get_lowered_high
(
op
);
ir_mode
*
low_unsigned
=
get_irn_mode
(
right_low
);
ir_node
*
left_low
=
new_r_Const
(
irg
,
get_mode
_null
(
low_unsigned
)
)
;
ir_node
*
left_high
=
new_r_Const
(
irg
,
get_mode
_null
(
mode
)
)
;
ir_node
*
left_low
=
new_r_Const_null
(
irg
,
low_unsigned
);
ir_node
*
left_high
=
new_r_Const_null
(
irg
,
mode
);
ir_node
*
subcc
=
new_bd_sparc_SubCC_t
(
dbgi
,
block
,
left_low
,
right_low
);
ir_node
*
res_low
=
new_r_Proj
(
subcc
,
mode_Iu
,
pn_sparc_SubCC_t_res
);
...
...
ir/ir/irarch.c
View file @
f86e2456
...
...
@@ -438,7 +438,7 @@ static ir_node *build_graph(mul_env *env, instruction *inst)
r
=
build_graph
(
env
,
inst
->
in
[
1
]);
return
inst
->
irn
=
new_rd_Add
(
env
->
dbg
,
env
->
blk
,
l
,
r
,
env
->
mode
);
case
ZERO
:
return
inst
->
irn
=
new_r_Const
(
irg
,
get_mode
_null
(
env
->
mode
)
)
;
return
inst
->
irn
=
new_r_Const_null
(
irg
,
env
->
mode
);
default:
panic
(
"Unsupported instruction kind"
);
}
...
...
@@ -1006,7 +1006,7 @@ ir_node *arch_dep_replace_div_by_const(ir_node *irn)
res
=
new_rd_Shrs
(
dbg
,
block
,
curr
,
k_node
,
mode
);
if
(
n_flag
)
{
/* negate the result */
k_node
=
new_r_Const
(
irg
,
get_mode
_null
(
mode
)
)
;
k_node
=
new_r_Const_null
(
irg
,
mode
);
res
=
new_rd_Sub
(
dbg
,
block
,
k_node
,
res
,
mode
);
}
}
else
{
/* unsigned case */
...
...
@@ -1080,7 +1080,7 @@ ir_node *arch_dep_replace_mod_by_const(ir_node *irn)
if
(
k
==
0
)
{
ir_graph
*
irg
=
get_irn_irg
(
irn
);
res
=
new_r_Const
(
irg
,
get_mode
_null
(
mode
)
)
;
res
=
new_r_Const_null
(
irg
,
mode
);
}
else
if
(
k
>
0
)
{
ir_graph
*
irg
=
get_irn_irg
(
irn
);
...
...
ir/ir/ircons.c
View file @
f86e2456
...
...
@@ -648,3 +648,13 @@ void (verify_new_node)(ir_graph *irg, ir_node *node)
{
verify_new_node_
(
irg
,
node
);
}
ir_node
*
new_rd_Const_null
(
dbg_info
*
const
dbgi
,
ir_graph
*
const
irg
,
ir_mode
*
const
mode
)
{
return
new_rd_Const
(
dbgi
,
irg
,
get_mode_null
(
mode
));
}
ir_node
*
new_r_Const_null
(
ir_graph
*
const
irg
,
ir_mode
*
const
mode
)
{
return
new_r_Const
(
irg
,
get_mode_null
(
mode
));
}
ir/ir/ircons_t.h
View file @
f86e2456
...
...
@@ -81,4 +81,8 @@ void ssa_cons_start(ir_graph *irg, int n_loc);
*/
void
ssa_cons_finish
(
ir_graph
*
irg
);
ir_node
*
new_rd_Const_null
(
dbg_info
*
dbgi
,
ir_graph
*
irg
,
ir_mode
*
mode
);
ir_node
*
new_r_Const_null
(
ir_graph
*
irg
,
ir_mode
*
mode
);
#endif
ir/ir/iropt.c
View file @
f86e2456
...
...
@@ -1902,17 +1902,6 @@ static ir_node *transform_node_AddSub(ir_node *n)
} \
} while(0)
/**
* Create a 0 constant of given mode.
*/
static
ir_node
*
create_zero_const
(
ir_graph
*
irg
,
ir_mode
*
mode
)
{
ir_tarval
*
tv
=
get_mode_null
(
mode
);
ir_node
*
cnst
=
new_r_Const
(
irg
,
tv
);
return
cnst
;
}
static
ir_node
*
create_bool_const
(
ir_graph
*
const
irg
,
bool
const
val
)
{
ir_tarval
*
const
tv
=
val
?
get_tarval_b_true
()
:
get_tarval_b_false
();
...
...
@@ -2405,7 +2394,7 @@ static ir_node *transform_node_Or_(ir_node *n)
ir_node
*
xorb
=
new_rd_Eor
(
dbgi
,
block
,
b_left
,
b_right
,
b_mode
);
ir_node
*
conv
=
new_rd_Conv
(
dbgi
,
block
,
xora
,
b_mode
);
ir_node
*
orn
=
new_rd_Or
(
dbgi
,
block
,
conv
,
xorb
,
b_mode
);
ir_node
*
zero
=
create_zero_const
(
irg
,
b_mode
);
ir_node
*
zero
=
new_r_Const_null
(
irg
,
b_mode
);
return
new_rd_Cmp
(
dbgi
,
block
,
orn
,
zero
,
ir_relation_less_greater
);
}
if
(
values_in_mode
(
get_irn_mode
(
b_left
),
get_irn_mode
(
a_left
)))
{
...
...
@@ -2418,7 +2407,7 @@ static ir_node *transform_node_Or_(ir_node *n)
ir_node
*
xorb
=
new_rd_Eor
(
dbgi
,
block
,
b_left
,
b_right
,
b_mode
);
ir_node
*
conv
=
new_rd_Conv
(
dbgi
,
block
,
xorb
,
a_mode
);
ir_node
*
orn
=
new_rd_Or
(
dbgi
,
block
,
xora
,
conv
,
a_mode
);
ir_node
*
zero
=
create_zero_const
(
irg
,
a_mode
);
ir_node
*
zero
=
new_r_Const_null
(
irg
,
a_mode
);
return
new_rd_Cmp
(
dbgi
,
block
,
orn
,
zero
,
ir_relation_less_greater
);
}
}
...
...
@@ -3376,7 +3365,7 @@ static ir_node *transform_node_Mod(ir_node *n)
ir_node
*
b
=
get_Mod_right
(
n
);
if
(
a
==
b
&&
value_not_null
(
a
,
NULL
))
{
/* BEWARE: we can optimize a%a to 0 only if this cannot cause a exception */
value
=
create_zero_const
(
irg
,
mode
);
value
=
new_r_Const_null
(
irg
,
mode
);
DBG_OPT_CSTEVAL
(
n
,
value
);
goto
make_tuple
;
}
else
{
...
...
@@ -3385,7 +3374,7 @@ static ir_node *transform_node_Mod(ir_node *n)
if
(
tarval_is_minus_one
(
tv
))
{
/* a % -1 = 0 */
value
=
create_zero_const
(
irg
,
mode
);
value
=
new_r_Const_null
(
irg
,
mode
);
DBG_OPT_CSTEVAL
(
n
,
value
);
goto
make_tuple
;
}
...
...
@@ -3619,7 +3608,7 @@ static ir_node *transform_node_And(ir_node *n)
ir_node
*
conv
=
new_rd_Conv
(
dbgi
,
block
,
xora
,
b_mode
);
ir_node
*
orn
=
new_rd_Or
(
dbgi
,
block
,
conv
,
xorb
,
b_mode
);
ir_graph
*
irg
=
get_irn_irg
(
n
);
ir_node
*
zero
=
create_zero_const
(
irg
,
b_mode
);
ir_node
*
zero
=
new_r_Const_null
(
irg
,
b_mode
);
return
new_rd_Cmp
(
dbgi
,
block
,
orn
,
zero
,
ir_relation_equal
);
}
if
(
values_in_mode
(
get_irn_mode
(
b_left
),
get_irn_mode
(
a_left
)))
{
...
...
@@ -3632,7 +3621,7 @@ static ir_node *transform_node_And(ir_node *n)
ir_node
*
conv
=
new_rd_Conv
(
dbgi
,
block
,
xorb
,
a_mode
);
ir_node
*
orn
=
new_rd_Or
(
dbgi
,
block
,
xora
,
conv
,
a_mode
);
ir_graph
*
irg
=
get_irn_irg
(
n
);
ir_node
*
zero
=
create_zero_const
(
irg
,
a_mode
);
ir_node
*
zero
=
new_r_Const_null
(
irg
,
a_mode
);
return
new_rd_Cmp
(
dbgi
,
block
,
orn
,
zero
,
ir_relation_equal
);
}
}
...
...
@@ -4031,7 +4020,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
=
create_zero_const
(
irg
,
mode
);
ir_node
*
res
=
new_r_Const_null
(
irg
,
mode
);
DBG_OPT_CSTEVAL
(
mod
,
res
);
return
res
;
...
...
@@ -4275,7 +4264,7 @@ static ir_node *transform_node_Cmp(ir_node *n)
cmp_x_eq_0:
;
ir_graph
*
irg
=
get_irn_irg
(
n
);
left
=
x
;
right
=
create_zero_const
(
irg
,
mode
);
right
=
new_r_Const_null
(
irg
,
mode
);
changed
=
true
;
DBG_OPT_ALGSIM0
(
n
,
n
,
FS_OPT_CMP_OP_OP
);
}
...
...
@@ -4344,7 +4333,7 @@ cmp_x_eq_0:;
relation
=
relation
==
ir_relation_equal
?
ir_relation_less_greater
:
ir_relation_equal
;
right
=
create_zero_const
(
irg
,
mode
);
right
=
new_r_Const_null
(
irg
,
mode
);
changed
|=
1
;
goto
is_bittest
;
}
...
...
@@ -4999,7 +4988,7 @@ static ir_node *transform_node_shift(ir_node *n)
return
new_rd_Shrs
(
dbgi
,
block
,
get_binop_left
(
left
),
cnst
,
mode
);
}
return
create_zero_const
(
irg
,
mode
);
return
new_r_Const_null
(
irg
,
mode
);
}
/* ok, we can replace it */
...
...
@@ -6310,10 +6299,9 @@ static ir_node *extract_from_initializer(const ir_type *type,
ir_tarval
*
tv
;
switch
(
get_initializer_kind
(
initializer
))
{
case
IR_INITIALIZER_NULL
:
{
ir_tarval
*
tv
=
get_mode_null
(
mode
);
return
new_r_Const
(
irg
,
tv
);
}
case
IR_INITIALIZER_NULL
:
return
new_r_Const_null
(
irg
,
mode
);
case
IR_INITIALIZER_TARVAL
:
{
tv
=
get_initializer_tarval_value
(
initializer
);
handle_tv:
;
...
...
@@ -6390,7 +6378,7 @@ handle_tv:;
return
extract_from_initializer
(
member_type
,
sub_initializer
,
new_offset
,
mode
,
dbgi
,
irg
);
}
return
create_zero_const
(
irg
,
mode
);
return
new_r_Const_null
(
irg
,
mode
);
}
}
}
...
...
ir/lower/lower_dw.c
View file @
f86e2456
...
...
@@ -29,7 +29,7 @@
#include
"irflag_t.h"
#include
"firmstat.h"
#include
"irgwalk.h"
#include
"ircons.h"
#include
"ircons
_t
.h"
#include
"irflag.h"
#include
"iroptimize.h"
#include
"debug.h"
...
...
@@ -801,7 +801,7 @@ static void lower_shr_helper(ir_node *node, ir_mode *mode,
* than half the word width */
ir_node
*
cnst
=
new_r_Const_long
(
irg
,
low_unsigned
,
modulo_shift2
);
ir_node
*
andn
=
new_r_And
(
block
,
right
,
cnst
,
low_unsigned
);
ir_node
*
cnst2
=
new_r_Const
(
irg
,
get_mode
_null
(
low_unsigned
)
)
;
ir_node
*
cnst2
=
new_r_Const_null
(
irg
,
low_unsigned
);
ir_node
*
cmp
=
new_rd_Cmp
(
dbgi
,
block
,
andn
,
cnst2
,
ir_relation_equal
);
ir_node
*
cond
=
new_rd_Cond
(
dbgi
,
block
,
cmp
);
ir_node
*
proj_true
=
new_r_Proj
(
cond
,
mode_X
,
pn_Cond_true
);
...
...
@@ -844,7 +844,7 @@ static void lower_shr_helper(ir_node *node, ir_mode *mode,
if
(
new_rd_shrs
==
new_rd_Shrs
)
{
fres_high
=
new_rd_shrs
(
dbgi
,
block_false
,
left_high
,
cnst3
,
mode
);
}
else
{
fres_high
=
new_r_Const
(
irg
,
get_mode
_null
(
mode
)
)
;
fres_high
=
new_r_Const_null
(
irg
,
mode
);
}
/* patch lower block */
...
...
@@ -915,7 +915,7 @@ static void lower_Shl(ir_node *node, ir_mode *mode)
* than half the word width */
ir_node
*
cnst
=
new_r_Const_long
(
irg
,
low_unsigned
,
modulo_shift2
);
ir_node
*
andn
=
new_r_And
(
block
,
right
,
cnst
,
low_unsigned
);
ir_node
*
cnst2
=
new_r_Const
(
irg
,
get_mode
_null
(
low_unsigned
)
)
;
ir_node
*
cnst2
=
new_r_Const_null
(
irg
,
low_unsigned
);
ir_node
*
cmp
=
new_rd_Cmp
(
dbgi
,
block
,
andn
,
cnst2
,
ir_relation_equal
);
ir_node
*
cond
=
new_rd_Cond
(
dbgi
,
block
,
cmp
);
...
...
@@ -943,7 +943,7 @@ static void lower_Shl(ir_node *node, ir_mode *mode)
/* false block => shift_width > 1word */
ir_node
*
fin
[
1
]
=
{
proj_false
};
ir_node
*
block_false
=
new_r_Block
(
irg
,
ARRAY_SIZE
(
fin
),
fin
);
ir_node
*
fres_low
=
new_r_Const
(
irg
,
get_mode
_null
(
low_unsigned
)
)
;
ir_node
*
fres_low
=
new_r_Const_null
(
irg
,
low_unsigned
);
ir_node
*
fconv
=
create_conv
(
block_false
,
left_low
,
mode
);
ir_node
*
fres_high
=
new_rd_Shl
(
dbgi
,
block_false
,
fconv
,
right
,
mode
);
...
...
@@ -1170,8 +1170,9 @@ static void lower_Cond(ir_node *node, ir_mode *high_mode)
ir_node
*
high_right
=
new_rd_Conv
(
dbg
,
block
,
rentry
->
high_word
,
mode
);
ir_node
*
xor_low
=
new_rd_Eor
(
dbg
,
block
,
low_left
,
low_right
,
mode
);
ir_node
*
xor_high
=
new_rd_Eor
(
dbg
,
block
,
high_left
,
high_right
,
mode
);
ir_node
*
ornode
=
new_rd_Or
(
dbg
,
block
,
xor_low
,
xor_high
,
mode
);
ir_node
*
cmp
=
new_rd_Cmp
(
dbg
,
block
,
ornode
,
new_r_Const
(
irg
,
get_mode_null
(
mode
)),
relation
);
ir_node
*
ornode
=
new_rd_Or
(
dbg
,
block
,
xor_low
,
xor_high
,
mode
);
ir_node
*
null
=
new_r_Const_null
(
irg
,
mode
);
ir_node
*
cmp
=
new_rd_Cmp
(
dbg
,
block
,
ornode
,
null
,
relation
);
set_Cond_selector
(
node
,
cmp
);
return
;
}
...
...
@@ -1334,12 +1335,12 @@ static void lower_Conv_to_Ll(ir_node *node)
op
=
new_rd_Conv
(
dbg
,
block
,
op
,
low_signed
);
res_high
=
new_rd_Shrs
(
dbg
,
block
,
op
,
cnst
,
low_signed
);
}
else
{
res_high
=
new_r_Const
(
irg
,
get_mode
_null
(
low_signed
)
)
;
res_high
=
new_r_Const_null
(
irg
,
low_signed
);
}
}
}
else
if
(
imode
==
mode_b
)
{
res_low
=
new_rd_Conv
(
dbg
,
block
,
op
,
low_unsigned
);
res_high
=
new_r_Const
(
irg
,
get_mode
_null
(
low_signed
)
)
;
res_high
=
new_r_Const_null
(
irg
,
low_signed
);
}
else
{
ir_node
*
irn
,
*
call
;
ir_type
*
mtp
=
get_conv_type
(
imode
,
omode
);
...
...
@@ -1439,7 +1440,8 @@ static void lower_Cmp(ir_node *cmp, ir_mode *m)
ir_node
*
xor_low
=
new_rd_Eor
(
dbg
,
block
,
low_left
,
low_right
,
mode
);
ir_node
*
xor_high
=
new_rd_Eor
(
dbg
,
block
,
high_left
,
high_right
,
mode
);
ir_node
*
ornode
=
new_rd_Or
(
dbg
,
block
,
xor_low
,
xor_high
,
mode
);
ir_node
*
new_cmp
=
new_rd_Cmp
(
dbg
,
block
,
ornode
,
new_r_Const
(
irg
,
get_mode_null
(
mode
)),
relation
);
ir_node
*
null
=
new_r_Const_null
(
irg
,
mode
);
ir_node
*
new_cmp
=
new_rd_Cmp
(
dbg
,
block
,
ornode
,
null
,
relation
);
exchange
(
cmp
,
new_cmp
);
return
;
}
...
...
@@ -2353,9 +2355,9 @@ static void lower_reduce_builtin(ir_node *builtin, ir_mode *mode)
switch
(
kind
)
{
case
ir_bk_ffs
:
{
ir_node
*
number_of_bits
=
new_r_Const_long
(
irg
,
result_mode
,
get_mode_size_bits
(
env
->
low_unsigned
));
ir_node
*
zero_high
=
new_rd_Const
(
dbgi
,
irg
,
get_mode_null
(
high_mode
)
)
;
ir_node
*
zero_unsigned
=
new_rd_Const
(
dbgi
,
irg
,
get_mode_null
(
env
->
low_unsigned
)
)
;
ir_node
*
zero_result
=
new_rd_Const
(
dbgi
,
irg
,
get_mode_null
(
result_mode
)
)
;
ir_node
*
zero_high
=
new_rd_Const
_null
(
dbgi
,
irg
,
high_mode
);
ir_node
*
zero_unsigned
=
new_rd_Const
_null
(
dbgi
,
irg
,
env
->
low_unsigned
);
ir_node
*
zero_result
=
new_rd_Const
_null
(
dbgi
,
irg
,
result_mode
);
ir_node
*
cmp_low
=
new_rd_Cmp
(
dbgi
,
block
,
entry
->
low_word
,
zero_unsigned
,
ir_relation_equal
);
ir_node
*
cmp_high
=
new_rd_Cmp
(
dbgi
,
block
,
entry
->
high_word
,
zero_high
,
ir_relation_equal
);
ir_node
*
ffs_high
=
new_rd_Builtin
(
dbgi
,
block
,
mem
,
1
,
in_high
,
kind
,
lowered_type_high
);
...
...
@@ -2375,7 +2377,7 @@ static void lower_reduce_builtin(ir_node *builtin, ir_mode *mode)
break
;
}
case
ir_bk_clz
:
{
ir_node
*
zero
=
new_rd_Const
(
dbgi
,
irg
,
get_mode_null
(
high_mode
)
)
;
ir_node
*
zero
=
new_rd_Const
_null
(
dbgi
,
irg
,
high_mode
);
ir_node
*
cmp_high
=
new_rd_Cmp
(
dbgi
,
block
,
entry
->
high_word
,
zero
,
ir_relation_equal
);
ir_node
*
clz_high
=
new_rd_Builtin
(
dbgi
,
block
,
mem
,
1
,
in_high
,
kind
,
lowered_type_high
);
ir_node
*
high
=
new_r_Proj
(
clz_high
,
result_mode
,
pn_Builtin_max
+
1
);
...
...
@@ -2391,7 +2393,7 @@ static void lower_reduce_builtin(ir_node *builtin, ir_mode *mode)
break
;
}
case
ir_bk_ctz
:
{
ir_node
*
zero_unsigned
=
new_rd_Const
(
dbgi
,
irg
,
get_mode_null
(
env
->
low_unsigned
)
)
;
ir_node
*
zero_unsigned
=
new_rd_Const
_null
(
dbgi
,
irg
,
env
->
low_unsigned
);
ir_node
*
cmp_low
=
new_rd_Cmp
(
dbgi
,
block
,
entry
->
low_word
,
zero_unsigned
,
ir_relation_equal
);
ir_node
*
ffs_high
=
new_rd_Builtin
(
dbgi
,
block
,
mem
,
1
,
in_high
,
kind
,
lowered_type_high
);
ir_node
*
high_proj
=
new_r_Proj
(
ffs_high
,
result_mode
,
pn_Builtin_max
+
1
);
...
...
ir/lower/lower_intrinsics.c
View file @
f86e2456
...
...
@@ -16,7 +16,7 @@
#include
"irnode_t.h"
#include
"irprog_t.h"
#include
"irgwalk.h"
#include
"ircons.h"
#include
"ircons
_t
.h"
#include
"irgmod.h"
#include
"irgopt.h"
#include
"trouts.h"
...
...
@@ -172,7 +172,7 @@ int i_mapper_abs(ir_node *call)
if
(
mode_has_signed_zero
(
mode
))
return
0
;
ir_node
*
zero
=
new_r_Const
(
irg
,
get_mode
_null
(
mode
)
)
;
ir_node
*
zero
=
new_r_Const_null
(
irg
,
mode
);
ir_node
*
cmp
=
new_rd_Cmp
(
dbg
,
block
,
op
,
zero
,
ir_relation_less
);
ir_node
*
minus_op
=
new_rd_Minus
(
dbg
,
block
,
op
,
mode
);
ir_node
*
mux
;
...
...
@@ -395,7 +395,7 @@ static int i_mapper_one_to_zero(ir_node *call, int reason)
/* acos(1.0) = 0.0 */
ir_graph
*
irg
=
get_irn_irg
(
val
);
ir_mode
*
mode
=
get_irn_mode
(
val
);
ir_node
*
irn
=
new_r_Const
(
irg
,
get_mode
_null
(
mode
)
)
;
ir_node
*
irn
=
new_r_Const_null
(
irg
,
mode
);
ir_node
*
mem
=
get_Call_mem
(
call
);
DBG_OPT_ALGSIM0
(
call
,
irn
,
reason
);
replace_call
(
irn
,
call
,
mem
,
NULL
,
NULL
);
...
...
@@ -725,10 +725,8 @@ static ir_node *eval_strcmp(ir_graph *irg, ir_entity *left, ir_entity *right,
return
new_r_Const
(
irg
,
tv
);
}
if
(
tarval_is_null
(
tv_l
))
{
ir_tarval
*
const
tv
=
get_mode_null
(
get_type_mode
(
res_tp
));
return
new_r_Const
(
irg
,
tv
);
}
if
(
tarval_is_null
(
tv_l
))
return
new_r_Const_null
(
irg
,
get_type_mode
(
res_tp
));
}
return
NULL
;
...
...
@@ -799,7 +797,7 @@ int i_mapper_strcmp(ir_node *call)
ir_graph
*
irg
=
get_irn_irg
(
call
);
ir_mode
*
mode
=
get_type_mode
(
res_tp
);
irn
=
new_r_Const
(
irg
,
get_mode
_null
(
mode
)
)
;
irn
=
new_r_Const_null
(
irg
,
mode
);
DBG_OPT_ALGSIM0
(
call
,
irn
,
FS_OPT_RTS_STRCMP
);
replace_call
(
irn
,
call
,
mem
,
NULL
,
NULL
);
return
1
;
...
...
@@ -881,7 +879,7 @@ int i_mapper_strncmp(ir_node *call)
ir_type
*
res_tp
=
get_method_res_type
(
call_tp
,
0
);
ir_mode
*
mode
=
get_type_mode
(
res_tp
);
irn
=
new_r_Const
(
irg
,
get_mode
_null
(
mode
)
)
;
irn
=
new_r_Const_null
(
irg
,
mode
);
DBG_OPT_ALGSIM0
(
call
,
irn
,
FS_OPT_RTS_STRNCMP
);
replace_call
(
irn
,
call
,
mem
,
NULL
,
NULL
);
return
1
;
...
...
@@ -998,7 +996,7 @@ int i_mapper_memcmp(ir_node *call)
ir_type
*
res_tp
=
get_method_res_type
(
call_tp
,
0
);
ir_mode
*
mode
=
get_type_mode
(
res_tp
);
irn
=
new_r_Const
(
irg
,
get_mode
_null
(
mode
)
)
;
irn
=
new_r_Const_null
(
irg
,
mode
);
DBG_OPT_ALGSIM0
(
call
,
irn
,
FS_OPT_RTS_STRNCMP
);
replace_call
(
irn
,
call
,
mem
,
NULL
,
NULL
);
return
1
;
...
...
ir/lower/lower_mode_b.c
View file @
f86e2456
...
...
@@ -49,12 +49,10 @@ static ir_node *create_not(dbg_info *dbgi, ir_node *node)
static
ir_node
*
convert_to_modeb
(
ir_node
*
node
)
{
ir_node
*
block
=
get_nodes_block
(
node
);
ir_graph
*
irg
=
get_irn_irg
(
node
);
ir_mode
*
mode
=
lowered_mode
;
ir_tarval
*
tv_zero
=
get_mode_null
(
mode
);
ir_node
*
zero
=
new_r_Const
(
irg
,
tv_zero
);
ir_node
*
cmp
=
new_r_Cmp
(
block
,
node
,
zero
,
ir_relation_less_greater
);
ir_node
*
block
=
get_nodes_block
(
node
);
ir_graph
*
irg
=
get_irn_irg
(
node
);
ir_node
*
zero
=
new_r_Const_null
(
irg
,
lowered_mode
);
ir_node
*
cmp
=
new_r_Cmp
(
block
,
node
,
zero
,
ir_relation_less_greater
);
return
cmp
;
}
...
...
@@ -78,7 +76,7 @@ static ir_node *create_cond_set(ir_node *cond_value, ir_mode *dest_mode)
ir_node
*
false_jmp
=
new_r_Jmp
(
false_block
);
ir_node
*
lower_in
[
2
]
=
{
true_jmp
,
false_jmp
};
ir_node
*
one
=
new_r_Const
(
irg
,
get_mode_one
(
dest_mode
));
ir_node
*
zero
=
new_r_Const
(
irg
,
get_mode
_null
(
dest_mode
)
)
;
ir_node
*
zero
=
new_r_Const_null
(
irg
,
dest_mode
);
ir_node
*
phi_in
[
2
]
=
{
one
,
zero
};
ir_node
*
phi
;
...
...
@@ -180,8 +178,7 @@ static ir_node *lower_node(ir_node *node)
ir_tarval
*
tv_one
=
get_mode_one
(
mode
);
res
=
new_rd_Const
(
dbgi
,
irg
,
tv_one
);
}
else
if
(
tv
==
get_tarval_b_false
())
{
ir_tarval
*
tv_zero
=
get_mode_null
(
mode
);
res
=
new_rd_Const
(
dbgi
,
irg
,
tv_zero
);
res
=
new_rd_Const_null
(
dbgi
,
irg
,
mode
);
}
else
{
panic
(
"invalid boolean const %+F"
,
node
);
}
...
...
ir/lower/lower_softfloat.c
View file @
f86e2456
...
...
@@ -14,7 +14,7 @@
#include
"dbginfo_t.h"
#include
"debug.h"
#include
"error.h"
#include
"ircons.h"
#include
"ircons
_t
.h"
#include
"iredges.h"
#include
"irgmod.h"
#include
"irnodeset.h"
...
...
@@ -415,7 +415,7 @@ static bool lower_Cmp(ir_node *const n)
dbg_info
*
const
dbgi
=
get_irn_dbg_info
(
n
);
ir_graph
*
const
irg
=
get_irn_irg
(
n
);
ir_node
*
const
zero
=
new_rd_Const
(
dbgi
,
irg
,
get_mode_null
(
mode_Is
)
)
;
ir_node
*
const
zero
=
new_rd_Const
_null
(
dbgi
,
irg
,
mode_Is
);
char
const
*
name
=
NULL
;
char
const
*
name2
=
NULL
;
...
...
ir/opt/loop.c
View file @
f86e2456
...
...
@@ -18,7 +18,7 @@
#include
"debug.h"
#include
"error.h"
#include
"ircons.h"
#include
"ircons
_t
.h"
#include
"irgopt.h"
#include
"irgmod.h"
#include
"irgwalk.h"
...
...
@@ -1566,7 +1566,7 @@ static ir_node *new_Abs(ir_node *op, ir_mode *mode)
{
ir_graph
*
irg
=
get_irn_irg
(
op
);
ir_node
*
block
=
get_nodes_block
(
op
);
ir_node
*
zero
=
new_r_Const
(
irg
,
get_mode
_null
(
mode
)
)
;
ir_node
*
zero
=
new_r_Const_null
(
irg
,
mode
);
ir_node
*
cmp
=
new_r_Cmp
(
block
,
op
,
zero
,
ir_relation_less
);
ir_node
*
minus_op
=
new_r_Minus
(
block
,
op
,
mode
);
ir_node
*
mux
=
new_r_Mux
(
block
,
cmp
,
op
,
minus_op
,
mode
);
...
...
ir/opt/tailrec.c
View file @
f86e2456
...
...
@@ -245,7 +245,7 @@ static void do_opt_tail_rec(ir_graph *irg, tr_env *env)
modes
[
i
]
=
mode
;
if
(
env
->
variants
[
i
]
==
TR_ADD
)
{
set_r_value
(
irg
,
i
,
new_r_Const
(
irg
,
get_mode
_null
(
mode
))
)
;
set_r_value
(
irg
,
i
,
new_r_Const_null
(
irg
,
mode
));
}
else
if
(
env
->
variants
[
i
]
==
TR_MUL
)
{
set_r_value
(
irg
,
i
,
new_r_Const
(
irg
,
get_mode_one
(
mode
)));
}
...
...
ir/tr/entity.c
View file @
f86e2456
...
...
@@ -17,7 +17,7 @@
#include
"util.h"
#include
"irhooks.h"
#include
"irprog_t.h"
#include
"ircons.h"
#include
"ircons
_t
.h"
#include
"tv_t.h"
#include
"irdump.h"
#include
"irgraph_t.h"
...
...
@@ -453,7 +453,7 @@ ir_node *get_atomic_ent_value(const ir_entity *entity)
case
IR_INITIALIZER_NULL
:
{
ir_type
*
type
=
get_entity_type
(
entity
);
ir_mode
*
mode
=
get_type_mode
(
type
);
return
new_r_Const
(
get_const_code_irg
(),
get_mode_null
(
mode
)
);
return
new_r_Const
_null
(
get_const_code_irg
(),
mode
);
}
case
IR_INITIALIZER_TARVAL
:
{
ir_tarval
*
tv
=
get_initializer_tarval_value
(
initializer
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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