projects
/
libfirm
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c0a86bf
)
Local opt: -1 - x -> ~x.
author
Christoph Mallon
<christoph.mallon@gmx.de>
Thu, 14 Aug 2008 09:37:18 +0000
(09:37 +0000)
committer
Christoph Mallon
<christoph.mallon@gmx.de>
Thu, 14 Aug 2008 09:37:18 +0000
(09:37 +0000)
[r21159]
ir/ir/iropt.c
patch
|
blob
|
history
diff --git
a/ir/ir/iropt.c
b/ir/ir/iropt.c
index
85c5270
..
03d03d4
100644
(file)
--- a/
ir/ir/iropt.c
+++ b/
ir/ir/iropt.c
@@
-2321,6
+2321,15
@@
static ir_node *transform_node_Sub(ir_node *n) {
dbg_info *dbg = get_irn_dbg_info(n);
return new_rd_Conv(dbg, current_ir_graph, get_nodes_block(n), a, mode);
}
dbg_info *dbg = get_irn_dbg_info(n);
return new_rd_Conv(dbg, current_ir_graph, get_nodes_block(n), a, mode);
}
+
+ if (mode == lmode &&
+ get_mode_arithmetic(mode) == irma_twos_complement &&
+ is_Const(a) &&
+ get_Const_tarval(a) == get_mode_minus_one(mode)) {
+ /* -1 - x -> ~x */
+ dbg_info *dbg = get_irn_dbg_info(n);
+ return new_rd_Not(dbg, current_ir_graph, get_nodes_block(n), b, mode);
+ }
}
restart:
}
restart: