- improved hash_Const(): no need to hash the mode, this is already contained in the...
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Sat, 18 Apr 2009 19:07:57 +0000 (19:07 +0000)
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Sat, 18 Apr 2009 19:07:57 +0000 (19:07 +0000)
- improved hash_SymConst(): no need for mode, handle labels right

[r25826]

ir/ir/iropt.c

index 25d0cd8..f225d25 100644 (file)
@@ -6667,7 +6667,6 @@ static unsigned hash_Const(const ir_node *node) {
 
        /* special value for const, as they only differ in their tarval. */
        h = HASH_PTR(node->attr.con.tv);
-       h = 9*h + HASH_PTR(get_irn_mode(node));
 
        return h;
 }  /* hash_Const */
@@ -6679,8 +6678,12 @@ static unsigned hash_SymConst(const ir_node *node) {
        unsigned h;
 
        /* special value for const, as they only differ in their symbol. */
-       h = HASH_PTR(node->attr.symc.sym.type_p);
-       h = 9*h + HASH_PTR(get_irn_mode(node));
+       if (node->attr.symc.kind == symconst_label)
+               h = (unsigned)node->attr.symc.sym.label;
+       else {
+               /* all others are pointers */
+               h = HASH_PTR(node->attr.symc.sym.type_p);
+       }
 
        return h;
 }  /* hash_SymConst */