1 | // Licensed to the .NET Foundation under one or more agreements. |
2 | // The .NET Foundation licenses this file to you under the MIT license. |
3 | // See the LICENSE file in the project root for more information. |
4 | // |
5 | // File: CompPhases.h |
6 | // |
7 | |
8 | // |
9 | // Names of x86 JIT phases, in order. Assumes that the caller defines CompPhaseNameMacro |
10 | // in a useful way before including this file, e.g., to define the phase enumeration and the |
11 | // corresponding array of string names of those phases. This include file undefines CompPhaseNameMacro |
12 | // after the last use. |
13 | // The arguments are: |
14 | // CompPhaseNameMacro(enumName, stringName, shortName, hasChildren, parent, measureIR) |
15 | // "enumName" is an Enumeration-style all-caps name. |
16 | // "stringName" is a self-explanatory. |
17 | // "shortName" is an abbreviated form for stringName |
18 | // "hasChildren" is true if this phase is broken out into subphases. |
19 | // (We should never do EndPhase on a phase that has children, only on 'leaf phases.') |
20 | // "parent" is -1 for leaf phases, otherwise it is the "enumName" of the parent phase. |
21 | // "measureIR" is true for phases that generate a count of IR nodes during EndPhase when JitConfig.MeasureIR is |
22 | // true. |
23 | |
24 | // clang-format off |
25 | // enumName stringName shortName hasChildren measureIR |
26 | // parent |
27 | CompPhaseNameMacro(PHASE_PRE_IMPORT, "Pre-import" , "PRE-IMP" , false, -1, false) |
28 | CompPhaseNameMacro(PHASE_IMPORTATION, "Importation" , "IMPORT" , false, -1, true) |
29 | CompPhaseNameMacro(PHASE_POST_IMPORT, "Post-import" , "POST-IMP" , false, -1, false) |
30 | CompPhaseNameMacro(PHASE_MORPH_INIT, "Morph - Init" , "MOR-INIT" ,false, -1, false) |
31 | CompPhaseNameMacro(PHASE_MORPH_INLINE, "Morph - Inlining" , "MOR-INL" , false, -1, true) |
32 | CompPhaseNameMacro(PHASE_ALLOCATE_OBJECTS, "Allocate Objects" , "ALLOC-OBJ" , false, -1, false) |
33 | CompPhaseNameMacro(PHASE_EMPTY_TRY, "Remove empty try" , "EMPTYTRY" , false, -1, false) |
34 | CompPhaseNameMacro(PHASE_EMPTY_FINALLY, "Remove empty finally" , "EMPTYFIN" , false, -1, false) |
35 | CompPhaseNameMacro(PHASE_MERGE_FINALLY_CHAINS, "Merge callfinally chains" , "MRGCFCHN" , false, -1, false) |
36 | CompPhaseNameMacro(PHASE_CLONE_FINALLY, "Clone finally" , "CLONEFIN" , false, -1, false) |
37 | CompPhaseNameMacro(PHASE_STR_ADRLCL, "Morph - Structs/AddrExp" , "MOR-STRAL" ,false, -1, false) |
38 | CompPhaseNameMacro(PHASE_MORPH_IMPBYREF, "Morph - ByRefs" , "MOR-BYREF" ,false, -1, false) |
39 | CompPhaseNameMacro(PHASE_MORPH_GLOBAL, "Morph - Global" , "MOR-GLOB" , false, -1, false) |
40 | CompPhaseNameMacro(PHASE_MORPH_END, "Morph - Finish" , "MOR-END" , false, -1, true) |
41 | CompPhaseNameMacro(PHASE_GS_COOKIE, "GS Cookie" , "GS-COOK" , false, -1, false) |
42 | CompPhaseNameMacro(PHASE_COMPUTE_PREDS, "Compute preds" , "PREDS" , false, -1, false) |
43 | CompPhaseNameMacro(PHASE_MARK_GC_POLL_BLOCKS, "Mark GC poll blocks" , "GC-POLL" , false, -1, false) |
44 | CompPhaseNameMacro(PHASE_COMPUTE_EDGE_WEIGHTS, "Compute edge weights (1, false)" , "EDG-WGT" , false, -1, false) |
45 | #if FEATURE_EH_FUNCLETS |
46 | CompPhaseNameMacro(PHASE_CREATE_FUNCLETS, "Create EH funclets" , "EH-FUNC" , false, -1, false) |
47 | #endif // FEATURE_EH_FUNCLETS |
48 | CompPhaseNameMacro(PHASE_OPTIMIZE_LAYOUT, "Optimize layout" , "LAYOUT" , false, -1, false) |
49 | CompPhaseNameMacro(PHASE_COMPUTE_REACHABILITY, "Compute blocks reachability" , "BL_REACH" , false, -1, false) |
50 | CompPhaseNameMacro(PHASE_OPTIMIZE_LOOPS, "Optimize loops" , "LOOP-OPT" , false, -1, false) |
51 | CompPhaseNameMacro(PHASE_CLONE_LOOPS, "Clone loops" , "LP-CLONE" , false, -1, false) |
52 | CompPhaseNameMacro(PHASE_UNROLL_LOOPS, "Unroll loops" , "UNROLL" , false, -1, false) |
53 | CompPhaseNameMacro(PHASE_HOIST_LOOP_CODE, "Hoist loop code" , "LP-HOIST" , false, -1, false) |
54 | CompPhaseNameMacro(PHASE_MARK_LOCAL_VARS, "Mark local vars" , "MARK-LCL" , false, -1, false) |
55 | CompPhaseNameMacro(PHASE_OPTIMIZE_BOOLS, "Optimize bools" , "OPT-BOOL" , false, -1, false) |
56 | CompPhaseNameMacro(PHASE_FIND_OPER_ORDER, "Find oper order" , "OPER-ORD" , false, -1, false) |
57 | CompPhaseNameMacro(PHASE_SET_BLOCK_ORDER, "Set block order" , "BLK-ORD" , false, -1, true) |
58 | CompPhaseNameMacro(PHASE_BUILD_SSA, "Build SSA representation" , "SSA" , true, -1, false) |
59 | CompPhaseNameMacro(PHASE_BUILD_SSA_TOPOSORT, "SSA: topological sort" , "SSA-SORT" , false, PHASE_BUILD_SSA, false) |
60 | CompPhaseNameMacro(PHASE_BUILD_SSA_DOMS, "SSA: Doms1" , "SSA-DOMS" , false, PHASE_BUILD_SSA, false) |
61 | CompPhaseNameMacro(PHASE_BUILD_SSA_LIVENESS, "SSA: liveness" , "SSA-LIVE" , false, PHASE_BUILD_SSA, false) |
62 | CompPhaseNameMacro(PHASE_BUILD_SSA_DF, "SSA: DF" , "SSA-DF" , false, PHASE_BUILD_SSA, false) |
63 | CompPhaseNameMacro(PHASE_BUILD_SSA_INSERT_PHIS, "SSA: insert phis" , "SSA-PHI" , false, PHASE_BUILD_SSA, false) |
64 | CompPhaseNameMacro(PHASE_BUILD_SSA_RENAME, "SSA: rename" , "SSA-REN" , false, PHASE_BUILD_SSA, false) |
65 | |
66 | CompPhaseNameMacro(PHASE_EARLY_PROP, "Early Value Propagation" , "ERL-PROP" , false, -1, false) |
67 | CompPhaseNameMacro(PHASE_VALUE_NUMBER, "Do value numbering" , "VAL-NUM" , false, -1, false) |
68 | |
69 | CompPhaseNameMacro(PHASE_OPTIMIZE_INDEX_CHECKS, "Optimize index checks" , "OPT-CHK" , false, -1, false) |
70 | |
71 | #if FEATURE_VALNUM_CSE |
72 | CompPhaseNameMacro(PHASE_OPTIMIZE_VALNUM_CSES, "Optimize Valnum CSEs" , "OPT-CSE" , false, -1, false) |
73 | #endif |
74 | |
75 | CompPhaseNameMacro(PHASE_VN_COPY_PROP, "VN based copy prop" , "CP-PROP" , false, -1, false) |
76 | #if ASSERTION_PROP |
77 | CompPhaseNameMacro(PHASE_ASSERTION_PROP_MAIN, "Assertion prop" , "AST-PROP" , false, -1, false) |
78 | #endif |
79 | CompPhaseNameMacro(PHASE_UPDATE_FLOW_GRAPH, "Update flow graph" , "UPD-FG" , false, -1, false) |
80 | CompPhaseNameMacro(PHASE_COMPUTE_EDGE_WEIGHTS2, "Compute edge weights (2, false)" , "EDG-WGT2" , false, -1, false) |
81 | CompPhaseNameMacro(PHASE_DETERMINE_FIRST_COLD_BLOCK, "Determine first cold block" , "COLD-BLK" , false, -1, true) |
82 | CompPhaseNameMacro(PHASE_RATIONALIZE, "Rationalize IR" , "RAT" , false, -1, false) |
83 | CompPhaseNameMacro(PHASE_SIMPLE_LOWERING, "Do 'simple' lowering" , "SMP-LWR" , false, -1, false) |
84 | |
85 | CompPhaseNameMacro(PHASE_LCLVARLIVENESS, "Local var liveness" , "LIVENESS" , true, -1, false) |
86 | CompPhaseNameMacro(PHASE_LCLVARLIVENESS_INIT, "Local var liveness init" , "LIV-INIT" , false, PHASE_LCLVARLIVENESS, false) |
87 | CompPhaseNameMacro(PHASE_LCLVARLIVENESS_PERBLOCK,"Per block local var liveness" , "LIV-BLK" , false, PHASE_LCLVARLIVENESS, false) |
88 | CompPhaseNameMacro(PHASE_LCLVARLIVENESS_INTERBLOCK, "Global local var liveness" , "LIV-GLBL" , false, PHASE_LCLVARLIVENESS, false) |
89 | |
90 | CompPhaseNameMacro(PHASE_LOWERING_DECOMP, "Lowering decomposition" , "LWR-DEC" , false, -1, false) |
91 | CompPhaseNameMacro(PHASE_LOWERING, "Lowering nodeinfo" , "LWR-INFO" , false, -1, true) |
92 | CompPhaseNameMacro(PHASE_STACK_LEVEL_SETTER, "Calculate stack level slots" , "STK-SET" , false, -1, false) |
93 | CompPhaseNameMacro(PHASE_LINEAR_SCAN, "Linear scan register alloc" , "LSRA" , true, -1, true) |
94 | CompPhaseNameMacro(PHASE_LINEAR_SCAN_BUILD, "LSRA build intervals" , "LSRA-BLD" , false, PHASE_LINEAR_SCAN, false) |
95 | CompPhaseNameMacro(PHASE_LINEAR_SCAN_ALLOC, "LSRA allocate" , "LSRA-ALL" , false, PHASE_LINEAR_SCAN, false) |
96 | CompPhaseNameMacro(PHASE_LINEAR_SCAN_RESOLVE, "LSRA resolve" , "LSRA-RES" , false, PHASE_LINEAR_SCAN, false) |
97 | CompPhaseNameMacro(PHASE_GENERATE_CODE, "Generate code" , "CODEGEN" , false, -1, false) |
98 | CompPhaseNameMacro(PHASE_EMIT_CODE, "Emit code" , "EMIT" , false, -1, false) |
99 | CompPhaseNameMacro(PHASE_EMIT_GCEH, "Emit GC+EH tables" , "EMT-GCEH" , false, -1, false) |
100 | |
101 | #if MEASURE_CLRAPI_CALLS |
102 | // The following is a "pseudo-phase" - it aggregates timing info |
103 | // for calls through ICorJitInfo across all "real" phases. |
104 | CompPhaseNameMacro(PHASE_CLR_API, "CLR API calls" , "CLR-API" , false, -1, false) |
105 | #endif |
106 | // clang-format on |
107 | |
108 | #undef CompPhaseNameMacro |
109 | |