iropt: use Confirm info for Cmp-relations
authorMatthias Braun <matze@braunis.de>
Fri, 11 Nov 2011 17:08:29 +0000 (18:08 +0100)
committerMatthias Braun <matze@braunis.de>
Mon, 14 Nov 2011 10:15:16 +0000 (11:15 +0100)
ir/ir/iropt.c

index eaa0046..20ca9b1 100644 (file)
@@ -587,6 +587,15 @@ ir_relation ir_get_possible_cmp_relations(const ir_node *left,
        /* Alloc nodes never return null (but throw an exception) */
        if (is_Alloc(left) && tarval_is_null(tv_r))
                possible &= ~ir_relation_equal;
+       /* stuff known through confirm nodes */
+       if (is_Confirm(left) && get_Confirm_bound(left) == right) {
+               possible &= get_Confirm_relation(left);
+       }
+       if (is_Confirm(right) && get_Confirm_bound(right) == left) {
+               ir_relation relation = get_Confirm_relation(right);
+               relation = get_inversed_relation(relation);
+               possible &= relation;
+       }
 
        return possible;
 }