projects
/
libfirm
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c15abf9
)
cmov with unknowns are pointless
author
Matthias Braun
<matze@braunis.de>
Wed, 4 Jul 2007 12:13:51 +0000
(12:13 +0000)
committer
Matthias Braun
<matze@braunis.de>
Wed, 4 Jul 2007 12:13:51 +0000
(12:13 +0000)
[r14925]
ir/be/ia32/ia32_transform.c
patch
|
blob
|
history
diff --git
a/ir/be/ia32/ia32_transform.c
b/ir/be/ia32/ia32_transform.c
index
b48bbbe
..
584417c
100644
(file)
--- a/
ir/be/ia32/ia32_transform.c
+++ b/
ir/be/ia32/ia32_transform.c
@@
-1892,6
+1892,20
@@
static ir_node *create_cmov(long pnc, ir_node *cmp_left, ir_node *cmp_right,
ir_node *new_cmp_right;
ir_node *res;
ir_node *new_cmp_right;
ir_node *res;
+ /* cmovs with unknowns are pointless... */
+ if(is_Unknown(val_true)) {
+#ifdef DEBUG_libfirm
+ ir_fprintf(stderr, "Optimisation warning: psi with unknown operand\n");
+#endif
+ return new_val_false;
+ }
+ if(is_Unknown(val_false)) {
+#ifdef DEBUG_libfirm
+ ir_fprintf(stderr, "Optimisation warning: psi with unknown operand\n");
+#endif
+ return new_val_true;
+ }
+
/* can we use a test instruction? */
if(is_Const_0(cmp_right)) {
long pure_pnc = pnc & ~ia32_pn_Cmp_Unsigned;
/* can we use a test instruction? */
if(is_Const_0(cmp_right)) {
long pure_pnc = pnc & ~ia32_pn_Cmp_Unsigned;