move all constlike nodes to right for Cmps
authorMatthias Braun <matze@braunis.de>
Thu, 11 Oct 2007 15:07:03 +0000 (15:07 +0000)
committerMatthias Braun <matze@braunis.de>
Thu, 11 Oct 2007 15:07:03 +0000 (15:07 +0000)
[r16150]

ir/ir/iropt.c

index b98c922..30551dc 100644 (file)
@@ -3657,10 +3657,12 @@ static ir_node *transform_node_Proj_Cmp(ir_node *proj) {
         */
        if (is_Const(right)) {
                c = right;
-       } else if (is_Const(left)) {
+       } else if (is_irn_constlike(left)) {
                c     = left;
                left  = right;
                right = c;
+               if(!is_Const(c))
+                       c = NULL;
 
                proj_nr = get_inversed_pnc(proj_nr);
                changed |= 1;