--- old/src/share/vm/opto/lcm.cpp Sat Jun 2 20:04:12 2012 +++ new/src/share/vm/opto/lcm.cpp Sat Jun 2 20:04:12 2012 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -445,6 +445,11 @@ if( e->is_MachNullCheck() && e->in(1) == n ) continue; + // Schedule IV increment last. + if (e->is_Mach() && e->as_Mach()->ideal_Opcode() == Op_CountedLoopEnd && + e->in(1)->in(1) == n && n->is_iteratively_computed()) + continue; + uint n_choice = 2; // See if this instruction is consumed by a branch. If so, then (as the