#include "snl_xbounds.h"#include "mat.h"


Go to the source code of this file.
| #define SNL_DEBUG0 | ( | level, | |||
| string | ) |
Value:
((snl_debug < level) ? 0 : \ (fprintf(TFile, "SNL DEBUG: "),\ fprintf(TFile, string),\ fprintf(TFile, "\n")))
Definition at line 601 of file snl_utils.h.
Referenced by Do_Automatic_Transformation(), SNL_GEN_2D_Regtile(), SNL_GEN_Protect_Nest_With_Conditionals(), SNL_NEST_INFO::SNL_NEST_INFO(), SNL_Peel_Iteration(), SNL_Transform(), and Wind_Down().
| #define SNL_DEBUG1 | ( | level, | |||
| string, | |||||
| v1 | ) |
Value:
((snl_debug < level) ? 0 : \ (fprintf(TFile, "SNL DEBUG: "),\ fprintf(TFile, string, v1),\ fprintf(TFile, "\n")))
Definition at line 607 of file snl_utils.h.
Referenced by Good_Do_Next_Innermost1(), SX_INFO::Handle_Use(), SE_Guard_Depth(), SNL_GEN_2D_Regtile(), SNL_GEN_Scalar_Expand(), SNL_GEN_U_Ctiling(), SNL_INV_Cache_Block(), SNL_INV_Compact_Scalar_Expand(), SNL_INV_Local_Permute_Loops(), SNL_INV_Scalar_Expand(), SNL_Is_Transformable(), SNL_NEST_INFO::SNL_NEST_INFO(), and SNL_Peel_Iteration().
| #define SNL_DEBUG2 | ( | level, | |||
| string, | |||||
| v1, | |||||
| v2 | ) |
Value:
((snl_debug < level) ? 0 : \ (fprintf(TFile, "SNL DEBUG: "),\ fprintf(TFile, string, v1, v2),\ fprintf(TFile, "\n")))
Definition at line 613 of file snl_utils.h.
Referenced by SX_INFO::Handle_Index_Variable_Def(), SNL_Change_Reduction_Loop_Stmts(), SNL_Distribute(), SNL_Is_Transformable(), and SNL_Transform().
| #define SNL_DEBUG3 | ( | level, | |||
| string, | |||||
| v1, | |||||
| v2, | |||||
| v3 | ) |
Value:
((snl_debug < level) ? 0 : \ (fprintf(TFile, "SNL DEBUG: "),\ fprintf(TFile, string, v1, v2, v3),\ fprintf(TFile, "\n")))
Definition at line 619 of file snl_utils.h.
Referenced by SX_INFO::Make_Sx_Info().
| #define SNL_MAX_LOOPS LNO_MAX_DO_LOOP_DEPTH |
Definition at line 382 of file snl_utils.h.
Referenced by SNL_DEP_MATRIX::Apply(), Distribute_Traverse(), Do_Automatic_Transformation(), Formula_For_Ak(), RG::Insert(), Prompf_Tile(), Rewrite_Bounds(), RG::RG(), Row_Echelon(), RSolve(), RSolve3(), RSolve_Go(), SE_CT_New_Tile_Infos(), SE_Permutation_To_Order(), SNL_Distribute(), SNL_GEN_U_Ctiling(), SNL_INV_Compact_Scalar_Expand(), SNL_INV_Local_Permute_Loops(), SNL_INV_Permute_Distributends(), SNL_INV_Register_Tile(), SNL_INV_Scalar_Expand(), SNL_INV_Shift_Loops(), SNL_INV_Transforms(), SNL_NEST_INFO::SNL_NEST_INFO(), SNL_Transform(), SNL_DEP_INFO::U_Fully_Permutable(), UT_Body_Imperfect(), and UT_Generate_Imperfect_If_Code().
| #define snl_utils_INCLUDED "snl_utils.h" |
Description:
Code that implements utilities for SNLs. None of this is "exported" in that all user routines use the interface described in snl.h, and snl.cxx uses these routines for its own purposes.
Exported types:
SNL_MONO
An enumerated type indicating whether an expression is constant, increasing, decreasing or ugly in a given symbol. The values are SNL_MONO_INVARIANT SNL_MONO_INC SNL_MONO_DEC SNL_MONO_OTHER
Exported functions
void Print_Do_Stack(FILE*, const DOLOOP_STACK*)
Print the indexes of a DOLOOP_STACK.
SNL_MONO Mono( WN* wn, SYMBOL symbol, BOOL neg =FALSE );
Is wn increasing, decreasing, constant or ugly in symbol? If neg is true, flip SNL_MONO_INC and SNL_MONO_DEC.
BOOL Is_Lexpos(DEPV*, INT dims); BOOL Is_Lexpos(DEPV_ARRAY*);
If any dependence could possibly be lexneg, returns FALSE; otherwise returns TRUE. TODO OK: these could go in dep.h.
void Increase_By(WN* wn, INT c, WN* parent =NULL, INT kid =-1);
Increases the wn expression by c. Parent and kid are such that WN_kid(parent,kid) is wn.
WN* LWN_Create_Block_From_Stmts_Above(WN* wn); WN* LWN_Create_Block_From_Stmts_Below(WN* wn);
Take all statements on the same block as wn and above/below it, remove them from that block, and return a new block containing only them.
INT64 Iterations(WN* loop, MEM_POOL* pool);
Returns how many times the loop goes, or -1 if not integral or can't decide.
WN* Find_Next_Innermost_Do(WN* loop)
Goes recursively in to find a DO inside the loop. If the loop contains more than one (not looking inside DOs found), then NULL is returned: it returns a loop only when there is exactly one at the next nest level.
DOLOOP_STACK* Copy_Dostack( const DOLOOP_STACK& stack, MEM_POOL* );
Put a copy of this stack in the given mempool and return a pointer.
void SNL_Sanity_Check_Func(WN* wn) void SNL_Sanity_Check_Block(WN* wn) void SNL_Sanity_Check_Loop(WN* wn) void SNL_Sanity_Check_If(WN* wn) void SNL_Sanity_Check_Region(SNL_REGION region) WN* SNL_Sanity_Check_Exp(WN* wn)
Check if the block's/loop's/if's/region's/expression's DO_LOOP_INFO and IF_INFO information is correct. Assertion failure if not. Also print a warning if apparently missing DU/UD information. Returns NULL if there are no load/stores with missing vertices in the dependence graph of Array_Dependence_Graph, and it returns a sample one if there is.
void Dump_WN(SNL_REGION, FILE*, INT, INT = 2, INT = 2, WN** = NULL, WN* = NULL, ARRAY_DIRECTED_GRAPH16* =NULL);
Like Dump_WN, but for SNL_REGIONs.
void SNL_Add_Du_To_Index_Ldid(WN* loop, WN* code, DU_MANAGER*, BOOL code_in_loop)
use = ldid [so ldid must be an OPR_LDID] def = WN_start(loop) def = WN_step(loop)
code is any code where you want ldids of the loop index to point to that for du information. If the code is not in the loop, don't set the loop stmt to be the loop --- set it to null. Note that in the TRUE case it does the right thing, whereas in the FALSE case it might do the right thing, but the user should think about what the loop_stmt ought to be in that case.
void SNL_Change_Du_To_Index_Ldid(WN* loop, WN* code, DU_MANAGER*, BOOL code_in_loop)
same as above, but remove all def/use info first, then add the above. And also, this recurses through a tree,
void SNL_Change_Du_Pointer(WN* oldptr, WN* ptr, WN* body, DU_MANAGER*)
All deflist pointers that used to point to oldptr in body now point to ptr.
void SNL_Fix_Index_Pointers(WN* loop, WN* wn);
The def lists for symbols that are the index are made to point there.
void SNL_Print_Ldid_Pointers(WN* wn);
Print all def_list pointers in wn in a nice way.
const DEF_LIST* Find_Def_List_In_Exp(WN* exp, const SYMBOL& sym)
Return any def_list for this symbol in this expression.
WN* Find_Use_In_Exp(WN* exp, const SYMBOL& sym)
Return use for this symbol in this expression.
Calls LWN_Copy_Tree, copying alias information and du information and dg information.
WN*& SNL_UBexp(WN* snl_end, BOOL* ne = NULL) WN*& SNL_UBvar(WN* snl_end)
Given a doo loop, pass WN_end(doloop) as a parameter. The function then returns kid1 (kid0 for UBvar) when snl_end's opr is LE/LT. If it's GE/GT, return kid0 (kid1). Otherwise error. If it's GT or LT, then ne is set to TRUE, if it's passed. Otherwise FALSE.
WN* Good_Do_Next_Innermost(WN* doloop)
Go in from this doloop. Return the unique do loop inside. Return NULL if none or more than one.
BOOL SNL_Is_Non_Varying_Access_Array(ACCESS_ARRAY* aa, INT outer_depth)
Returns TRUE if the access array 'aa' is free of problems that make it non-transformable within the loop nest starting at 'outer_depth', FALSE otherwise.
WN* SNL_Get_Inner_Snl_Loop(WN* outer, INT nloops)
Returns the innermost loop in the SNL of 'nloops' loops, where 'outer' is the outermost loop in the SNL.
BOOL SNL_Is_Invariant(DOLOOP_STACK *stack, INT d, INT dd)
Returns TRUE if the the 'dd'th loop in the 'stack' is free of references to the 'd'th loop in the 'stack'. Access vectors are used if they are valid, otherwise, we use UD information.
INT SNL_Loop_Count(WN* wn_snl)
Returns the number of loops in the innermost SNL 'wn_snl'.
WN* SNL_Innermost_Do(WN* wn_outer)
Returns the innermost loop in the innermost SNL 'wn_outer'.
Returns the number of loops in the inner SNL rooted at 'wn_loop', if 'wn_loop' is indeed an inner SNL, otherwise returns 0.
void SNL_Upper_Bound_Standardize(WN* wn_outer, nloops)
For the SNL wth outermost loop 'wn_outer' consisting of 'nloops' loops, attempt to standardize the upper bounds of each loop in that SNL.
BOOL Valid_SNL_Region(SNL_REGION region)
Returns TRUE if 'region' is a valid SNL region, FALSE otherwise.
BOOL Need_Fix_Array_Deps_On_Index_Variable(WN* wn_loop)
Returns TRUE if the index variable for loop 'wn_loop' is aliased with an array element, FALSE otherwise.
BOOL SNL_Fix_Array_Deps_On_Index_Variable(WN* wn_outer, INT nloops)
Fix all of the index variables in the SNL 'wn_loop' of 'nloops' loops which are aliased to array elements, insofar as this is possible. Return FALSE if we ran out of depen- dence edges while attempting this, TRUE otherwise.
WN* Next_SNL_Loop(WN* wn_outer)
Returns the next innermost loop in the SNL 'wn_outer', NULL if there is none.
IMAT* Permutation_To_Unimodular(INT permutation[], INT nloops)
Returns a unimodular matrix equivalent to the 'permutation' of length 'nloops'.
INT* Unimodular_To_Permutation(IMAT* unimodular)
Returns a permutation equivalent to the 'unimodular' matrix, if it is actually a permutation matrix. Otherwise returns NULL.
void Fix_Do_Du_Info(WN* wn, SNL_TRANS_INDEX_DATA* td, BOOL recursive, WN* loops, INT only_in_nloops)
wn: The code we are fixing up. td: Pass in NULL to not fix up DU information for non-index variables in the bounds. Otherwise pass in the td. recursive:If true, fix up information inside the do body as well, and recursively inside that. Otherwise, just operate on the bounds of this wn. loops: If NULL, fix up all index variables that appear within WN. E.g. if inside wn there is a use of "i", and there is some ancestor that is a DO "i", tnen make i's DU information point to that only. If not null, then it's not the ances- tors of the reference, but loops and its ancestors. This is useful when wn is not part of the PU but just some where we created, but more typically, just pass in NULL. only_in_nloops: How deep may we assume that the index variable is only read and written within the loop. E.g. 0 means never assume that. 1 means assume that for wn only. 2 means assume that for wn and every loop nested 1 inside wn ... . Notice that if this value is non-zero, then this code will delete all DU information for each loop it sees, and then expect to see every reference to that index variable and rebuild the information. If a DO with uses of the index only inside is being renamed, then you pass in only_in_loops=1 so that you remove any stale DU infor- mation and recompute it exactly.
INT snl_debug
0: print little no debugging information 1: print some basic debugging informations 2: print lots of debugging information 3: print yet more debugging information
Exported Functions for Debugging:
void SNL_DEBUG0(level, string); void SNL_DEBUG1(level, string, arg1); void SNL_DEBUG2(level, string, arg1, arg2); void SNL_DEBUG3(level, string, arg1, arg2, arg3);
if snl_debug >= level, then print an SNL debugging message to TFILE, unless, and also to TFILE if it exists. The string is an fprintf string, and any args following are args to fprintf. $Revision$ $Date$ $Author$ $Source$
Definition at line 327 of file snl_utils.h.
| #define UCTILE_I 0x2 |
Definition at line 358 of file snl_utils.h.
Referenced by generate_tree_from_row(), Rewrite_Bounds(), and SNL_TRANS_INDEX_DATA::SNL_TRANS_INDEX_DATA().
| #define UCTILE_O 0x4 |
Definition at line 359 of file snl_utils.h.
Referenced by generate_tree_from_row(), and Rewrite_Bounds().
| #define UCTILE_T 0x1 |
Definition at line 357 of file snl_utils.h.
Referenced by generate_tree_from_row(), and Rewrite_Bounds().
| SNL_INV_UNDEFINED | |
| SNL_INV_TILE_ONLY | |
| SNL_INV_SE_ONLY | |
| SNL_INV_TILE_SE | |
| SNL_INV_LEGO_TILE | |
| SNL_INV_MP_TILE | |
| SNL_INV_DOACROSS_TILE |
Definition at line 372 of file snl_utils.h.
| enum SNL_MONO |
Definition at line 506 of file snl_utils.h.
| DOLOOP_STACK* Copy_Dostack | ( | const DOLOOP_STACK & | stack, | |
| MEM_POOL * | ||||
| ) |
Definition at line 545 of file snl_utils.cxx.
References STACK< T >::Bottom_nth(), CXX_NEW, STACK< T >::Elements(), i, INT, and STACK< T >::Push().
| void Dump_WN | ( | SNL_REGION | , | |
| FILE * | , | |||
| INT | , | |||
| INT | = 2, |
|||
| INT | = 2, |
|||
| WN ** | = NULL, |
|||
| WN * | = NULL, |
|||
| ARRAY_DIRECTED_GRAPH16 * | = NULL | |||
| ) |
Definition at line 1040 of file snl_utils.cxx.
References Dump_WN(), SNL_REGION::First, SNL_REGION::Last, NULL, and WN_next().
Definition at line 1176 of file snl_utils.cxx.
References Du_Mgr, Find_Use_In_Exp(), FmtAssert, SYMBOL::Name(), NULL, and DU_MANAGER::Ud_Get_Def().
Definition at line 540 of file snl_utils.cxx.
References Find_Next_Innermost_Do_In_Block(), and WN_do_body.
Referenced by Code_Expansion_Limit_Loop(), Discard_Possibly_Empty_Loops(), HMB_Compound_Guard_Test(), HMB_Hoist_Messy_Bounds(), HMB_Maximum_Point(), HMB_Simple_Guard_And_Hoist(), Mp_Collapse_Dependences(), Mp_Convert_To_Single_Loop(), Mp_Tile_Nested_Loop(), SNL_Finalizable_Loops(), SNL_Finalize_Index_Variables(), SNL_Finalize_Loops(), SNL_INV_Permute_Loops(), SNL_Regtile_Loop(), SNL_Transform(), and Standardize_For_Tiling().
Definition at line 1158 of file snl_utils.cxx.
References Find_Use_In_Exp(), INT, NULL, OPR_LDID, WN_kid(), WN_kid_count(), and WN_operator().
Referenced by SNL_BOUNDS_INFO::Canonicize(), Find_Def_List_In_Exp(), Find_Use_In_Exp(), and SNL_GEN_U_Ctiling().
| void Fix_Do_Du_Info | ( | WN * | wn, | |
| SNL_TRANS_INDEX_DATA * | td, | |||
| BOOL | recursive, | |||
| WN * | loops, | |||
| INT | only_in_nloops | |||
| ) |
Definition at line 2360 of file snl_utils.cxx.
References Fix_Do_Du_Info_X().
Referenced by Replace_Index_Variable(), Rewrite_Bounds(), SNL_GEN_2D_Regtile(), SNL_GEN_U_Ctiling(), SNL_SPL_Fix_Second_Outer_Loop_Limits(), and Wind_Down().
| WN* generate_tree_from_bounds_info_row | ( | const mINT32 * | row, | |
| mINT64 | con, | |||
| BOOL | le, | |||
| const SNL_BOUNDS_SYMBOL_LIST * | vi | |||
| ) |
Definition at line 1937 of file snl_utils.cxx.
References Boolean_type, Du_Mgr, SLIST_ITER::First(), FmtAssert, generate_tree_add(), i, INT, SLIST_ITER::Is_Empty(), LWN_CreateExp2(), LWN_Make_Icon(), Max_Wtype(), MTYPE_V, n, SLIST_ITER::Next(), NULL, OPCODE_make_op(), OPR_EQ, OPR_LE, and TYPE_ID.
Referenced by SNL_GEN_Protect_Nest_With_Conditionals().
| WN* generate_tree_from_row | ( | const mINT32 * | m, | |
| SNL_TRANS_INDEX_DATA * | td, | |||
| INT64 | c, | |||
| TYPE_ID | wtype, | |||
| INT | part | |||
| ) |
Definition at line 1901 of file snl_utils.cxx.
References generate_tree_add(), i, SNL_TRANS_INDEX_DATA::i_nloops, SNL_TRANS_INDEX_DATA::idata, INT, LWN_Make_Icon(), NULL, SNL_TRANS_INDEX_DATA::o_nloops, SNL_TRANS_INDEX_DATA::odata, SNL_TRANS_INDEX_DATA::t_nloops, SNL_TRANS_INDEX_DATA::tdata, UCTILE_I, UCTILE_O, and UCTILE_T.
Referenced by Rewrite_Bounds(), and SNL_TRANS_INDEX_DATA::SNL_TRANS_INDEX_DATA().
Definition at line 1256 of file snl_utils.cxx.
References FmtAssert, Good_Do_Next_Innermost1(), INT, NULL, OPC_DO_LOOP, val, WN_do_body, and WN_opcode().
Referenced by SNL_Finalizable_Loops(), and SNL_Transform().
Definition at line 354 of file snl_utils.cxx.
References exp, FmtAssert, Increase_By(), LWN_Copy_Frequency_Tree(), LWN_CreateExp2(), LWN_Get_Parent, LWN_Make_Icon(), LWN_Set_Parent, MTYPE_V, NULL, opc, OPCODE_is_expression(), OPCODE_make_op(), OPCODE_name(), OPCODE_operator(), OPCODE_rtype(), OPR_ADD, OPR_INTCONST, OPR_MAX, OPR_MIN, OPR_STID, OPR_SUB, TYPE_ID, WN_const_val(), WN_kid(), WN_kid0(), WN_kid1(), WN_kid_count(), WN_opcode(), and WN_operator().
Referenced by Increase_By(), SNL_Peel_Iteration(), SNL_Regtile_Loop(), and Twod_Setbound().
Definition at line 1537 of file snl_utils.cxx.
References Get_Do_Loop_Info(), i, INT, DO_LOOP_INFO::Is_Inner, Is_Inner_SNL(), NULL, OPC_BLOCK, OPC_DO_LOOP, OPC_DO_WHILE, OPC_IF, OPC_REGION, OPC_WHILE_DO, WN_first(), WN_kid(), WN_kid_count(), WN_next(), and WN_opcode().
Referenced by Is_Inner_SNL(), and SE_Easy_Loop().
| BOOL Is_Lexpos | ( | DEPV_ARRAY * | ) |
Definition at line 342 of file snl_utils.cxx.
References DEPV_ARRAY::Depv(), FALSE, INT, Is_Lexpos(), DEPV_ARRAY::Num_Dim(), DEPV_ARRAY::Num_Vec(), and TRUE.
Definition at line 1052 of file dep.cxx.
References DEP_Direction(), DEPV_Dep, DIR_EQ, DIR_NEG, DIR_NEGEQ, DIR_POS, DIR_POSEQ, DIR_POSNEG, DIR_STAR, FALSE, i, INT, and TRUE.
Referenced by Is_Lexpos(), Repair_Bad_Dependences(), and SNL_Test_Reduction_Lexneg().
Definition at line 456 of file snl_utils.cxx.
References Add(), BOOL, ACCESS_VECTOR::Const_Offset, CXX_DELETE, ACCESS_ARRAY::Dim(), FmtAssert, Get_Do_Loop_Info(), INT, INT64, ACCESS_VECTOR::Is_Const(), DO_LOOP_INFO::LB, NULL, OPC_DO_LOOP, OPR_INTCONST, OPR_MAX, OPR_MIN, STACK< T >::Push(), SNL_UBexp(), stack, Step_Size(), TRUE, DO_LOOP_INFO::UB, Upper_Bound_Standardize(), WN_const_val(), WN_end, WN_kid0(), WN_opcode(), WN_operator(), and WN_start.
Referenced by Constant_Propogate(), fast_fuse_check_ok(), Fully_Unroll_Short_Loops(), Lisp_Loops_Traverse(), Mp_Optimize_Interleaved_Loop(), Remove_Unity_Trip_Loop(), Remove_Zero_Trip_Loop(), SNL_INV_Cache_Block(), SNL_INV_Register_Tile(), SNL_Regtile_Loop(), SNL_Remove_Useless_Loops(), SNL_SPL_Propagate_Tiled_Lower_Bound(), SNL_SPL_Split_Tile_Sets(), and Trip_One_Loop().
Definition at line 419 of file snl_utils.cxx.
References FmtAssert, LWN_Extract_From_Block(), LWN_Get_Parent, LWN_Insert_Block_After(), NULL, prev, WN_CreateBlock, WN_prev(), and WN_prev_executable().
Referenced by Rewrite_Bounds(), SNL_Regtile_Loop(), and UT_Generate_Imperfect_If_Code().
Definition at line 436 of file snl_utils.cxx.
References FmtAssert, LWN_Extract_From_Block(), LWN_Get_Parent, LWN_Insert_Block_Before(), next, NULL, WN_CreateBlock, WN_next(), and WN_next_executable().
Referenced by Rewrite_Bounds(), SNL_Regtile_Loop(), and UT_Generate_Imperfect_If_Code().
Definition at line 165 of file snl_utils.cxx.
References c, FmtAssert, INT, INT64, INTRN_I4DIVCEIL, INTRN_I4DIVFLOOR, INTRN_I8DIVCEIL, INTRN_I8DIVFLOOR, INTRN_U4DIVCEIL, INTRN_U4DIVFLOOR, INTRN_U8DIVCEIL, INTRN_U8DIVFLOOR, Is_True, Mono(), mono_union(), SYMBOL::Name(), opc, OPCODE_is_expression(), OPCODE_name(), OPCODE_operator(), OPERATOR_name(), OPR_ABS, OPR_ADD, OPR_ARRAY, OPR_ASHR, OPR_BAND, OPR_BIOR, OPR_BNOT, OPR_BXOR, OPR_CAND, OPR_CEIL, OPR_CIOR, OPR_COMPLEX, OPR_CONST, OPR_CVT, OPR_CVTL, OPR_DIV, OPR_EQ, OPR_FLOOR, OPR_GE, OPR_GT, OPR_IDNAME, OPR_ILOAD, OPR_IMAGPART, OPR_INTCONST, OPR_INTRINSIC_OP, OPR_LAND, OPR_LDA, OPR_LDID, OPR_LE, OPR_LIOR, OPR_LNOT, OPR_LSHR, OPR_LT, OPR_MAX, OPR_MIN, OPR_MLOAD, OPR_MOD, OPR_MPY, OPR_NE, OPR_NEG, OPR_PAREN, OPR_PARM, OPR_REALPART, OPR_RECIP, OPR_REM, OPR_RND, OPR_RSQRT, OPR_SHL, OPR_SQRT, OPR_STID, OPR_SUB, OPR_TAS, OPR_TRUNC, SNL_MONO_DEC, SNL_MONO_INC, SNL_MONO_INVARIANT, SNL_MONO_OTHER, TRUE, WN_const_val(), WN_intrinsic(), WN_kid(), WN_kid0(), WN_kid1(), WN_kid_count(), WN_opcode(), and WN_operator().
Referenced by Mono(), SNL_GEN_2D_Regtile(), and SNL_Is_Transformable().
Definition at line 1606 of file snl_utils.cxx.
References Array_Dependence_Graph, ARRAY_DIRECTED_GRAPH16::Get_Vertex(), and WN_start.
Referenced by Minimal_Kernel(), SNL_Fix_Array_Deps_On_Index_Variable(), and SNL_Transform().
Definition at line 1737 of file snl_utils.cxx.
References NULL, OPC_DO_LOOP, WN_do_body, WN_first(), WN_next(), and WN_opcode().
Referenced by Innermost_Doacross_Nest_Loop(), Mp_Optimize_Interleaved_Loop(), Mp_Trip_Count(), Prompf_Hoist_Messy_Bounds(), and SNL_GEN_U_Ctiling().
Definition at line 1752 of file snl_utils.cxx.
References CXX_NEW, i, INT, and LNO_local_pool.
Referenced by SNL_GEN_Scalar_Expand().
| void Print_Do_Stack | ( | FILE * | f, | |
| const DOLOOP_STACK * | ||||
| ) |
Definition at line 119 of file snl_utils.cxx.
References STACK< T >::Bottom_nth(), STACK< T >::Elements(), fflush(), fprintf(), i, indx, INT, ST_name, ST_ofst, WN_index, WN_offset(), and WN_st().
| INT Renumber_Loops | ( | WN * | first, | |
| WN * | last, | |||
| ARRAY_DIRECTED_GRAPH16 * | = NULL | |||
| ) |
Definition at line 1024 of file snl_utils.cxx.
References Array_Dependence_Graph, Check_Depth(), dg, FmtAssert, info, INT, RENUMBER_INFO::loops_inside, LWN_Get_Parent, RENUMBER_INFO::missing_dg_nodes, NULL, Renumber_Loops(), and Unmapped_Vertices_Here_Out().
| void SNL_Add_Du_To_Index_Ldid | ( | WN * | loop, | |
| WN * | ldid, | |||
| DU_MANAGER * | , | |||
| BOOL | ||||
| ) |
Definition at line 1056 of file snl_utils.cxx.
References FmtAssert, i, INT, OPC_BLOCK, OPR_LDID, SNL_Add_Du_To_Index_Ldid(), SNL_Add_Du_To_Index_Ldid_Ldid(), DU_MANAGER::Ud_Get_Def(), WN_first(), WN_index, WN_kid(), WN_kid_count(), WN_next(), WN_opcode(), and WN_operator().
Referenced by Gather_Scatter_Scalar_Expand(), SE_Findxs(), SE_Indxs_and_Bounds(), SNL_Add_Du_To_Index_Ldid(), SNL_Distribute(), SNL_INV_Cache_Block(), SNL_Regtile_Loop(), and SNL_TRANS_INDEX_DATA::SNL_TRANS_INDEX_DATA().
| void SNL_Change_Du_Pointer | ( | WN * | oldptr, | |
| WN * | ptr, | |||
| WN * | body, | |||
| DU_MANAGER * | ||||
| ) |
Definition at line 1095 of file snl_utils.cxx.
References Du_Mgr, i, INT, DEF_LIST::Loop_stmt(), OPC_BLOCK, OPCODE_operator(), OPR_LDID, DEF_LIST::Set_loop_stmt(), SNL_Change_Du_Pointer(), DU_MANAGER::Ud_Get_Def(), WN_first(), WN_kid(), WN_kid_count(), WN_next(), and WN_opcode().
Referenced by SNL_Change_Du_Pointer().
| void SNL_Change_Du_To_Index_Ldid | ( | WN * | loop, | |
| WN * | code, | |||
| DU_MANAGER * | , | |||
| BOOL | ||||
| ) |
Definition at line 1075 of file snl_utils.cxx.
References FmtAssert, i, INT, OPC_BLOCK, OPR_LDID, DU_MANAGER::Remove_Use_From_System(), SNL_Add_Du_To_Index_Ldid_Ldid(), SNL_Change_Du_To_Index_Ldid(), DU_MANAGER::Ud_Get_Def(), WN_first(), WN_index, WN_kid(), WN_kid_count(), WN_next(), WN_opcode(), and WN_operator().
Referenced by SNL_Change_Du_To_Index_Ldid(), SNL_GEN_U_Ctiling(), and SNL_INV_Cache_Block().
Definition at line 1187 of file snl_utils.cxx.
References Du_Mgr, LNO_Info_Map, LWN_Copy_Tree(), and TRUE.
Referenced by Rewrite_Bounds(), and Twod_Setbound().
Definition at line 1716 of file snl_utils.cxx.
References Can_Fix_Array_Deps_On_Index_Variable(), FALSE, Fix_Array_Deps_On_Index_Variable(), LWN_Get_Parent, Need_Fix_Array_Deps_On_Index_Variable(), NULL, OPC_DO_LOOP, SNL_Get_Inner_Snl_Loop(), TRUE, and WN_opcode().
Referenced by Minimal_Kernel(), and SNL_Transform().
Definition at line 1114 of file snl_utils.cxx.
References Du_Mgr, i, INT, OPC_BLOCK, OPCODE_operator(), OPR_LDID, DEF_LIST::Set_loop_stmt(), SNL_Fix_Index_Pointers(), DU_MANAGER::Ud_Get_Def(), WN_first(), WN_index, WN_kid(), WN_kid_count(), WN_next(), and WN_opcode().
Referenced by SNL_Fix_Index_Pointers().
Definition at line 1405 of file snl_utils.cxx.
References FmtAssert, INT, Is_True, NULL, OPC_DO_LOOP, OPC_REGION, tmp, WN_do_body, WN_first(), WN_next(), WN_opcode(), and WN_region_body.
Referenced by ARRAY_SNL_INFO::ARRAY_SNL_INFO(), TRANSPOSE_DIRECTED_GRAPH16::Build(), CACHE_REGION::CACHE_REGION(), Code_Expansion_Limit_Loop(), ARA_LOOP_INFO::Const_Work_Estimate(), ARA_LOOP_INFO::Create_New_IF_Clause(), Dismantle_Nested_Doacross(), Do_Automatic_Transformation(), Doacross_Cost(), Fix_Blockable_Dependences(), Forward_Substitute_SNL_Bounds(), Fully_Permutable_Permutation(), General_Kernel(), Has_Code_At_Depth(), HMB_Compound_Guard_And_Hoist(), HMB_Has_Messy_Subscript(), HMB_Hoist_Easy_Messy_Bounds(), HMB_Hoist_Messy_Bounds(), Inv_Dep_Info(), Invariant_Loop_Count(), Invariant_Permutation(), Is_Perfectly_Nested(), Is_Rectangular_Nested_Doacross(), LNO_FB_Inv_Interchange(), SD_INFO::Make_Sd_Info(), SX_INFO::Make_Sx_Info(), Mark_Parallelizable_Loop(), Minimal_Kernel(), MIR_Has_Messy_Subscript(), Mp_Collapse_Loop_Heads(), Mp_Collapse_Loop_Statements(), Mp_Coordinate_Copy_Out_Coordinates(), Mp_Layout_Copy_Out_Layout(), Mp_Layout_Lego_Layout(), Mp_Layout_Load_Pids(), Mp_Nested_Last_Thread(), Mp_Permute_Nested_Loops(), Parallel_Directive_Class(), PAR_STAT::Parallel_Interchange(), Parallel_Interchange(), Parallelizable_At_Depth(), Print_Interchange(), Prompf_Interchange(), Prompf_Interchanges(), Red_Dep_Info(), Scalar_Expansion_Tile(), SE_CT_New_Tile_Infos(), SE_Guard_Tests(), SNL_All_Parallelizable(), SNL_Auto_Parallelization(), SNL_Bad_Scalars_Are_Distributable(), SNL_Cache_Cost(), SNL_Dir_Cannot_Interchange(), SNL_Finalize_Index_Variables(), SNL_Fix_Array_Deps_On_Index_Variable(), SNL_GEN_Distribute(), SNL_GEN_Permute_Loops(), SNL_GEN_Scalar_Expand(), SNL_GEN_U_Ctiling(), SNL_Inner_Exit_Count(), SNL_Inner_Machine_Cost(), SNL_INV_Distribute(), SNL_INV_Distribution(), SNL_INV_Limited_SE_And_Dist(), SNL_INV_Scalar_Expand(), SNL_INV_Scalar_Expand_Tile(), SNL_INV_SE_Distribute(), SNL_INV_Transforms(), SNL_Is_Distributable(), SNL_Is_Scalar_Expandable(), SNL_Machine_Cost(), SNL_Min_Parallel_Overhead_Cost(), SNL_NEST_INFO::SNL_NEST_INFO(), SNL_Parallelization_Costs(), SNL_Peel_Iteration(), SNL_Permutation_Is_Distributable(), SNL_Permutation_Needs_Distribution(), SNL_Transform(), SNL_Upper_Bound_Standardize(), Split_Depth(), Splittable(), Tlog_Lego_Interchange(), Traverse_Update(), and Whack_Do_Loops_Traverse().
Definition at line 1511 of file snl_utils.cxx.
References FmtAssert, Get_Do_Loop_Info(), INT, DO_LOOP_INFO::Is_Inner, NULL, OPC_DO_LOOP, SNL_Innermost_Do(), WN_do_body, WN_first(), WN_next(), and WN_opcode().
Referenced by SNL_Innermost_Do(), and SNL_INV_Limited_Scalar_Expand_And_Distribute().
| BOOL SNL_Is_Invariant | ( | DOLOOP_STACK * | stack, | |
| INT | d, | |||
| INT | dd | |||
| ) |
Definition at line 1452 of file snl_utils.cxx.
References STACK< T >::Bottom_nth(), ACCESS_ARRAY::Dim(), Do_Loop_Depth(), FALSE, Get_Do_Loop_Info(), INT, Is_Loop_Invariant_Exp(), DO_LOOP_INFO::LB, ACCESS_VECTOR::Loop_Coeff(), NULL, ACCESS_ARRAY::Num_Vec(), SNL_Is_Non_Varying_Access_Array(), TRUE, DO_LOOP_INFO::UB, UBexp(), WN_end, and WN_start.
Referenced by Convex_Peeling_Depth(), Doacross_Cost(), Fully_Permutable_Permutation(), HMB_Hoist_Messy_Bounds(), Invariant_Loop_Count(), Invariant_Loops(), Invariant_Permutation(), Is_Rectangular_Nested_Doacross(), SNL_NEST_INFO::SNL_NEST_INFO(), and Statement_Sinkable_Out_Of_Loop().
| BOOL SNL_Is_Non_Varying_Access_Array | ( | ACCESS_ARRAY * | aa, | |
| INT | outer_depth | |||
| ) |
Definition at line 1438 of file snl_utils.cxx.
References ACCESS_VECTOR::Contains_Non_Lin_Symb(), ACCESS_ARRAY::Dim(), FALSE, INT, ACCESS_VECTOR::Non_Const_Loops(), ACCESS_ARRAY::Num_Vec(), ACCESS_VECTOR::Too_Messy, and TRUE.
Referenced by SNL_Is_Invariant(), and SNL_Is_Transformable().
Definition at line 1491 of file snl_utils.cxx.
References FmtAssert, Get_Do_Loop_Info(), INT, DO_LOOP_INFO::Is_Inner, loop_count, NULL, OPC_DO_LOOP, SNL_Loop_Count(), WN_do_body, WN_first(), WN_next(), and WN_opcode().
Referenced by Code_Expansion_Limit_Loop(), ARA_LOOP_INFO::Const_Work_Estimate(), ARA_LOOP_INFO::Create_New_IF_Clause(), ARA_LOOP_INFO::Determine_Peel(), Find_Kernel_Stack_Nest_Traverse(), Forward_Substitute_SNL_Bounds(), HMB_Compound_Guard_And_Hoist(), HMB_Compound_Guard_Test(), HMB_Has_Messy_Subscript(), HMB_Hoist_Easy_Messy_Bounds(), HMB_Simple_Guard_And_Hoist(), Invariant_Loop_Count(), MIR_Has_Messy_Subscript(), Single_Iteration_Cost(), SNL_Auto_Parallelization(), SNL_GEN_U_Ctiling(), SNL_Loop_Count(), and Traverse_Update().
| void SNL_Optimize_Bounds | ( | SNL_REGION | region | ) |
Definition at line 1353 of file snl_utils.cxx.
References SNL_REGION::First, SNL_REGION::Last, NULL, SNL_Optimize_Bounds(), and WN_next().
Definition at line 1134 of file snl_utils.cxx.
References Du_Mgr, i, INT, DEF_LIST::Loop_stmt(), Name, NULL, OPC_BLOCK, OPCODE_operator(), OPR_LDID, printf(), SNL_Print_Ldid_Pointers(), DU_MANAGER::Ud_Get_Def(), WN_first(), WN_index, WN_kid(), WN_kid_count(), WN_next(), and WN_opcode().
Referenced by SNL_Print_Ldid_Pointers().
Definition at line 2373 of file snl_utils.cxx.
References Array_Dependence_Graph, Build_Doloop_Stack(), LNO_Build_Access(), LNO_default_pool, LNO_local_pool, LWN_Get_Parent, and Renumber_Loops().
Referenced by SNL_GEN_2D_Regtile(), SNL_GEN_U_Ctiling(), and SNL_SPL_Split_Tile_Sets().
Referenced by Phase_123(), and WB_check().
Definition at line 1359 of file snl_utils.cxx.
References FALSE, FmtAssert, OPR_GE, OPR_GT, OPR_LDID, OPR_LE, OPR_LT, TRUE, WN_kid0(), WN_kid1(), WN_opcode(), and WN_operator().
Referenced by BND_Upper_Bound(), Gather_Scatter_Scalar_Expand(), Iterations(), Rewrite_Bounds(), RV_Reverse_Index_Ldid(), SE_Upper_Bound(), SNL_GEN_2D_Regtile(), SNL_INV_Cache_Block(), SNL_Is_Transformable(), SNL_Peel_Iteration(), SNL_Regtile_Loop(), SNL_SPL_Propagate_Tiled_Lower_Bound(), SNL_TRANS_INDEX_DATA::SNL_TRANS_INDEX_DATA(), and Twod_Setbound().
Definition at line 1389 of file snl_utils.cxx.
References FmtAssert, OPR_GE, OPR_GT, OPR_LE, OPR_LT, WN_kid0(), WN_kid1(), WN_opcode(), and WN_operator().
Referenced by RV_Easy_Bounds(), and SNL_Is_Transformable().
Definition at line 1587 of file snl_utils.cxx.
References STACK< T >::Bottom_nth(), Build_Doloop_Stack(), Do_Loop_Depth(), i, INT, LNO_local_pool, SNL_Get_Inner_Snl_Loop(), stack, TRUE, Upper_Bound_Standardize(), and WN_end.
Referenced by Auto_Parallelization(), Mark_Auto_Parallelizable_Loops(), and SNL_Phase().
Definition at line 1769 of file snl_utils.cxx.
References BOOL, MAT< T >::Cols(), CXX_DELETE_ARRAY, CXX_NEW_ARRAY, i, INT, Is_Permutation_Vector(), LNO_local_pool, NULL, and MAT< T >::Rows().
Referenced by SNL_GEN_Scalar_Expand(), and SNL_GEN_U_Ctiling().
| BOOL Valid_SNL_Region | ( | SNL_REGION | region | ) |
Definition at line 558 of file snl_utils.cxx.
References FALSE, SNL_REGION::First, SNL_REGION::Last, NULL, TRUE, wn, and WN_next().
Referenced by Do_Automatic_Transformation(), RUL_Region_Update(), SNL_GEN_2D_Regtile(), SNL_GEN_Distribution(), SNL_GEN_U_Ctiling(), SNL_INV_Register_Tile(), SNL_INV_Transforms(), SNL_Regtile_Loop(), SNL_Remove_Unity_Trip_Loop(), and SNL_Remove_Useless_Loops().
Definition at line 530 of file snl_utils.h.
1.5.6