#include "wn_core.h"#include "name.h"#include "dep_graph.h"#include "lwn_util.h"#include "reduc.h"#include "btree.h"#include "lno_bv.h"


Go to the source code of this file.
| #define Gather_Array_Refs 0x0002 |
Definition at line 67 of file ff_utils.h.
Referenced by Check_Doacross_Sync_Coverage(), and New_Gather_References().
| #define Gather_Calls 0x0010 |
Definition at line 70 of file ff_utils.h.
| #define Gather_IOs 0x0020 |
Definition at line 71 of file ff_utils.h.
| #define Gather_Other_Refs 0x0008 |
Definition at line 69 of file ff_utils.h.
| #define Gather_Params 0x0004 |
Definition at line 68 of file ff_utils.h.
Referenced by Fusion_Du_Update(), New_Gather_References(), and Scalar_Dependence_Prevent_Fusion().
| #define Gather_Scalar_Refs 0x0001 |
Module: ff_utils.h $Revision$ $Date$ $Author$ $Source$
Description:
Bunch of utilities related to Fission and Fusion. To be described later.
Definition at line 66 of file ff_utils.h.
Referenced by Fission_DU_Update(), Fusion_Du_Update(), Fusion_Loop_Stmt_Update(), Loop_Stmt_Update(), New_Gather_References(), Scalar_Dependence_Prevent_Fusion(), and Scalar_Variable_Renaming().
| #define Reset_Ref_Counter 0x1000 |
Definition at line 72 of file ff_utils.h.
| typedef STACK<SCALAR_REF> SCALAR_REF_STACK |
Definition at line 84 of file ff_utils.h.
Definition at line 74 of file ff_utils.h.
| ARRAY_DIRECTED_GRAPH16* Build_Statement_Dependence_Graph | ( | WN * | in_loop, | |
| REDUCTION_MANAGER * | Red_Mgr, | |||
| ARRAY_DIRECTED_GRAPH16 * | adg, | |||
| WN_MAP | sdm, | |||
| MEM_POOL * | pool | |||
| ) |
Definition at line 1653 of file ff_utils.cxx.
References Build_Doloop_Stack(), CXX_DELETE, CXX_NEW, DevWarn, Generate_Array_Dependence_For_Statement_Dependence_Graph(), Generate_Scalar_Dependence_For_Statement_Dependence_Graph(), Init_Ref_Stmt_Counter(), INT32, LEVEL_ARRAY_GRAPH, LNO_local_pool, Loop_Has_Asm(), Map_Stmt_To_Level_Graph(), MEM_POOL_Pop, MEM_POOL_Push, New_Gather_References(), NULL, stack, WN_do_body, WN_first(), and WN_next().
Referenced by Fission(), Fission_Test(), Move_Adjacent(), and toplogical_reordering().
| BOOL Edge_Is_Reduction_Dependence | ( | EINDEX16 | edge, | |
| ARRAY_DIRECTED_GRAPH16 * | dg, | |||
| REDUCTION_MANAGER * | Red_Mgr | |||
| ) |
Definition at line 130 of file ff_utils.cxx.
References BOOL, FALSE, DIRECTED_GRAPH16< EDGE_TYPE, VERTEX_TYPE >::Get_Sink(), DIRECTED_GRAPH16< EDGE_TYPE, VERTEX_TYPE >::Get_Source(), ARRAY_DIRECTED_GRAPH16::Get_Wn(), RED_NONE, source, TRUE, and REDUCTION_MANAGER::Which_Reduction().
Referenced by Generate_Array_Dependence_For_Statement_Dependence_Graph(), and Parallelization_Process_Deps().
Definition at line 1097 of file ff_utils.cxx.
References FALSE, Find_SCF_Inside(), Get_Do_Loop_Info(), DO_LOOP_INFO::Is_Inner, OPC_DO_LOOP, and TRUE.
Referenced by Separate_And_Update().
Definition at line 1086 of file ff_utils.cxx.
| void Fission_DU_Update | ( | DU_MANAGER * | Du_Mgr, | |
| REDUCTION_MANAGER * | Red_Mgr, | |||
| WN ** | wn_starts, | |||
| WN ** | wn_ends, | |||
| WN ** | wn_steps, | |||
| UINT | total_loops, | |||
| WN ** | loop, | |||
| BOOL | index_DU_to_first = FALSE | |||
| ) |
Definition at line 914 of file ff_utils.cxx.
References DU_MANAGER::Add_Def_Use(), BOOL, STACK< T >::Bottom_nth(), Build_Doloop_Stack(), CXX_NEW, DU_MANAGER::Delete_Def_Use(), Do_Loop_Depth(), DU_MANAGER::Du_Add_Use(), DU_MANAGER::Du_Get_Use(), STACK< T >::Elements(), FALSE, USE_LIST_ITER::First(), FmtAssert, Gather_Scalar_Refs, i, Init_Ref_Stmt_Counter(), INT, SLIST_ITER::Is_Empty(), LNO_local_pool, DEF_LIST::Loop_stmt(), LWN_Get_Parent, MEM_POOL_Pop, MEM_POOL_Push, New_Gather_References(), USE_LIST_ITER::Next(), OPC_DO_LOOP, OPC_FUNC_ENTRY, OPCODE_is_store(), STACK< T >::Push(), read, RED_NONE, DEF_LIST::Set_loop_stmt(), si, sk, stack, TRUE, DU_MANAGER::Ud_Add_Def(), DU_MANAGER::Ud_Get_Def(), UINT, Unrolled_DU_Update(), REDUCTION_MANAGER::Which_Reduction(), WN_do_body, WN_opcode(), WN_start, WN_step, and write.
Referenced by Separate_And_Update(), separate_loop_and_scalar_expand(), separate_loop_by_scc(), simd_fis_separate_loop_and_scalar_expand(), and vintr_fis_separate_loop_and_scalar_expand().
| BOOL Generate_Array_Dependence_For_Statement_Dependence_Graph | ( | WN * | in_loop, | |
| REF_LIST_STACK * | reads, | |||
| REF_LIST_STACK * | writes, | |||
| ARRAY_DIRECTED_GRAPH16 * | sdg, | |||
| REDUCTION_MANAGER * | Red_Mgr, | |||
| ARRAY_DIRECTED_GRAPH16 * | adg | |||
| ) |
Definition at line 1558 of file ff_utils.cxx.
References Array_Edge_To_Level_Edge(), DIRECTED_GRAPH16< EDGE_TYPE, VERTEX_TYPE >::Delete_Edge(), ARRAY_DIRECTED_GRAPH16::Delete_Vertex(), Do_Loop_Depth(), Edge_Is_Reduction_Dependence(), FALSE, Find_Stmt_Under(), DIRECTED_GRAPH16< EDGE_TYPE, VERTEX_TYPE >::Get_In_Edge(), DIRECTED_GRAPH16< EDGE_TYPE, VERTEX_TYPE >::Get_Next_In_Edge(), DIRECTED_GRAPH16< EDGE_TYPE, VERTEX_TYPE >::Get_Next_Out_Edge(), DIRECTED_GRAPH16< EDGE_TYPE, VERTEX_TYPE >::Get_Out_Edge(), DIRECTED_GRAPH16< EDGE_TYPE, VERTEX_TYPE >::Get_Sink(), DIRECTED_GRAPH16< EDGE_TYPE, VERTEX_TYPE >::Get_Source(), ARRAY_DIRECTED_GRAPH16::Get_Vertex(), ARRAY_DIRECTED_GRAPH16::Get_Wn(), i, ii, INT, iter, n, TRUE, UINT, and WN_do_body.
Referenced by Analyse_Dependencies(), Build_Statement_Dependence_Graph(), Fiss_Gather_Inner_Loop(), Fission_Inner_Loop(), Simd_Analysis(), and Vintrinsic_Fission().
| BOOL Generate_Scalar_Dependence_For_Statement_Dependence_Graph | ( | WN * | in_loop, | |
| SCALAR_STACK * | scalar_reads, | |||
| SCALAR_STACK * | scalar_writes, | |||
| SCALAR_REF_STACK * | params, | |||
| ARRAY_DIRECTED_GRAPH16 * | sdg, | |||
| REDUCTION_MANAGER * | Red_Mgr, | |||
| BIT_VECTOR * | Expandable_Scalar_Set = NULL, |
|||
| BINARY_TREE< NAME2BIT > * | mapping_dictionary = NULL | |||
| ) |
Definition at line 1315 of file ff_utils.cxx.
References Add_Stmt_Dependence(), Alias_Mgr, Aliased(), BOOL, STACK< T >::Bottom_nth(), Do_Loop_Depth(), STACK< T >::Elements(), FALSE, BINARY_TREE< BINARY_NODE >::Find(), Generate_Pragma_Dependence_For_Statement_Dependence_Graph(), NAME2BIT::Get_Bit_Position(), Get_Stmt_For_Stmt_Dep_Graph(), HAS_ALL_ZERO, INT, NOT_ALIASED, RED_NONE, si, sym, BIT_VECTOR::Test(), tmp, TRUE, UINT, UINT32, REDUCTION_MANAGER::Which_Reduction(), WN_kid0(), and WN_operator().
Referenced by Analyse_Dependencies(), Build_Statement_Dependence_Graph(), Fiss_Gather_Inner_Loop(), Fission_Inner_Loop(), Simd_Analysis(), and Vintrinsic_Fission().
| UINT Get_Stmt_For_Stmt_Dep_Graph | ( | WN * | source_wn, | |
| WN * | sink_wn, | |||
| WN ** | source_stmt_out, | |||
| WN ** | sink_stmt_out | |||
| ) |
Definition at line 197 of file ff_utils.cxx.
References Do_Loop_Depth(), FmtAssert, INT, LWN_Get_Parent, mUINT32, opc, OPC_BLOCK, OPC_DO_LOOP, OPC_FUNC_ENTRY, and WN_opcode().
Referenced by Array_Edge_To_Level_Edge(), Generate_Scalar_Dependence_For_Statement_Dependence_Graph(), and Lexical_Order().
| void Init_Ref_Stmt_Counter | ( | ) |
Definition at line 1111 of file ff_utils.cxx.
Referenced by Analyse_Dependencies(), Build_Statement_Dependence_Graph(), Check_Doacross_Sync_Coverage(), Fiss_Gather_Inner_Loop(), Fission_DU_Update(), Fission_Inner_Loop(), Fuse_Outer_Loops(), Fusion_Du_Update(), Fusion_Loop_Stmt_Update(), Loop_Stmt_Update(), Max_Dep_Distance(), Scalar_Dependence_Prevent_Fusion(), Scalar_Variable_Renaming(), Simd_Analysis(), and Vintrinsic_Fission().
Definition at line 1060 of file ff_utils.cxx.
References Get_Stmt_For_Stmt_Dep_Graph(), and WN_next().
| INT Map_Stmt_To_Level_Graph | ( | WN * | wn, | |
| ARRAY_DIRECTED_GRAPH16 * | sdg | |||
| ) |
Definition at line 357 of file ff_utils.cxx.
References ARRAY_DIRECTED_GRAPH16::Add_Vertex(), ARRAY_DIRECTED_GRAPH16::Get_Vertex(), Map_Stmt_To_Level_Graph(), OPC_DO_LOOP, OPC_DO_WHILE, OPC_GOTO, OPC_GOTO_OUTER_BLOCK, OPC_IF, OPC_LABEL, OPC_PRAGMA, OPC_REGION, OPC_RETURN, OPC_WHILE_DO, OPC_XPRAGMA, opcode, OPCODE_is_expression(), WN_do_body, WN_else, WN_first(), WN_next(), WN_opcode(), WN_region_body, WN_then, and WN_while_body.
Referenced by Analyse_Dependencies(), Build_Statement_Dependence_Graph(), Fiss_Gather_Inner_Loop(), Fission_Inner_Loop(), Map_Stmt_To_Level_Graph(), Simd_Analysis(), and Vintrinsic_Fission().
| INT32 New_Gather_References | ( | WN * | wn, | |
| REF_LIST_STACK * | writes, | |||
| REF_LIST_STACK * | reads, | |||
| DOLOOP_STACK * | stack, | |||
| SCALAR_STACK * | scalar_writes, | |||
| SCALAR_STACK * | scalar_reads, | |||
| SCALAR_REF_STACK * | params, | |||
| MEM_POOL * | pool, | |||
| INT | mode = Gather_Array_Refs|Gather_Scalar_Refs|Gather_Params | |||
| ) |
Definition at line 1120 of file ff_utils.cxx.
References addr(), base, Copy_Doloop_Stack(), count, CXX_NEW, Gather_Array_Refs, Gather_Params, Gather_Scalar_Refs, Get_ST_Base(), i, INT, INT32, LNO_local_pool, New_Gather_References(), OPC_BLOCK, OPC_DO_LOOP, OPCODE_is_load(), OPCODE_is_stmt(), OPCODE_is_store(), OPR_ADD, OPR_ARRAY, OPR_LDID, OPR_PARM, OPR_STID, STACK< T >::Pop(), STACK< T >::Push(), s, st_base, WN_array_base, WN_first(), WN_kid(), WN_kid0(), WN_kid1(), WN_kid_count(), WN_next(), WN_opcode(), WN_operator(), and WN_Parm_By_Reference.
Referenced by Analyse_Dependencies(), Build_Statement_Dependence_Graph(), Check_Doacross_Sync_Coverage(), Fiss_Gather_Inner_Loop(), Fission_DU_Update(), Fission_Inner_Loop(), Fuse_Outer_Loops(), Fusion_Du_Update(), Fusion_Loop_Stmt_Update(), Loop_Stmt_Update(), Max_Dep_Distance(), New_Gather_References(), Scalar_Dependence_Prevent_Fusion(), Scalar_Variable_Renaming(), Simd_Analysis(), and Vintrinsic_Fission().
| BOOL scalar_rename | ( | WN * | ref, | |
| HASH_TABLE< WN *, INT > * | checked = NULL | |||
| ) |
Definition at line 592 of file ff_utils.cxx.
References Alias_Mgr, Be_Type_Tbl, BOOL, Contains_MP, Create_alias(), Create_Preg_Symbol(), Du_Mgr, STACK< T >::Elements(), HASH_TABLE< SIG_TYPE, DATA_TYPE >::Enter(), FALSE, fprintf(), STACK< T >::Free(), Get_Trace(), i, INT, Is_Reduction_In_Prallel_Region(), LNO_local_pool, LNO_Verbose, LWN_CreateExp1(), LWN_Get_Parent, LWN_Set_Parent, MTYPE_bit_size, MTYPE_BS, MTYPE_is_complex, MTYPE_M, Mtype_TransferSign(), MTYPE_V, SYMBOL::Name(), new_symbol(), NULL, OPC_DO_LOOP, OPCODE_desc(), OPCODE_has_sym(), OPCODE_make_op(), OPCODE_operator(), OPCODE_rtype(), OPR_CVT, OPR_CVTL, OPR_LDID, OPR_STID, Promote_Type(), Rename_Update_MP(), Scalar_Equivalence_Class(), Size(), SYMBOL::St(), ST_st_idx, TFile, STACK< T >::Top_nth(), TP_LNOPT, TRUE, TT_LNO_NORENAME, TY_is_volatile, SYMBOL::Type, TYPE_ID, Update_Loop_Info(), WN_cvtl_bits(), WN_desc(), WN_index, WN_kid(), WN_kid0(), WN_kid_count(), SYMBOL::WN_Offset(), WN_offset(), WN_opcode(), WN_operator(), WN_rtype(), WN_set_field_id(), WN_set_opcode(), WN_set_rtype(), WN_set_ty(), WN_Simplifier_Enable(), WN_st_idx(), WN_start, WN_step, and WN_ty().
Referenced by Finalize_Index_Variable(), Finalize_Index_Variable_For_Remove_Unity_Trip_Loop(), Fix_Array_Deps_On_Index_Variable(), Fuse(), HoistIf(), Post_loop_peeling(), Pre_loop_peeling(), Scalar_Variable_Renaming(), Separate_And_Update(), separate_loop_and_scalar_expand(), simd_fis_separate_loop_and_scalar_expand(), Simd_Pre_Analysis(), vintr_fis_separate_loop_and_scalar_expand(), and Vintrinsic_Fission().
Definition at line 825 of file ff_utils.cxx.
References BOOL, Build_Doloop_Stack(), CXX_NEW, Du_Mgr, STACK< T >::Elements(), HASH_TABLE< SIG_TYPE, DATA_TYPE >::Enter(), ESTIMATED_SIZE, FALSE, HASH_TABLE< SIG_TYPE, DATA_TYPE >::Find(), Gather_Scalar_Refs, Get_Trace(), i, Init_Ref_Stmt_Counter(), INT, DYN_ARRAY< T >::Lastidx(), MEM_POOL_Initialize, mem_pool_initialized, MEM_POOL_Pop, MEM_POOL_Push, New_Gather_References(), DYN_ARRAY< T >::Newidx(), NULL, OPR_STID, Scalar_Equivalence_Class(), scalar_rename(), stack, STACK< T >::Top_nth(), TP_LNOPT, TRUE, TT_LNO_NORENAME, and WN_operator().
Referenced by Lnoptimizer(), and Phase_123().
| void toplogical_reordering | ( | WN * | loop, | |
| UINT | depth, | |||
| ARRAY_DIRECTED_GRAPH16 * | adg | |||
| ) |
Definition at line 427 of file ff_utils.cxx.
References Build_Statement_Dependence_Graph(), CXX_DELETE, DevWarn, Do_Loop_Has_Calls(), Do_Loop_Has_Gotos(), Do_Loop_Is_Good(), FALSE, Form_Loops(), FF_STMT_NODE::Get_Stmt(), i, INT, Is_True, DYN_ARRAY< T >::Lastidx(), LWN_Extract_From_Block(), LWN_Insert_Block_Before(), MEM_POOL_Initialize, mem_pool_initialized, MEM_POOL_Pop, MEM_POOL_Push, NULL, OPT_FLAG_STMT_REORDERING, red_manager, TRUE, WN_do_body, WN_MAP_Create, and WN_MAP_Delete.
Referenced by Fiz_Fuse().
Definition at line 82 of file ff_utils.cxx.
Referenced by Fission(), Fission_Test(), Move_Adjacent(), and WB_stmt_deps().
1.5.6