hotspot/src/share/vm/opto/loopTransform.cpp
changeset 8884 9e2b81253ef9
parent 8879 e6ae9a7aa72a
child 9101 ff58f9a8e31c
child 8921 14bfe81f2a9d
--- a/hotspot/src/share/vm/opto/loopTransform.cpp	Thu Mar 31 02:31:57 2011 -0700
+++ b/hotspot/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++) {