1 /* 2 * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 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 7 * published by the Free Software Foundation. 8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 * 23 */ 24 25 // Portions of code courtesy of Clifford Click 26 27 // Optimization - Graph Style 28 29 #include "incls/_precompiled.incl" 30 #include "incls/_domgraph.cpp.incl" 31 32 //------------------------------Tarjan----------------------------------------- 33 // A data structure that holds all the information needed to find dominators. 34 struct Tarjan { 35 Block *_block; // Basic block for this info 36 37 uint _semi; // Semi-dominators 38 uint _size; // Used for faster LINK and EVAL 39 Tarjan *_parent; // Parent in DFS 40 Tarjan *_label; // Used for LINK and EVAL 41 Tarjan *_ancestor; // Used for LINK and EVAL 42 Tarjan *_child; // Used for faster LINK and EVAL 43 Tarjan *_dom; // Parent in dominator tree (immediate dom) 44 Tarjan *_bucket; // Set of vertices with given semidominator 45 46 Tarjan *_dom_child; // Child in dominator tree 47 Tarjan *_dom_next; // Next in dominator tree 48 49 // Fast union-find work 50 void COMPRESS(); 51 Tarjan *EVAL(void); | 1 /* 2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 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 7 * published by the Free Software Foundation. 8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 * 23 */ 24 25 #include "precompiled.hpp" 26 #include "libadt/vectset.hpp" 27 #include "memory/allocation.hpp" 28 #include "opto/block.hpp" 29 #include "opto/machnode.hpp" 30 #include "opto/phaseX.hpp" 31 #include "opto/rootnode.hpp" 32 33 // Portions of code courtesy of Clifford Click 34 35 // Optimization - Graph Style 36 37 //------------------------------Tarjan----------------------------------------- 38 // A data structure that holds all the information needed to find dominators. 39 struct Tarjan { 40 Block *_block; // Basic block for this info 41 42 uint _semi; // Semi-dominators 43 uint _size; // Used for faster LINK and EVAL 44 Tarjan *_parent; // Parent in DFS 45 Tarjan *_label; // Used for LINK and EVAL 46 Tarjan *_ancestor; // Used for LINK and EVAL 47 Tarjan *_child; // Used for faster LINK and EVAL 48 Tarjan *_dom; // Parent in dominator tree (immediate dom) 49 Tarjan *_bucket; // Set of vertices with given semidominator 50 51 Tarjan *_dom_child; // Child in dominator tree 52 Tarjan *_dom_next; // Next in dominator tree 53 54 // Fast union-find work 55 void COMPRESS(); 56 Tarjan *EVAL(void); |