From fd523ce046fb8b368b8b3dba6ec33007ad833fc1 Mon Sep 17 00:00:00 2001 From: cfang Date: Thu, 28 May 2009 09:37:18 -0700 Subject: [PATCH] 6837146: Should perform unswitch before maximally unroll in loop transformation Summary: Move loop unswitch before maximally unroll Reviewed-by: never --- src/share/vm/opto/loopTransform.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/share/vm/opto/loopTransform.cpp b/src/share/vm/opto/loopTransform.cpp index 4ff59d9d4..d315a9e6c 100644 --- a/src/share/vm/opto/loopTransform.cpp +++ b/src/share/vm/opto/loopTransform.cpp @@ -1630,6 +1630,10 @@ bool IdealLoopTree::iteration_split_impl( PhaseIdealLoop *phase, Node_List &old_ // Before attempting fancy unrolling, RCE or alignment, see if we want // to completely unroll this loop or do loop unswitching. if( cl->is_normal_loop() ) { + if (should_unswitch) { + phase->do_unswitching(this, old_new); + return true; + } bool should_maximally_unroll = policy_maximally_unroll(phase); if( should_maximally_unroll ) { // Here we did some unrolling and peeling. Eventually we will @@ -1637,10 +1641,6 @@ bool IdealLoopTree::iteration_split_impl( PhaseIdealLoop *phase, Node_List &old_ phase->do_maximally_unroll(this,old_new); return true; } - if (should_unswitch) { - phase->do_unswitching(this, old_new); - return true; - } } -- GitLab