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 //-*-C++-*- 00029 00030 //============================================================================= 00031 //============================================================================= 00032 // 00033 // Module: speculation.h 00034 // $Date: 2005/10/21 19:00:00 $ 00035 // $Author: marcel $ 00036 // $Source: /proj/osprey/CVS/open64/osprey1.0/be/cg/orc_intel/speculation.h,v $ 00037 // 00038 // Description: 00039 // ============ 00040 // 00041 // Interface to Aurora Control and Date speculation. 00042 // 00043 //============================================================================= 00044 //============================================================================= 00045 00046 //============================================================================= 00047 // Change_ld_Form 00048 // - Convert a pure ld to ld.s,ld.a,ld.sa . 00049 // 00050 // TN_is_GFP 00051 // - Decide whether the tn is GR, FR, or PR. 00052 //============================================================================= 00053 00054 00055 #ifndef speculation_INCLUDED 00056 #define speculation_INCLUDED 00057 00058 #include <vector> 00059 #include <utility> 00060 #include "op_list.h" 00061 #include "cg_dep_graph.h" 00062 #include "region.h" 00063 00064 struct compare_node 00065 { 00066 bool operator()(const REGIONAL_CFG_NODE* n1, const REGIONAL_CFG_NODE* n2) const 00067 { 00068 INT32 id1 = n1->Id(); 00069 INT32 id2 = n2->Id(); 00070 00071 return ( id1 < id2 ); 00072 } 00073 }; 00074 00075 struct compare_tn 00076 { 00077 bool operator()(const TN* tn1, const TN* tn2) const 00078 { 00079 mTN_NUM num1 = TN_number(tn1); 00080 mTN_NUM num2 = TN_number(tn2); 00081 00082 return (num1 < num2); 00083 } 00084 }; 00085 00086 struct compare_op 00087 { 00088 bool operator()(const OP* op1, const OP* op2 ) const 00089 { 00090 mBB_NUM id1 = BB_id(OP_bb(op1)); 00091 mBB_NUM id2 = BB_id(OP_bb(op2)); 00092 mTN_NUM num1 = OP_map_idx(op1); 00093 mTN_NUM num2 = OP_map_idx(op2); 00094 00095 if(id1 == id2){ 00096 return (num1 < num2); 00097 } 00098 return id1<id2; 00099 } 00100 }; 00101 00102 extern std::vector< std::pair<OP*,OP*> > load_chk_pairs; 00103 extern OP* Local_Insert_CHK(OP *spec_ld, OP *point, TN *pr_tn = True_TN); 00104 extern OP* Insert_CHK(OP* primary_ld, std::vector<OP *>& copys, BB* home_bb, OP* pos, TN* pr_tn); 00105 extern BOOL OP_baneful(OP* op); 00106 extern OP *Change_ld_Form(OP *load_op, ISA_ENUM_CLASS_VALUE target_form); 00107 extern BOOL Is_Control_Speculation_Gratuitous(OP*, BB*, OP*); 00108 extern void Delete_Recovery_Info_For_BB(BB *bb); 00109 extern void Set_Speculative_Chain_Begin_Point(OP*, OP*); 00110 extern BOOL BB_Hold_Disjoint_Speculative_Code(BB*); 00111 00112 // ===== (<%pr%p6>) <r7>=<ldtype>,<ldhint>,[<%bs%r7>] ===== 00113 // Instruction_Group("O_108", TOP_ld1, TOP_ld2, TOP_ld4, TOP_ld8, TOP_UNDEFINED); 00114 // Operand(0, pr, predicate); 00115 // Result(0, int64); 00116 // Operand(1, ldtype); 00117 // Operand(2, ldhint); 00118 // Operand(3, int64, base); 00119 #define enum_ldtype_pos 1 00120 00121 00122 inline BOOL 00123 TN_is_GFP(TN *tn) 00124 { 00125 00126 if(!TN_is_register(tn)) 00127 return FALSE; 00128 00129 ISA_REGISTER_CLASS rc = TN_register_class(tn); 00130 if( rc == ISA_REGISTER_CLASS_integer || 00131 rc == ISA_REGISTER_CLASS_float || 00132 rc == ISA_REGISTER_CLASS_predicate ) return TRUE; 00133 00134 return FALSE; 00135 } 00136 00137 #endif
1.5.6