00001 /* 00002 * Copyright (C) 2000-2003, Intel Corporation 00003 * All rights reserved. 00004 * 00005 * Redistribution and use in source and binary forms, with or without modification, 00006 * are permitted provided that the following conditions are met: 00007 * 00008 * Redistributions of source code must retain the above copyright notice, this list 00009 * of conditions and the following disclaimer. 00010 * 00011 * Redistributions in binary form must reproduce the above copyright notice, this list 00012 * of conditions and the following disclaimer in the documentation and/or other materials 00013 * provided with the distribution. 00014 * 00015 * Neither the name of the owner nor the names of its contributors may be used to endorse or 00016 * promote products derived from this software without specific prior written permission. 00017 * 00018 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR 00019 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 00020 * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR 00021 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 00022 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 00023 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 00024 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 00025 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00026 * 00027 */ 00028 00029 /* ========================================================================= 00030 * ========================================================================= 00031 * 00032 * Module: sched_seq.h 00033 * $Revision: 1.1.1.1 $ 00034 * $Date: 2005/10/21 19:00:00 $ 00035 * $Author: marcel $ 00036 * $Source: /proj/osprey/CVS/open64/osprey1.0/be/cg/orc_intel/sched_seq.h,v $ 00037 * 00038 * Revision comments: 00039 * 00040 * 28-July-2002 - initial version 00041 * 00042 * Description: 00043 * ============ 00044 * 00045 * ========================================================================== 00046 * ========================================================================== 00047 */ 00048 00049 #ifndef sched_seq_INCLUDED 00050 #define sched_seq_INCLUDED 00051 00052 #include "sched_util.h" 00053 00054 00055 /* ======================================================== 00056 * ======================================================== 00057 * 00058 * Declairation of SCHED_SEQ (base class 00059 * 00060 * ======================================================== 00061 * ======================================================== 00062 */ 00063 class SCHED_SEQ { 00064 00065 protected: 00066 00067 BOOL Qualified (REGIONAL_CFG_NODE *) ; 00068 00069 NODE_VECTOR _candidates; 00070 REGION* _rgn ; 00071 BB* _cur ; 00072 00073 MEM_POOL* _mp; 00074 00075 BOOL Node1_Is_Sparser (REGIONAL_CFG_NODE*, REGIONAL_CFG_NODE *); 00076 00077 public: 00078 00079 SCHED_SEQ (REGION *, MEM_POOL*) ; 00080 ~SCHED_SEQ (void) {} ; 00081 00082 BB* First (void) { return NULL; } 00083 BB* Next (void) { return NULL; } 00084 BB* Cur (void) { Is_True (_cur, ("no CURRENT BB node!")) ; return _cur ; } 00085 }; 00086 00087 00088 /* ========================================================== 00089 * ========================================================== 00090 * 00091 * declaition of TOPDOWN_SCHED_SEQ 00092 * 00093 * ========================================================== 00094 * ========================================================== 00095 */ 00096 class TOPDOWN_SCHED_SEQ : public SCHED_SEQ { 00097 private: 00098 00099 class NODE_INFO { public: INT32 _n_pred; NODE_INFO() {_n_pred = 0;} }; 00100 typedef mempool_allocator<std::pair<REGIONAL_CFG_NODE*,NODE_INFO> > 00101 NODE_INFO_ALLOC; 00102 template <class _Ptr_Tp> 00103 struct ptr_hash { 00104 size_t operator()(_Ptr_Tp __x) const { return UINT(INTPTR(__x)); } 00105 }; 00106 00107 typedef __gnu_cxx::hash_map<REGIONAL_CFG_NODE*, NODE_INFO, 00108 ptr_hash<REGIONAL_CFG_NODE*>, 00109 std::equal_to<REGIONAL_CFG_NODE*>, NODE_INFO_ALLOC> 00110 NODE_INFO_MAP; 00111 00112 REGIONAL_CFG_NODE * next_node (void) ; 00113 00114 /* _node_info_map: f: rgn_node -> <has-not-sched-pred-num> 00115 */ 00116 NODE_INFO_MAP _node_info_map; 00117 00118 public: 00119 00120 TOPDOWN_SCHED_SEQ (REGION *, MEM_POOL*) ; 00121 ~TOPDOWN_SCHED_SEQ (void) {} ; 00122 00123 BB* First (void) ; 00124 BB* Next (void) ; 00125 }; 00126 00127 /* ============================================================= 00128 * ============================================================= 00129 * 00130 * Declaition of DEEPDOWN_SCHED_SEQ 00131 * 00132 * ============================================================ 00133 * =========================================================== 00134 */ 00135 class DEEPDOWN_SCHED_SEQ : public SCHED_SEQ { 00136 private: 00137 void Delete_And_Push_Succ (REGIONAL_CFG_NODE*); 00138 00139 public: 00140 DEEPDOWN_SCHED_SEQ (REGION* , MEM_POOL*); 00141 ~DEEPDOWN_SCHED_SEQ (void) {} ; 00142 00143 BB* First (void); 00144 BB* Next (void); 00145 }; 00146 00147 #endif /* sched_seq_INCLUDED */
1.5.6