#include "defs.h"#include "opcode_core.h"#include "errors.h"#include "opcode_gen.h"


Go to the source code of this file.
Defines | |
| #define | opcode_INCLUDED "opcode.h" |
| #define | OPCODE_make_op_MACRO(opr, rtype, desc) ((OPCODE) ((opr) | ((rtype) << 8) | ((desc) << 14))) |
Functions/Subroutines | |
| const char * | OPERATOR_name (OPERATOR) |
| OPCODE | OPCODE_commutative_op (OPCODE op) |
| void | Init_Operator_To_Opcode_Table (void) |
| OPCODE | OPCODE_make_op (OPERATOR opr, TYPE_ID rtype, TYPE_ID desc) |
Variables | |
| BOOL | Operator_To_Opcode_Table_Inited |
| #define opcode_INCLUDED "opcode.h" |
Opcodes, Opcode Types, and Opcode Flags ---------------------------------------
Description:
This file includes opcode_core.h (see the interface there) and provides some accessing functions to the data. It is split like this because the accessors call FmtAssert() and other routines that non-compiler passes might want to avoid.
This file should be updated whenever opcode_gen is updated. opcode_gen is a perl file that is somewhat readable -- if the comments get out of date here, one can always look there (and bring them up to date).
Exported Functions:
OPCODE OPCODE_make_op( OPERATOR opr, TYPE_ID rtype, TYPE_ID desc )
Given the operator, rtype and desc type, return the opcode. The opr, rtype and desc MUST map to a valid OPCODE. Otherwise, the compilation terminates with an internal error.
const char *OPCODE_name(OPCODE op)
Returns a string representation of the opcode.
const char *OPERATOR_name(OPERATOR opr)
Returns a string representation of the operator.
The remaining exported functions are actually not declared in this file but in the automatically generated include files.
mINT8 OPCODE_nkids(OPCODE op)
Returns the number of kids this opcode must have, or -1 if not fixed, i.e. call, array, return.
The following exported functions return 0 if the opcode does not have the stated property. Otherwise, the value returned is non-zero.
UINT32 OPCODE_is_scf(OPCODE op)
Opcode is OPR_FUNC_ENTRY, OPR_BLOCK, OPR_DO_LOOP, OPR_DO_WHILE, OPR_WHILE_DO, OPR_IF.
UINT32 OPCODE_is_stmt(OPCODE op)
Opcode occurs at top of an expression tree, e.g. a store, call, goto, pragma, etc. No structured control flow falls in this category.
UINT32 OPCODE_is_expression(OPCODE op)
Opcode occurs underneath a statement, e.g. OPR_DADD.
UINT32 OPCODE_is_leaf(OPCODE op)
Opcode is an expression or statement that never has children. Note that OPR_RETURN is not a leaf, since it may have children.
UINT32 OPCODE_is_load(OPCODE op) UINT32 OPCODE_is_store(OPCODE op)
Opocde gets memory, e.g. ILOAD, MLOAD, LDID, etc (or store) Goto, branch, label, altentry
UINT32 OPCODE_is_call(OPCODE op)
Intrinsic call or regular, but not an intrinsic op.
UINT32 OPCODE_is_compare(OPCODE op)
Comparison, e.g. GE
UINT32 OPCODE_is_non_scf(OPCODE op)
Opcode directly relates to control flow, but is not structured. Goto, branch, label, altentry
UINT32 OPCODE_is_boolean(OPCODE op)
Boolean return value, e.g. a comparison.
UINT32 OPCODE_is_endsbb(OPCODE op)
Call, a goto, branch, call, return.
UINT32 OPCODE_is_comp_unit_if(OPCODE op)
Compilation unit interface, e.g. REGION
UINT32 OPCODE_is_not_executable(OPCODE op)
Currently PRAGMA, COMMENT, LABEL and OPT_ opcodes.
UINT32 OPCODE_is_prefetcn(OPCODE op)
Obvious.
OPCODE OPCODE_commutative_op(OPCODE op)
Return an opcode op1 such that x op y is y op1 x. If none exists, return (OPCODE) 0.
The following exported functions describe qualities of the WN that has this opcode. E.g. OPCODE_has_sym(op) indicates that a WN holding this opcode also holds an ST_IDX.
UINT32 OPCODE_has_next_prev(OPCODE op) UINT32 OPCODE_has_sym(OPCODE op) UINT32 OPCODE_has_label(OPCODE op) UINT32 OPCODE_has_num_entries(OPCODE op) UINT32 OPCODE_has_offset(OPCODE op) UINT32 OPCODE_has_bits(OPCODE op) UINT32 OPCODE_has_ndim(OPCODE op) UINT32 OPCODE_has_esize(OPCODE op) UINT32 OPCODE_has_value(OPCODE op) UINT32 OPCODE_has_flags(OPCODE op) UINT32 OPCODE_has_inumber(OPCODE op) UINT32 OPCODE_has_1ty(OPCODE op) UINT32 OPCODE_has_2ty(OPCODE op)
The 'has' fields indicate which fields of a WN are used.
OPCODE_MAPCAT OPCODE_mapcat(OPCODE op)
Annotation category of an opcode. Current values are OPCODE_MAPCAT_{HDR,SCF,LDST,PRAGMA,OSTMT,OEXP,ARRAY,CALL}.
| #define OPCODE_make_op_MACRO | ( | opr, | |||
| rtype, | |||||
| desc | ) | ((OPCODE) ((opr) | ((rtype) << 8) | ((desc) << 14))) |
Definition at line 69 of file opcode.cxx.
Definition at line 85 of file opcode.cxx.
Definition at line 231 of file opcode.h.
References Is_True, Is_Valid_Opcode, OPCODE_make_op_MACRO, and ret.
Referenced by VN_BINARY_EXPR::_canonicalize(), VN_BINARY_EXPR::_fold_2literals(), VN_IVC::_get_literal_diff(), VALNUM_FRE::_ivc_insert_initval_diff(), VALNUM_FRE::_ivc_substitute(), Add_Condition(), CODEMAP::Add_const(), CODEMAP::Add_expr(), Add_To_Symbol(), Apply_Back_Sub_Variant(), GVN::Apply_cr(), arrsection_to_array(), Atomic_Direct(), Atomic_Using_Swap(), AWN_Binary(), AWN_StidIntoSym(), BND_Max_Expr(), BND_Min_Expr(), Calculate_Array_Size(), cancel_in_relop(), CODEMAP::Canon_add_sub(), CODEMAP::Canon_base(), CANON_EXPR::Canon_expr(), CODEMAP::Canon_rhs(), canonicalize_if_condition(), Cast_Float_Operands(), CG_Instrument_Arcs(), CGSPILL_Attach_Const_Remat(), CGSPILL_Attach_Lda_Remat(), IVR::Choose_primary_IV(), DISTR_DIM::Chunksize(), Combine_div_operator(), Combine_minmax_operator(), Combine_rem_operator(), IVR::Compute_trip_count(), CANON_CR::Convert2cr(), IVR::Convert_all_ivs(), Convert_Alloca_To_Intrinsic(), Convert_Dealloca_To_Intrinsic(), Convert_Do_Loops_Conditionals(), DISTR_ARRAY::Convert_Expr_To_Symbol(), Convert_Le_With_Floor_2Lt(), OPT_STAB::Convert_ST_to_AUX(), convert_to_reference(), CODEREP::Convert_type(), Copy_Array(), Copy_Array_Section(), Copy_Loads_In_Bound(), OPT_STAB::Count_syms(), CR_opcode(), Create_array(), Create_Array_Load(), Create_Array_Store(), OPT_MTYPE_B::Create_BCVT(), Create_Binary_Opr(), OPT_REVISE_SSA::Create_COMPOSE_BITS(), CODEREP::Create_cpstmt(), create_doloop(), OPT_STAB::Create_entry_chi_stmt(), OPT_REVISE_SSA::Create_EXTRACT_BITS(), Create_identity_assignment(), Create_Initialize_Loop(), Create_Io_Entry(), CODEREP::Create_istr_stmt(), RVI_NODE::Create_load(), ARA_LOOP_INFO::Create_New_IF_Clause(), ARA_LOOP_INFO::Create_Old_IF_Clause(), Create_Shackle_If_Per_Stmt(), Create_Simple_Shackle_Loops(), RVI_NODE::Create_store(), Create_Stride1_Condition_If_Required(), Create_Tmp_Array(), Create_Unary_Opr(), Create_Unroll_Copy(), cwh_addr_do_bounds_check(), cwh_convert_to_ty(), cwh_do_tranformational(), cwh_dope_from_expression(), cwh_expr_bincalc(), cwh_inline_allocate(), cwh_io_conv_array_to_dope(), cwh_io_conv_arrsection_to_dope(), cwh_io_split_io_items(), cwh_make_typed_opcode(), cwh_stmt_call_helper(), DISTR_INFO::DART_Ldid(), IVR::Determine_trip_IV_and_exit_count(), DISTR_INFO::Dimsize(), DRA_EC_Array_Portion_Parms(), DRA_Insert_Pragmas(), EC_Array_Portion_Calls(), Eliminate_Temp_In_While(), em_exp_float(), emit_builtin_sync_fetch_op(), STMTREP::Enter_lhs(), STMTREP::Enter_rhs(), Evaluate_expr(), Execution_Cost_Expr(), Execution_Cost_Value(), Exp_Call(), Exp_Intrinsic_Call(), Exp_Lda(), Exp_Load(), Exp_Store(), Expand_Expr(), Expand_Float_To_Int_Tas(), Expand_Int_To_Vect_Tas(), Expand_Lda_Label(), Extended_Lower_Bound(), Extended_Upper_Bound(), Extract_Do_Info(), F90_Lower_Alloc_Dealloc(), F90_Lower_Create_Temp(), F90_Lower_Walk(), F90_Wrap_ARREXP(), Fast_32_Div(), Fast_32_Rem(), fei_addr(), fei_allocate(), fei_doloop(), fei_dv_deref(), fei_ibits(), fei_matmul(), fei_mvbits(), fei_present(), Fill_Align_Symbol(), OUTPUT_FUNC_START_PROFILER::Fill_In_Func_Body(), Finalize_Index_Variable(), Finalize_Index_Variable_For_Remove_Unity_Trip_Loop(), Find_Compare_Value(), OPT_TAIL::Fixup_exit(), Flip_Le_And_Ge(), Fold_Base(), OPT_REVISE_SSA::Fold_lda_iloads(), Fold_Offset(), OPT_REVISE_SSA::Form_extract(), OPT_REVISE_SSA::Form_extract_compose(), Freeze_Cur_Numthreads_Func(), Fuse(), Gather_Scatter_Scalar_Expand(), Gen_Alloc_DART(), Gen_Alloc_Reshape(), Gen_Call_Array(), Gen_Call_Array_Arg(), Gen_Call_Array_Cart(), Gen_Call_Array_Dart_Args(), Gen_Compare_DARTS(), Gen_Dealloc_DART(), Gen_exp_wn(), Gen_Free_Cart(), Gen_Init_DART(), Gen_LDA(), Gen_Lookup_DART(), Gen_Malloc_Cart(), Gen_MP_Copyin(), Gen_MP_Reduction(), PF_LG::Gen_Pref_Node(), Gen_Restore_Stack_Pointer(), Gen_Save_Stack_Pointer(), Gen_stmt_wn(), Gen_Symbols_In_DINFO(), Gen_WN_Const(), Generate_Blkcyc_Bounds(), Generate_Block_Bounds(), Generate_Block_Bounds_Negative(), ARA_LOOP_INFO::Generate_Copyout_Loop(), Generate_Cyclic_Bounds(), Generate_Dynamic_Bounds(), Generate_Guard_Test(), CSE::Generate_injury_repair(), Generate_Interleaved_Bounds(), ARA_LOOP_INFO::Generate_Parallel_Pragma(), Generate_Runtime_Cyclic_Bounds(), Generate_Simple_Bounds(), IVR::Generate_step(), ETABLE::Generate_stid_to_preg(), generate_tree_add(), generate_tree_from_bounds_info_row(), Get_Array_Dimension_LB(), Get_Array_Dimension_Size(), Get_Expansion_Space(), get_inverse_relop(), Get_Runtime_Cur_Numthreads_Ldid(), Get_Runtime_Max_Numthreads_Ldid(), Get_Runtime_Numthreads_Ldid(), Get_Runtime_Numthreads_Ldid_From_Func(), Handle_ILDBITS(), Handle_ISTBITS(), Handle_Sink_General_Case(), Handle_Sink_Promotion_Case(), Handle_Sink_Symbolic_Non_Promotion_Case(), HMB_Add_Guard_Condition(), HMB_Compound_Guard_Test(), HMB_Hoist_Expressions(), HMB_Replace_Messy_Bounds(), Hoist_Expression(), Hoist_Iload_Ldid_Upper_Bound_One_Level(), IFMM_Convert(), Increase_By(), Initialize_Pdo_Last_Local_Index(), Insert_Alloca(), Intrinsic(), Invert_Conditional(), SUMMARIZE< program >::IPL_EX_Call(), IPL_EX_Collapse_Trip_Counts(), IPL_EX_New_Expr_Expr(), IPL_EX_New_Value_Expr(), IPL_EXS_Outer_Fold(), SUMMARIZE< program >::IPL_GEN_Const(), SUMMARIZE< program >::IPL_GEN_Expr(), SUMMARIZE< program >::IPL_GEN_Value(), IPL_LNO_Make_Icon(), VN_LITERAL_EXPR::is_equal_to(), Lego_Fix_Local_Rec(), Lego_Index_From_Access_Vector(), Lego_Skew_Index(), Lego_Skew_Loop(), Lego_Skew_Offset(), DISTR_INFO::Load_Distr_Array(), Load_Distr_Array(), DISTR_INFO::Load_New_Distr_Array(), Localize_Variable(), ARRAY_LOWER_REF::Lower_Array_Expr(), ARRAY_LOWER_REF::Lower_Array_Param(), lower_bit_field_id(), lower_char(), lower_cshift(), Lower_Distr_Pragmas(), lower_eoshift(), Lower_Fetch_And_Op(), lower_io_items(), lower_maxminloc(), lower_mm_matmul(), lower_mv_matmul(), lower_random_number(), lower_reduction(), Lower_Single_Array_Dim(), LWN_CreateDivceil(), LWN_CreateDivfloor(), LWN_Integer_Cast(), LWN_Make_Icon(), Make_Final_Reduction_Op(), Make_Integer_Const(), Make_Reduction_Identity(), Matching_Load_Opcode(), Maybe_Handle_Sink_Promotion_Case(), MIR_Replace(), GOTO_TABLE::Move_Goto_Out(), Mp_Coordinate_Call(), Mp_Layout_Call(), Mp_Nested_Last_Thread(), Mp_Version_Loop(), Mp_Version_Parallel_Region(), Need_cvtl_for_store_to_preg(), Need_type_conversion(), New_DACT(), RVI_ANN::New_ldid(), NORMALIZE_LOOP::Normalize_do_loop(), Numprocs(), DISTR_INFO::Numprocs(), STMTREP::Op(), CODEREP::Op(), OPCODE_commutative_op(), OPCODE_make_signed_op(), Parallelize_Doacross_Loop(), Perform_Gather_Scatter(), LEGO_INFO::Pid0(), LEGO_INFO::Pid1(), Points_To_For_Array_Star(), Post_loop_peeling(), Pre_loop_peeling(), IPO_INLINE::Process_Alloca_Postamble(), IPO_INLINE::Process_Alloca_Preamble(), Process_Store(), Processor_Update_Inner_Tile(), Processor_Update_Outer_Tile(), Promote_Pointer(), Read_Pragma_Page_Place(), Read_Pragma_Thread_Affinity(), Remove_Floor_From_One_Sided_Cond(), Rename_Privatized_COMMON(), Replace_Equality_Check(), Replace_Formal_By_LDA(), GOTO_TABLE::Replace_Goto_With_If(), GTABLE::Replace_Goto_With_If(), GTABLE::Replace_Goto_With_While(), GOTO_TABLE::Replace_Goto_With_While(), IVR::Replace_secondary_IV(), return_upper_bound(), return_upper_boundplus1(), Rewrite_Bounds(), Rewrite_Pragmas_On_Structs(), Rewrite_Structs_In_MPRegion(), RV_Reverse_Index_Ldid(), Scalar_Expand(), scalar_rename(), SE_Array(), SE_Findxs(), SE_Identity(), SE_Iload(), SE_Indxs_and_Bounds(), SE_Istore(), SE_Wrap_Array(), CODEMAP::Separate_iv_invar(), Sh_LWN_CreateDivceil(), Sh_LWN_CreateDivfloor(), Simd(), Simd_Align_Analysis(), Simd_Align_Generate_Peel_Loop(), Simd_Finalize_Loops(), Simd_Handle_Negative_Coefficient(), Simd_Mark_Code(), Simd_Replace_With_Constant(), Simd_Update_Copy_Array_Index(), Simd_Vectorize_Induction_Variables(), Simd_Vectorize_Invariants(), Simd_Vectorize_Scalar_Reduction(), simp_cvt(), simp_eq_neq(), simp_not(), simp_relop(), VN_BINARY_EXPR::simplify(), VN_TERNARY_EXPR::simplify(), VN_UNARY_EXPR::simplify(), Simplify_Cond_With_Div_Floor(), SIMPNODE_ConstantFold2(), SIMPNODE_SimplifyExp3(), SNL_GEN_2D_Regtile(), SNL_GEN_Protect_Nest_With_Conditionals(), SNL_INV_Cache_Block(), SNL_Opr(), SNL_Optimize_Bounds(), SNL_Optimize_UB_With_Access_Vectors(), SNL_SPL_Fix_First_Outer_Loop_Limits(), SNL_SPL_Fix_Second_Outer_Loop_Limits(), SNL_TRANS_INDEX_DATA::SNL_TRANS_INDEX_DATA(), Solve_For(), Split_Array(), PF_LOOPNODE::Split_Loops(), EXP_WORKLST::SPRE_perform_insert_delete(), STD_Canonicalize_Upper_Bound(), RVI::Store_to_preg_and_mem(), RVI::Store_to_preg_cvtl(), Substitute_Array(), Thread_Affinity_Lower(), Toggle_Eq_To_Remove_One(), Transform_Code(), Transform_Do(), CANON_CR::Trim_to_16bits(), Trip_Reduce_Loop(), Twod_Setbound(), U64_LOWER_create_cvtl(), U64_LOWER_create_ne_0(), Uncombine_divrempart_operator(), Uncombine_minmaxpart_operator(), Uncombine_mpy_operator(), Unroll_Make_Remainder_Loop(), unroll_multi_bb(), unroll_multi_make_remainder_loop(), Unroll_Replicate_Body(), IVR::Update_exit_stmt(), Upper_Bound_Standardize(), UT_Generate_Imperfect_If_Code(), vho_lower_comma(), vho_lower_cselect(), vho_lower_expr(), vho_lower_if(), VHO_Lower_Mistore(), VHO_Lower_Mstid(), VHO_Lower_Mstore(), vho_lower_rcomma(), vho_lower_stmt(), VHO_Lower_Switch(), Vintrinsic_Fission(), Wind_Down(), WN2C_create_ref_param_lda(), WN2F_Initiate_OneInt(), WN2F_Initiate_ZeroInt(), WN_Create(), WN_Create_Generic(), WN_Create_Intrinsic(), WN_CreateComma(), WN_CreateConst(), WN_CreateCvtl(), WN_CreateExp1(), WN_CreateExp2(), WN_CreateExp3(), WN_CreateIlda(), WN_CreateIload(), WN_CreateIloadx(), WN_CreateIntconst(), WN_CreateIstore(), WN_CreateIstorex(), WN_CreateLda(), WN_CreateLdid(), WN_CreateParm(), WN_CreateRcomma(), WN_CreateStid(), WN_Flip_Le_And_Ge(), WN_Integer_Cast(), wn_loop_reverse_compare(), WN_LOOP_TripCount(), WN_Nary(), WN_opcode(), WN_Single_Iteration_Cost(), WN_Solve_For(), and WN_Upper_Bound_Standardize().
| const char* OPERATOR_name | ( | OPERATOR | opr | ) |
Looks up the name of this operator in the table from opcode_gen.c
Definition at line 55 of file opcode.cxx.
To make this lookup routine routine simple but efficient, we use a closed hashing scheme.
Definition at line 68 of file opcode.cxx.
1.5.6