comparison src/share/vm/opto/loopUnswitch.cpp @ 2383:9dc311b8473e

7008866: Missing loop predicate for loop with multiple entries Summary: Add predicates when loop head bytecode is parsed instead of when back branch bytecode is parsed. Reviewed-by: never
author kvn
date Mon, 21 Mar 2011 11:28:14 -0700
parents f95d63e2154a
children 1d1603768966 08eb13460b3a
comparison
equal deleted inserted replaced
2382:3ef1a1866a60 2383:9dc311b8473e
107 // Find first invariant test that doesn't exit the loop 107 // Find first invariant test that doesn't exit the loop
108 LoopNode *head = loop->_head->as_Loop(); 108 LoopNode *head = loop->_head->as_Loop();
109 109
110 IfNode* unswitch_iff = find_unswitching_candidate((const IdealLoopTree *)loop); 110 IfNode* unswitch_iff = find_unswitching_candidate((const IdealLoopTree *)loop);
111 assert(unswitch_iff != NULL, "should be at least one"); 111 assert(unswitch_iff != NULL, "should be at least one");
112
113 #ifndef PRODUCT
114 if (TraceLoopOpts) {
115 tty->print("Unswitch %d ", head->unswitch_count()+1);
116 loop->dump_head();
117 }
118 #endif
112 119
113 // Need to revert back to normal loop 120 // Need to revert back to normal loop
114 if (head->is_CountedLoop() && !head->as_CountedLoop()->is_normal_loop()) { 121 if (head->is_CountedLoop() && !head->as_CountedLoop()->is_normal_loop()) {
115 head->as_CountedLoop()->set_normal_loop(); 122 head->as_CountedLoop()->set_normal_loop();
116 } 123 }