diff src/share/vm/adlc/output_c.cpp @ 785:2056494941db

6814842: Load shortening optimizations Summary: 6797305 handles load widening but no shortening which should be covered here. Reviewed-by: never, kvn
author twisti
date Wed, 13 May 2009 00:45:22 -0700
parents 337400e7a5dd
children 844a9d73ec22
line wrap: on
line diff
--- a/src/share/vm/adlc/output_c.cpp	Mon May 11 18:30:13 2009 -0700
+++ b/src/share/vm/adlc/output_c.cpp	Wed May 13 00:45:22 2009 -0700
@@ -1745,6 +1745,7 @@
       fprintf(fp,"    del_req(i);\n");
       fprintf(fp,"  }\n");
       fprintf(fp,"  _num_opnds = %d;\n", new_num_opnds);
+      assert(new_num_opnds == node->num_unique_opnds(), "what?");
     }
   }
 
@@ -3761,6 +3762,12 @@
     if ( this->captures_bottom_type() ) {
       fprintf(fp_cpp, "  node->_bottom_type = bottom_type();\n");
     }
+
+    uint cur_num_opnds = num_opnds();
+    if (cur_num_opnds > 1 && cur_num_opnds != num_unique_opnds()) {
+      fprintf(fp_cpp,"  node->_num_opnds = %d;\n", num_unique_opnds());
+    }
+
     fprintf(fp_cpp, "\n");
     fprintf(fp_cpp, "  // Copy _idx, inputs and operands to new node\n");
     fprintf(fp_cpp, "  fill_new_machnode(node, C);\n");