diff src/share/vm/opto/loopTransform.cpp @ 2417:cb162b348743

7032696: Fix for 7029152 broke VM Summary: StrIntrinsicNode::Ideal() should not optimize memory during Parse. Reviewed-by: jrose, never
author kvn
date Thu, 31 Mar 2011 13:22:34 -0700
parents f9424955eb18
children 1d1603768966 08eb13460b3a
line wrap: on
line diff
--- a/src/share/vm/opto/loopTransform.cpp	Thu Mar 31 02:31:57 2011 -0700
+++ b/src/share/vm/opto/loopTransform.cpp	Thu Mar 31 13:22:34 2011 -0700
@@ -432,6 +432,12 @@
     return false;
   }
 
+  // Currently we don't have policy to optimize one iteration loops.
+  // Maximally unrolling transformation is used for that:
+  // it is peeled and the original loop become non reachable (dead).
+  if (trip_count == 1)
+    return true;
+
   // Do not unroll a loop with String intrinsics code.
   // String intrinsics are large and have loops.
   for (uint k = 0; k < _body.size(); k++) {