< prev index next >

src/share/vm/opto/loopnode.cpp

Print this page

        

@@ -1931,10 +1931,13 @@
     tty->print(" (%0.f iters) ", cl->profile_trip_cnt());
 
     if (cl->is_pre_loop ()) tty->print(" pre" );
     if (cl->is_main_loop()) tty->print(" main");
     if (cl->is_post_loop()) tty->print(" post");
+    if (cl->is_vectorized_loop()) tty->print(" vector");
+    if (cl->loop_has_range_checks()) tty->print(" rc ");
+    if (cl->loop_is_multiversioned()) tty->print(" multi ");
   }
   if (_has_call) tty->print(" has_call");
   if (_has_sfpt) tty->print(" has_sfpt");
   if (_rce_candidate) tty->print(" rce");
   if (_safepts != NULL && _safepts->size() > 0) {

@@ -2449,10 +2452,35 @@
     // SuperWord transform
     SuperWord sw(this);
     for (LoopTreeIterator iter(_ltree_root); !iter.done(); iter.next()) {
       IdealLoopTree* lpt = iter.current();
       if (lpt->is_counted()) {
+        CountedLoopNode *cl = lpt->_head->as_CountedLoop();
+
+        // Do a late range check detection
+        has_range_checks(lpt);
+
+        if (PostLoopMultiversioning) {
+          // Check that the rce'd post loop is encountered first, multiversion after all
+          // major main loop optimization are concluded
+          if (cl->is_post_loop() && !cl->loop_has_range_checks() && !C->major_progress()) {
+            IdealLoopTree *lpt_next = lpt->_next;
+            if (lpt_next && lpt_next->is_counted()) {
+              CountedLoopNode *cl = lpt_next->_head->as_CountedLoop();
+              has_range_checks(lpt_next);
+              if (cl->is_post_loop() && cl->loop_has_range_checks()) {
+                if (!cl->loop_is_multiversioned()) {
+                  if (multi_version_post_loops(lpt, lpt_next) == false) {
+                    // Cause the rce loop to be optimized away if we fail
+                    cl->mark_is_multiversioned();
+                    poison_rce_post_loop(lpt);
+                  }
+                }
+              }
+            }
+          }
+        }
         sw.transform_loop(lpt, true);
       }
     }
   }
 
< prev index next >