Mercurial > hg > graal-compiler
comparison src/share/vm/opto/loopPredicate.cpp @ 6144:5e990493719e
7173340: C2: code cleanup: use PhaseIterGVN::replace_edge(Node*, int, Node*) where applicable
Summary: replace frequent C2 optimizer code patterns with new methods calls
Reviewed-by: kvn, twisti
Contributed-by: vladimir.x.ivanov@oracle.com
author | kvn |
---|---|
date | Tue, 12 Jun 2012 16:23:31 -0700 |
parents | 6987871cfb9b |
children | e626685e9f6c |
comparison
equal
deleted
inserted
replaced
6143:8b0a4867acf0 | 6144:5e990493719e |
---|---|
210 bool has_phi = false; | 210 bool has_phi = false; |
211 for (DUIterator_Fast imax, i = rgn->fast_outs(imax); i < imax; i++) { | 211 for (DUIterator_Fast imax, i = rgn->fast_outs(imax); i < imax; i++) { |
212 Node* use = rgn->fast_out(i); | 212 Node* use = rgn->fast_out(i); |
213 if (use->is_Phi() && use->outcnt() > 0) { | 213 if (use->is_Phi() && use->outcnt() > 0) { |
214 assert(use->in(0) == rgn, ""); | 214 assert(use->in(0) == rgn, ""); |
215 _igvn.hash_delete(use); | 215 _igvn.rehash_node_delayed(use); |
216 use->add_req(use->in(proj_index)); | 216 use->add_req(use->in(proj_index)); |
217 _igvn._worklist.push(use); | |
218 has_phi = true; | 217 has_phi = true; |
219 } | 218 } |
220 } | 219 } |
221 assert(!has_phi || rgn->req() > 3, "no phis when region is created"); | 220 assert(!has_phi || rgn->req() > 3, "no phis when region is created"); |
222 | 221 |
282 assert(rgn->in(rgn->req() -1) == if_uct, "new edge should be last"); | 281 assert(rgn->in(rgn->req() -1) == if_uct, "new edge should be last"); |
283 bool has_phi = false; | 282 bool has_phi = false; |
284 for (DUIterator_Fast imax, i = rgn->fast_outs(imax); i < imax; i++) { | 283 for (DUIterator_Fast imax, i = rgn->fast_outs(imax); i < imax; i++) { |
285 Node* use = rgn->fast_out(i); | 284 Node* use = rgn->fast_out(i); |
286 if (use->is_Phi() && use->outcnt() > 0) { | 285 if (use->is_Phi() && use->outcnt() > 0) { |
287 hash_delete(use); | 286 rehash_node_delayed(use); |
288 use->add_req(use->in(proj_index)); | 287 use->add_req(use->in(proj_index)); |
289 _worklist.push(use); | |
290 has_phi = true; | 288 has_phi = true; |
291 } | 289 } |
292 } | 290 } |
293 assert(!has_phi || rgn->req() > 3, "no phis when region is created"); | 291 assert(!has_phi || rgn->req() > 3, "no phis when region is created"); |
294 | 292 |