comparison src/share/vm/opto/domgraph.cpp @ 921:046932b72aa2

6862956: PhaseIdealLoop should have a CFG verification mode Reviewed-by: kvn, twisti
author never
date Fri, 14 Aug 2009 00:02:12 -0700
parents 98cb887364d3
children c18cbe5936b8
comparison
equal deleted inserted replaced
910:10d8c0d0d60e 921:046932b72aa2
1 /* 1 /*
2 * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved. 2 * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
394 //------------------------------Dominator-------------------------------------- 394 //------------------------------Dominator--------------------------------------
395 // Compute the dominator tree of the sea of nodes. This version walks all CFG 395 // Compute the dominator tree of the sea of nodes. This version walks all CFG
396 // nodes (using the is_CFG() call) and places them in a dominator tree. Thus, 396 // nodes (using the is_CFG() call) and places them in a dominator tree. Thus,
397 // it needs a count of the CFG nodes for the mapping table. This is the 397 // it needs a count of the CFG nodes for the mapping table. This is the
398 // Lengauer & Tarjan O(E-alpha(E,V)) algorithm. 398 // Lengauer & Tarjan O(E-alpha(E,V)) algorithm.
399 void PhaseIdealLoop::Dominators( ) { 399 void PhaseIdealLoop::Dominators() {
400 ResourceMark rm; 400 ResourceMark rm;
401 // Setup mappings from my Graph to Tarjan's stuff and back 401 // Setup mappings from my Graph to Tarjan's stuff and back
402 // Note: Tarjan uses 1-based arrays 402 // Note: Tarjan uses 1-based arrays
403 NTarjan *ntarjan = NEW_RESOURCE_ARRAY(NTarjan,C->unique()+1); 403 NTarjan *ntarjan = NEW_RESOURCE_ARRAY(NTarjan,C->unique()+1);
404 // Initialize _control field for fast reference 404 // Initialize _control field for fast reference
452 452
453 // Cleanup any unreachable loops now. Unreachable loops are loops that 453 // Cleanup any unreachable loops now. Unreachable loops are loops that
454 // flow into the main graph (and hence into ROOT) but are not reachable 454 // flow into the main graph (and hence into ROOT) but are not reachable
455 // from above. Such code is dead, but requires a global pass to detect 455 // from above. Such code is dead, but requires a global pass to detect
456 // it; this global pass was the 'build_loop_tree' pass run just prior. 456 // it; this global pass was the 'build_loop_tree' pass run just prior.
457 if( whead->is_Region() ) { 457 if( !_verify_only && whead->is_Region() ) {
458 for( uint i = 1; i < whead->req(); i++ ) { 458 for( uint i = 1; i < whead->req(); i++ ) {
459 if (!has_node(whead->in(i))) { 459 if (!has_node(whead->in(i))) {
460 // Kill dead input path 460 // Kill dead input path
461 assert( !visited.test(whead->in(i)->_idx), 461 assert( !visited.test(whead->in(i)->_idx),
462 "input with no loop must be dead" ); 462 "input with no loop must be dead" );