Open64 (mfef90, whirl2f, and IR tools)  TAG: version-openad; SVN changeset: 916
ipa_cost_util.cxx File Reference
#include <elf.h>
#include <sys/elf_whirl.h>
#include <sys/types.h>
#include "defs.h"
#include "mtypes.h"
#include "access_vector.h"
#include "ipl_lno_util.h"
#include "ipl_summary.h"
#include <alloca.h>
#include "ipa_cost_util.h"
#include "be_util.h"
#include "ipa_trace.h"
Include dependency graph for ipa_cost_util.cxx:

Go to the source code of this file.

Functions

static INT IPL_EX_Copy_Expr_Tree (DYN_ARRAY< SUMMARY_VALUE > *sv, DYN_ARRAY< SUMMARY_EXPR > *sx, INT sx_old_index)
INT IPL_EX_New_Constant (DYN_ARRAY< SUMMARY_VALUE > *sv, INT64 constant_value)
INT IPL_EX_New_Value_Expr (DYN_ARRAY< SUMMARY_EXPR > *sx, INT sv_index)
INT IPL_EX_New_Expr_Expr (DYN_ARRAY< SUMMARY_EXPR > *sx, OPERATOR opr, INT sx_index_one, INT sx_index_two)
static INT IPL_EX_Copy_Value (DYN_ARRAY< SUMMARY_VALUE > *sv, INT sv_old_index)
static INT IPL_EX_Copy_Expr (DYN_ARRAY< SUMMARY_EXPR > *sx, INT sx_old_index)
static INT IPL_EX_Set_Expr_Index (DYN_ARRAY< SUMMARY_VALUE > *sv, DYN_ARRAY< SUMMARY_EXPR > *sx, INT sx_old_index, INT kid)
static void Substitute_Expr (DYN_ARRAY< SUMMARY_EXPR > *sx, INT expr_old_index, INT expr_new_index)
static void Eliminate_Expr (DYN_ARRAY< SUMMARY_EXPR > *sx, INT expr_index)
static void Substitute_Expr_Value (DYN_ARRAY< SUMMARY_VALUE > *sv, DYN_ARRAY< SUMMARY_EXPR > *sx, INT expr_old_index, INT value_new_index)
static void Substitute_Value (DYN_ARRAY< SUMMARY_VALUE > *sv, DYN_ARRAY< SUMMARY_EXPR > *sx, INT old_value_index, INT new_value_index)
void IPL_EX_Eliminate_Value (DYN_ARRAY< SUMMARY_VALUE > *sv, DYN_ARRAY< SUMMARY_EXPR > *sx, INT value_index)
static void IPL_EXS_Sort_Exprs (DYN_ARRAY< SUMMARY_VALUE > *sv, DYN_ARRAY< SUMMARY_EXPR > *sx)
BOOL IPL_EXS_Too_Complicated (DYN_ARRAY< SUMMARY_VALUE > *sv, DYN_ARRAY< SUMMARY_EXPR > *sx, INT multiplier)
INT IPL_EXS_Chop_Down_Estimate (DYN_ARRAY< SUMMARY_VALUE > *sv, DYN_ARRAY< SUMMARY_EXPR > *sx)
static void Find_Useless_Exprs_Traverse (INT expr_index, DYN_ARRAY< SUMMARY_VALUE > *sv, DYN_ARRAY< SUMMARY_EXPR > *sx, BOOL *sv_used, BOOL *sx_used)
static void Find_Useless_Exprs (DYN_ARRAY< SUMMARY_VALUE > *sv, DYN_ARRAY< SUMMARY_EXPR > *sx, BOOL *sv_used, BOOL *sx_used)
static void IPL_EXS_Useless (DYN_ARRAY< SUMMARY_VALUE > *sv, DYN_ARRAY< SUMMARY_EXPR > *sx)
static INT64 IPL_EX_Value_Evaluate (DYN_ARRAY< SUMMARY_VALUE > *sv, INT sv_index, BOOL *valid)
static INT64 IPL_EX_Expr_Evaluate (DYN_ARRAY< SUMMARY_VALUE > *sv, DYN_ARRAY< SUMMARY_EXPR > *sx, INT sx_index, BOOL *valid)
static void IPL_EXS_Reassociate (DYN_ARRAY< SUMMARY_VALUE > *sv, DYN_ARRAY< SUMMARY_EXPR > *sx)
static void IPL_EXS_Outer_Fold (DYN_ARRAY< SUMMARY_VALUE > *sv, DYN_ARRAY< SUMMARY_EXPR > *sx)
static void IPL_EXS_Eliminate_Duplicate_Values (DYN_ARRAY< SUMMARY_VALUE > *sv, DYN_ARRAY< SUMMARY_EXPR > *sx)
static void IPL_EXS_Eliminate_Duplicate_Exprs (DYN_ARRAY< SUMMARY_VALUE > *sv, DYN_ARRAY< SUMMARY_EXPR > *sx)
static void IPL_EXS_Inner_Fold (DYN_ARRAY< SUMMARY_VALUE > *sv, DYN_ARRAY< SUMMARY_EXPR > *sx)
static void IPL_EXS_Eliminate_Expr_Identities (DYN_ARRAY< SUMMARY_VALUE > *sv, DYN_ARRAY< SUMMARY_EXPR > *sx)
void IPL_EX_Collapse_Trip_Counts (DYN_ARRAY< SUMMARY_VALUE > *sv, DYN_ARRAY< SUMMARY_EXPR > *sx)
void IPL_EX_Simplify (DYN_ARRAY< SUMMARY_VALUE > *sv, DYN_ARRAY< SUMMARY_EXPR > *sx)
void IPL_EX_Add_Value_Offsets (DYN_ARRAY< SUMMARY_VALUE > *sv, INT formal_offset, INT global_offset)
void IPL_EX_Add_Expr_Offsets (DYN_ARRAY< SUMMARY_EXPR > *sx, INT value_offset, INT expr_offset)
void Print_Exprs (FILE *fp, DYN_ARRAY< SUMMARY_VALUE > *sv, DYN_ARRAY< SUMMARY_EXPR > *sx)
static void Check_Trip_Counts_Traverse (DYN_ARRAY< SUMMARY_VALUE > *sv, DYN_ARRAY< SUMMARY_EXPR > *sx, BOOL sv_used[], BOOL sx_used[], INT expr_index)
static INT Check_Trip_Counts (DYN_ARRAY< SUMMARY_VALUE > *sv, DYN_ARRAY< SUMMARY_EXPR > *sx, FILE *fp)
INT Check_Exprs (DYN_ARRAY< SUMMARY_VALUE > *sv, DYN_ARRAY< SUMMARY_EXPR > *sx, FILE *fp)

Function Documentation

INT Check_Exprs ( DYN_ARRAY< SUMMARY_VALUE > *  sv,
DYN_ARRAY< SUMMARY_EXPR > *  sx,
FILE *  fp 
)

Definition at line 1446 of file ipa_cost_util.cxx.

References Check_Trip_Counts(), and fprintf().

Referenced by IPL_EX_Simplify().

Here is the call graph for this function:

static INT Check_Trip_Counts ( DYN_ARRAY< SUMMARY_VALUE > *  sv,
DYN_ARRAY< SUMMARY_EXPR > *  sx,
FILE *  fp 
) [static]

Definition at line 1399 of file ipa_cost_util.cxx.

References Check_Trip_Counts_Traverse(), FALSE, fprintf(), and TRUE.

Referenced by Check_Exprs().

Here is the call graph for this function:

static void Check_Trip_Counts_Traverse ( DYN_ARRAY< SUMMARY_VALUE > *  sv,
DYN_ARRAY< SUMMARY_EXPR > *  sx,
BOOL  sv_used[],
BOOL  sx_used[],
INT  expr_index 
) [static]

Definition at line 1354 of file ipa_cost_util.cxx.

References TRUE.

Referenced by Check_Trip_Counts().

static void Eliminate_Expr ( DYN_ARRAY< SUMMARY_EXPR > *  sx,
INT  expr_index 
) [static]

Definition at line 378 of file ipa_cost_util.cxx.

References bcopy().

Referenced by IPL_EXS_Eliminate_Duplicate_Exprs(), and IPL_EXS_Useless().

Here is the call graph for this function:

static void Find_Useless_Exprs ( DYN_ARRAY< SUMMARY_VALUE > *  sv,
DYN_ARRAY< SUMMARY_EXPR > *  sx,
BOOL sv_used,
BOOL sx_used 
) [static]

Definition at line 669 of file ipa_cost_util.cxx.

References Find_Useless_Exprs_Traverse(), and TRUE.

Referenced by IPL_EXS_Useless().

Here is the call graph for this function:

static void Find_Useless_Exprs_Traverse ( INT  expr_index,
DYN_ARRAY< SUMMARY_VALUE > *  sv,
DYN_ARRAY< SUMMARY_EXPR > *  sx,
BOOL sv_used,
BOOL sx_used 
) [static]

Definition at line 626 of file ipa_cost_util.cxx.

References TRUE.

Referenced by Find_Useless_Exprs().

void IPL_EX_Add_Expr_Offsets ( DYN_ARRAY< SUMMARY_EXPR > *  sx,
INT  value_offset,
INT  expr_offset 
)

Definition at line 1296 of file ipa_cost_util.cxx.

void IPL_EX_Add_Value_Offsets ( DYN_ARRAY< SUMMARY_VALUE > *  sv,
INT  formal_offset,
INT  global_offset 
)

Definition at line 1277 of file ipa_cost_util.cxx.

void IPL_EX_Collapse_Trip_Counts ( DYN_ARRAY< SUMMARY_VALUE > *  sv,
DYN_ARRAY< SUMMARY_EXPR > *  sx 
)

Definition at line 1188 of file ipa_cost_util.cxx.

References IPL_EXS_Useless(), MTYPE_I4, MTYPE_V, and OPR_ADD.

Here is the call graph for this function:

static INT IPL_EX_Copy_Expr ( DYN_ARRAY< SUMMARY_EXPR > *  sx,
INT  sx_old_index 
) [static]

Definition at line 154 of file ipa_cost_util.cxx.

References bcopy().

Referenced by IPL_EX_Copy_Expr_Tree().

Here is the call graph for this function:

static INT IPL_EX_Copy_Expr_Tree ( DYN_ARRAY< SUMMARY_VALUE > *  sv,
DYN_ARRAY< SUMMARY_EXPR > *  sx,
INT  sx_old_index 
) [static]

Definition at line 198 of file ipa_cost_util.cxx.

References IPL_EX_Copy_Expr(), and IPL_EX_Set_Expr_Index().

Referenced by IPL_EX_Set_Expr_Index(), and IPL_EXS_Reassociate().

Here is the call graph for this function:

static INT IPL_EX_Copy_Value ( DYN_ARRAY< SUMMARY_VALUE > *  sv,
INT  sv_old_index 
) [static]

Definition at line 137 of file ipa_cost_util.cxx.

References bcopy().

Referenced by IPL_EX_Set_Expr_Index().

Here is the call graph for this function:

void IPL_EX_Eliminate_Value ( DYN_ARRAY< SUMMARY_VALUE > *  sv,
DYN_ARRAY< SUMMARY_EXPR > *  sx,
INT  value_index 
)

Definition at line 471 of file ipa_cost_util.cxx.

References bcopy().

Referenced by IPL_EXS_Eliminate_Duplicate_Values(), and IPL_EXS_Useless().

Here is the call graph for this function:

static INT64 IPL_EX_Expr_Evaluate ( DYN_ARRAY< SUMMARY_VALUE > *  sv,
DYN_ARRAY< SUMMARY_EXPR > *  sx,
INT  sx_index,
BOOL valid 
) [static]

Definition at line 748 of file ipa_cost_util.cxx.

References FALSE, IPL_EX_Value_Evaluate(), OPCODE_operator(), OPR_ADD, OPR_DIV, OPR_MPY, and OPR_SUB.

Referenced by IPL_EXS_Inner_Fold(), IPL_EXS_Outer_Fold(), and IPL_EXS_Reassociate().

Here is the call graph for this function:

INT IPL_EX_New_Constant ( DYN_ARRAY< SUMMARY_VALUE > *  sv,
INT64  constant_value 
)

Definition at line 66 of file ipa_cost_util.cxx.

References MTYPE_I4.

Referenced by IPL_EXS_Chop_Down_Estimate(), IPL_EXS_Outer_Fold(), and IPL_EXS_Reassociate().

INT IPL_EX_New_Expr_Expr ( DYN_ARRAY< SUMMARY_EXPR > *  sx,
OPERATOR  opr,
INT  sx_index_one,
INT  sx_index_two 
)

Definition at line 110 of file ipa_cost_util.cxx.

References MTYPE_I4, and MTYPE_V.

INT IPL_EX_New_Value_Expr ( DYN_ARRAY< SUMMARY_EXPR > *  sx,
INT  sv_index 
)

Definition at line 86 of file ipa_cost_util.cxx.

References MTYPE_I4, MTYPE_V, and OPR_ADD.

Referenced by IPL_EXS_Chop_Down_Estimate(), and IPL_EXS_Reassociate().

static INT IPL_EX_Set_Expr_Index ( DYN_ARRAY< SUMMARY_VALUE > *  sv,
DYN_ARRAY< SUMMARY_EXPR > *  sx,
INT  sx_old_index,
INT  kid 
) [static]

Definition at line 171 of file ipa_cost_util.cxx.

References FALSE, FmtAssert, IPL_EX_Copy_Expr_Tree(), and IPL_EX_Copy_Value().

Referenced by IPL_EX_Copy_Expr_Tree().

Here is the call graph for this function:

static INT64 IPL_EX_Value_Evaluate ( DYN_ARRAY< SUMMARY_VALUE > *  sv,
INT  sv_index,
BOOL valid 
) [static]

Definition at line 724 of file ipa_cost_util.cxx.

References FALSE, FmtAssert, and St_Idx_Is_Intconst().

Referenced by IPL_EX_Expr_Evaluate(), IPL_EXS_Inner_Fold(), and IPL_EXS_Outer_Fold().

Here is the call graph for this function:

INT IPL_EXS_Chop_Down_Estimate ( DYN_ARRAY< SUMMARY_VALUE > *  sv,
DYN_ARRAY< SUMMARY_EXPR > *  sx 
)

Definition at line 606 of file ipa_cost_util.cxx.

References IPL_EX_New_Constant(), and IPL_EX_New_Value_Expr().

Referenced by IPL_EX_Simplify(), and IPL_EXS_Reassociate().

Here is the call graph for this function:

static void IPL_EXS_Eliminate_Duplicate_Exprs ( DYN_ARRAY< SUMMARY_VALUE > *  sv,
DYN_ARRAY< SUMMARY_EXPR > *  sx 
) [static]

Definition at line 1033 of file ipa_cost_util.cxx.

References Eliminate_Expr(), fprintf(), Get_Trace(), Print_Exprs(), Substitute_Expr(), TP_IPA, and TP_IPL.

Referenced by IPL_EX_Simplify().

Here is the call graph for this function:

static void IPL_EXS_Eliminate_Duplicate_Values ( DYN_ARRAY< SUMMARY_VALUE > *  sv,
DYN_ARRAY< SUMMARY_EXPR > *  sx 
) [static]

Definition at line 1003 of file ipa_cost_util.cxx.

References fprintf(), Get_Trace(), IPL_EX_Eliminate_Value(), Print_Exprs(), Substitute_Value(), TP_IPA, and TP_IPL.

Referenced by IPL_EX_Simplify().

Here is the call graph for this function:

static void IPL_EXS_Eliminate_Expr_Identities ( DYN_ARRAY< SUMMARY_VALUE > *  sv,
DYN_ARRAY< SUMMARY_EXPR > *  sx 
) [static]

Definition at line 1135 of file ipa_cost_util.cxx.

References FALSE, fprintf(), Get_Trace(), IPL_EXS_Useless(), OPCODE_operator(), OPR_ADD, OPR_DIV, OPR_MPY, OPR_SUB, Print_Exprs(), Substitute_Expr(), Substitute_Expr_Value(), TP_IPA, TP_IPL, and TRUE.

Referenced by IPL_EX_Simplify().

Here is the call graph for this function:

static void IPL_EXS_Inner_Fold ( DYN_ARRAY< SUMMARY_VALUE > *  sv,
DYN_ARRAY< SUMMARY_EXPR > *  sx 
) [static]

Definition at line 1063 of file ipa_cost_util.cxx.

References FALSE, fprintf(), Get_Trace(), IPL_EX_Expr_Evaluate(), IPL_EX_Value_Evaluate(), IPL_EXS_Sort_Exprs(), IPL_EXS_Useless(), Print_Exprs(), TP_IPA, TP_IPL, and TRUE.

Referenced by IPL_EX_Simplify().

Here is the call graph for this function:

static void IPL_EXS_Outer_Fold ( DYN_ARRAY< SUMMARY_VALUE > *  sv,
DYN_ARRAY< SUMMARY_EXPR > *  sx 
) [static]
static void IPL_EXS_Reassociate ( DYN_ARRAY< SUMMARY_VALUE > *  sv,
DYN_ARRAY< SUMMARY_EXPR > *  sx 
) [static]
static void IPL_EXS_Sort_Exprs ( DYN_ARRAY< SUMMARY_VALUE > *  sv,
DYN_ARRAY< SUMMARY_EXPR > *  sx 
) [static]

Definition at line 507 of file ipa_cost_util.cxx.

References bcopy(), fprintf(), Get_Trace(), Print_Exprs(), TP_IPA, and TP_IPL.

Referenced by IPL_EX_Simplify(), IPL_EXS_Inner_Fold(), IPL_EXS_Outer_Fold(), and IPL_EXS_Reassociate().

Here is the call graph for this function:

BOOL IPL_EXS_Too_Complicated ( DYN_ARRAY< SUMMARY_VALUE > *  sv,
DYN_ARRAY< SUMMARY_EXPR > *  sx,
INT  multiplier 
)

Definition at line 592 of file ipa_cost_util.cxx.

Referenced by IPL_EX_Simplify(), and IPL_EXS_Reassociate().

static void IPL_EXS_Useless ( DYN_ARRAY< SUMMARY_VALUE > *  sv,
DYN_ARRAY< SUMMARY_EXPR > *  sx 
) [static]
static void Substitute_Expr ( DYN_ARRAY< SUMMARY_EXPR > *  sx,
INT  expr_old_index,
INT  expr_new_index 
) [static]
static void Substitute_Expr_Value ( DYN_ARRAY< SUMMARY_VALUE > *  sv,
DYN_ARRAY< SUMMARY_EXPR > *  sx,
INT  expr_old_index,
INT  value_new_index 
) [static]

Definition at line 411 of file ipa_cost_util.cxx.

Referenced by IPL_EXS_Eliminate_Expr_Identities().

static void Substitute_Value ( DYN_ARRAY< SUMMARY_VALUE > *  sv,
DYN_ARRAY< SUMMARY_EXPR > *  sx,
INT  old_value_index,
INT  new_value_index 
) [static]

Definition at line 446 of file ipa_cost_util.cxx.

Referenced by IPL_EXS_Eliminate_Duplicate_Values().

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines