#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"
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) |
Definition at line 1446 of file ipa_cost_util.cxx.
References Check_Trip_Counts(), fprintf(), and DYN_ARRAY< T >::Lastidx().
Referenced by IPL_EX_Simplify().

| 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(), DYN_ARRAY< T >::Lastidx(), and TRUE.
Referenced by Check_Exprs().

| 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.
Referenced by Check_Trip_Counts().
Definition at line 378 of file ipa_cost_util.cxx.
References bcopy(), DYN_ARRAY< T >::Decidx(), and DYN_ARRAY< T >::Lastidx().
Referenced by IPL_EXS_Eliminate_Duplicate_Exprs(), and IPL_EXS_Useless().

| 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 DYN_ARRAY< T >::Lastidx().
Referenced by IPL_EXS_Useless().

| 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.
Referenced by Find_Useless_Exprs().
Definition at line 1296 of file ipa_cost_util.cxx.
References DYN_ARRAY< T >::Lastidx().

| 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.
References DYN_ARRAY< T >::Lastidx().

| 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 DEFAULT_TRIP_COUNT, IPL_EXS_Useless(), DYN_ARRAY< T >::Lastidx(), MTYPE_I4, MTYPE_V, DYN_ARRAY< T >::Newidx(), OPCODE_make_op(), and OPR_ADD.

Definition at line 154 of file ipa_cost_util.cxx.
References bcopy(), and DYN_ARRAY< T >::Newidx().
Referenced by IPL_EX_Copy_Expr_Tree().

| 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().

Definition at line 137 of file ipa_cost_util.cxx.
References bcopy(), and DYN_ARRAY< T >::Newidx().
Referenced by IPL_EX_Set_Expr_Index().

| 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(), DYN_ARRAY< T >::Decidx(), and DYN_ARRAY< T >::Lastidx().
Referenced by IPL_EXS_Eliminate_Duplicate_Values(), and IPL_EXS_Useless().

| 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 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().

Definition at line 66 of file ipa_cost_util.cxx.
References MTYPE_I4, and DYN_ARRAY< T >::Newidx().
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_V, DYN_ARRAY< T >::Newidx(), and OPCODE_make_op().

Definition at line 86 of file ipa_cost_util.cxx.
References MTYPE_V, DYN_ARRAY< T >::Newidx(), OPCODE_make_op(), 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().

Definition at line 1234 of file ipa_cost_util.cxx.
References Check_Exprs(), fprintf(), Get_Trace(), IPL_EXS_Chop_Down_Estimate(), IPL_EXS_Eliminate_Duplicate_Exprs(), IPL_EXS_Eliminate_Duplicate_Values(), IPL_EXS_Eliminate_Expr_Identities(), IPL_EXS_Inner_Fold(), IPL_EXS_Outer_Fold(), IPL_EXS_Reassociate(), IPL_EXS_Sort_Exprs(), IPL_EXS_Too_Complicated(), IPL_EXS_Useless(), Print_Exprs(), TP_IPA, and TP_IPL.

| 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 FmtAssert, and St_Idx_Is_Intconst().
Referenced by IPL_EX_Expr_Evaluate(), IPL_EXS_Inner_Fold(), and IPL_EXS_Outer_Fold().

Definition at line 606 of file ipa_cost_util.cxx.
References DEFAULT_TRIP_COUNT, IPL_EX_New_Constant(), IPL_EX_New_Value_Expr(), and DYN_ARRAY< T >::Resetidx().
Referenced by IPL_EX_Simplify(), and IPL_EXS_Reassociate().

| 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(), DYN_ARRAY< T >::Lastidx(), Print_Exprs(), Substitute_Expr(), TP_IPA, and TP_IPL.
Referenced by IPL_EX_Simplify().

| 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(), DYN_ARRAY< T >::Lastidx(), Print_Exprs(), Substitute_Value(), TP_IPA, and TP_IPL.
Referenced by IPL_EX_Simplify().

| 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 fprintf(), Get_Trace(), IPL_EXS_Useless(), DYN_ARRAY< T >::Lastidx(), 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().

| 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 fprintf(), Get_Trace(), IPL_EX_Expr_Evaluate(), IPL_EX_Value_Evaluate(), IPL_EXS_Sort_Exprs(), IPL_EXS_Useless(), DYN_ARRAY< T >::Lastidx(), Print_Exprs(), TP_IPA, and TP_IPL.
Referenced by IPL_EX_Simplify().

| static void IPL_EXS_Outer_Fold | ( | DYN_ARRAY< SUMMARY_VALUE > * | sv, | |
| DYN_ARRAY< SUMMARY_EXPR > * | sx | |||
| ) | [static] |
Definition at line 911 of file ipa_cost_util.cxx.
References FALSE, FmtAssert, fprintf(), Get_Trace(), IPL_EX_Expr_Evaluate(), IPL_EX_New_Constant(), IPL_EX_Value_Evaluate(), IPL_EXS_Sort_Exprs(), IPL_EXS_Useless(), DYN_ARRAY< T >::Lastidx(), MTYPE_V, OPCODE_make_op(), OPCODE_operator(), OPR_ADD, OPR_DIV, OPR_MPY, OPR_SUB, Print_Exprs(), TP_IPA, and TP_IPL.
Referenced by IPL_EX_Simplify().

| static void IPL_EXS_Reassociate | ( | DYN_ARRAY< SUMMARY_VALUE > * | sv, | |
| DYN_ARRAY< SUMMARY_EXPR > * | sx | |||
| ) | [static] |
Definition at line 816 of file ipa_cost_util.cxx.
References fprintf(), Get_Trace(), IPL_EX_Copy_Expr_Tree(), IPL_EX_Expr_Evaluate(), IPL_EX_New_Constant(), IPL_EX_New_Value_Expr(), IPL_EXS_Chop_Down_Estimate(), IPL_EXS_Sort_Exprs(), IPL_EXS_Too_Complicated(), IPL_EXS_Useless(), DYN_ARRAY< T >::Lastidx(), OPCODE_operator(), OPR_ADD, OPR_SUB, Print_Exprs(), TP_IPA, and TP_IPL.
Referenced by IPL_EX_Simplify().

| 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 DYN_ARRAY< T >::AddElement(), bcopy(), fprintf(), Get_Trace(), DYN_ARRAY< T >::Lastidx(), Print_Exprs(), DYN_ARRAY< T >::Resetidx(), TP_IPA, and TP_IPL.
Referenced by IPL_EX_Simplify(), IPL_EXS_Inner_Fold(), IPL_EXS_Outer_Fold(), and IPL_EXS_Reassociate().

| 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.
References DYN_ARRAY< T >::Lastidx(), MAX_EXPR_COUNT, and MAX_VALUE_COUNT.
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] |
Definition at line 685 of file ipa_cost_util.cxx.
References Eliminate_Expr(), FALSE, Find_Useless_Exprs(), fprintf(), Get_Trace(), IPL_EX_Eliminate_Value(), DYN_ARRAY< T >::Lastidx(), Print_Exprs(), TP_IPA, and TP_IPL.
Referenced by IPL_EX_Collapse_Trip_Counts(), IPL_EX_Simplify(), IPL_EXS_Eliminate_Expr_Identities(), IPL_EXS_Inner_Fold(), IPL_EXS_Outer_Fold(), and IPL_EXS_Reassociate().

Definition at line 1329 of file ipa_cost_util.cxx.
References DYN_ARRAY< T >::Lastidx().
Referenced by IPL_EX_Simplify(), IPL_EXS_Eliminate_Duplicate_Exprs(), IPL_EXS_Eliminate_Duplicate_Values(), IPL_EXS_Eliminate_Expr_Identities(), IPL_EXS_Inner_Fold(), IPL_EXS_Outer_Fold(), IPL_EXS_Reassociate(), IPL_EXS_Sort_Exprs(), and IPL_EXS_Useless().

| static void Substitute_Expr | ( | DYN_ARRAY< SUMMARY_EXPR > * | sx, | |
| INT | expr_old_index, | |||
| INT | expr_new_index | |||
| ) | [static] |
Definition at line 350 of file ipa_cost_util.cxx.
References DYN_ARRAY< T >::Lastidx().
Referenced by IPL_EXS_Eliminate_Duplicate_Exprs(), and IPL_EXS_Eliminate_Expr_Identities().

| 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.
References DYN_ARRAY< T >::Lastidx().
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.
References DYN_ARRAY< T >::Lastidx().
Referenced by IPL_EXS_Eliminate_Duplicate_Values().

1.7.1