projects
/
libfirm
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix comments.
[libfirm]
/
ir
/
ir
/
iropt.c
diff --git
a/ir/ir/iropt.c
b/ir/ir/iropt.c
index
b4cf9fb
..
2bfb87c
100644
(file)
--- a/
ir/ir/iropt.c
+++ b/
ir/ir/iropt.c
@@
-1259,11
+1259,10
@@
restart:
}
}
}
}
}
}
- if (get_mode_arithmetic(n_mode) == irma_twos_complement &&
- get_mode_arithmetic(a_mode) == irma_ieee754) {
+ if (mode_is_int(n_mode) && get_mode_arithmetic(a_mode) == irma_ieee754) {
/* ConvI(ConvF(I)) -> I, iff float mantissa >= int mode */
/* ConvI(ConvF(I)) -> I, iff float mantissa >= int mode */
-
size_t int_mantissa
= get_mode_size_bits(n_mode) - (mode_is_signed(n_mode) ? 1 : 0);
-
size_t
float_mantissa = tarval_ieee754_get_mantissa_size(a_mode);
+
unsigned int_mantissa
= get_mode_size_bits(n_mode) - (mode_is_signed(n_mode) ? 1 : 0);
+
unsigned
float_mantissa = tarval_ieee754_get_mantissa_size(a_mode);
if (float_mantissa >= int_mantissa) {
n = b;
if (float_mantissa >= int_mantissa) {
n = b;
@@
-1863,10
+1862,11
@@
static int is_const_Phi(ir_node *n) {
if (! is_Phi(n) || get_irn_arity(n) == 0)
return 0;
if (! is_Phi(n) || get_irn_arity(n) == 0)
return 0;
- for (i = get_irn_arity(n) - 1; i >= 0; --i)
+ for (i = get_irn_arity(n) - 1; i >= 0; --i)
{
if (! is_Const(get_irn_n(n, i)))
return 0;
if (! is_Const(get_irn_n(n, i)))
return 0;
- return 1;
+ }
+ return 1;
} /* is_const_Phi */
typedef tarval *(*tarval_sub_type)(tarval *a, tarval *b, ir_mode *mode);
} /* is_const_Phi */
typedef tarval *(*tarval_sub_type)(tarval *a, tarval *b, ir_mode *mode);
@@
-4341,7
+4341,7
@@
static ir_node *transform_node_Proj_Cmp(ir_node *proj) {
else if (proj_nr == pn_Cmp_Le || proj_nr == pn_Cmp_Lt) {
if (tv != tarval_bad) {
/* c >= 0 : Abs(a) <= c ==> (unsigned)(a + c) <= 2*c */
else if (proj_nr == pn_Cmp_Le || proj_nr == pn_Cmp_Lt) {
if (tv != tarval_bad) {
/* c >= 0 : Abs(a) <= c ==> (unsigned)(a + c) <= 2*c */
- if (
get_irn_op(left) == op_Abs
) { // TODO something is missing here
+ if (
is_Abs(left)
) { // TODO something is missing here
}
}
}
}
}
}
@@
-5280,7
+5280,11
@@
static ir_node *transform_node_Conv(ir_node *n) {
ir_node *c, *oldn = n;
ir_node *a = get_Conv_op(n);
ir_node *c, *oldn = n;
ir_node *a = get_Conv_op(n);
- if (is_const_Phi(a)) {
+ if (get_irn_mode(n) != mode_b && is_const_Phi(a)) {
+ /* Do NOT optimize mode_b Conv's, this leads to remaining
+ * Phib nodes later, because the conv_b_lower operation
+ * is instantly reverted, when it tries to insert a Convb.
+ */
c = apply_conv_on_phi(a, get_irn_mode(n));
if (c) {
DBG_OPT_ALGSIM0(oldn, c, FS_OPT_CONST_PHI);
c = apply_conv_on_phi(a, get_irn_mode(n));
if (c) {
DBG_OPT_ALGSIM0(oldn, c, FS_OPT_CONST_PHI);
@@
-5316,9
+5320,7
@@
static ir_node *transform_node_End(ir_node *n) {
} else if (is_irn_pinned_in_irg(ka) && is_Block_dead(get_nodes_block(ka))) {
continue;
}
} else if (is_irn_pinned_in_irg(ka) && is_Block_dead(get_nodes_block(ka))) {
continue;
}
- /* FIXME: beabi need to keep a Proj(M) */
- if (is_Phi(ka) || is_irn_keep(ka) || is_Proj(ka))
- in[j++] = ka;
+ in[j++] = ka;
}
if (j != n_keepalives)
set_End_keepalives(n, j, in);
}
if (j != n_keepalives)
set_End_keepalives(n, j, in);