2010-05-30 Zoltan Varga <vargaz@gmail.com>
[mono.git] / mono / mini / ssapre.h
index 22646c6d4e87b4500bb83e4658013dda2513996f..1a4ca55f7749618bd14a4c320f8139a5b47fc6f0 100644 (file)
@@ -136,7 +136,14 @@ typedef struct MonoSsapreBBInfo {
        /* (the last existing phi definition, or NULL if there is none) */
        MonoInst *phi_insertion_point;
        
-       /* Information reused during the analysis of each expression: */
+       /* Information recomputed during the analysis of each expression: */
+       
+       /* True if the whole BB subtree in the dominator tree is "covered" with */
+       /* BBs marked "interesting" (a BB where this is false cannot be down */
+       /* safe, since there would be a path to exit with no occurrence at all). */
+       /* A more formal way of stating this is that on the DT there is no path */
+       /* from this BB to any leaf that does not meet an interesting BB */
+       gboolean dt_covered_by_interesting_BBs;
        
        /* True if this BB has a PHI occurrence */
        gboolean has_phi;
@@ -155,7 +162,6 @@ typedef struct MonoSsapreBBInfo {
        /* Array of the class numbers of the PHI arguments (has "in_count" elements) */
        int *phi_arguments_classes;
        
-       
        /* True if this BB has a PHI argument */
        gboolean has_phi_argument;
        /* True if this PHI argument "has real use" */
@@ -364,6 +370,9 @@ typedef struct MonoSsapreWorkArea {
        MonoBitSet *left_argument_bb_bitset;
        MonoBitSet *right_argument_bb_bitset;
        
+       /* The depth of the dominator tree */
+       int dt_depth;
+       
        /* The expression worklist */
        MonoSsapreExpression *worklist;
        
@@ -389,6 +398,12 @@ typedef struct MonoSsapreWorkArea {
        /* The number of generated class numbers */
        int number_of_classes;
        
+       /* The number of occurrences scheduled for reloading/insertion */
+       /* (used to decide if the redundancy is worth eliminating) */
+       int occurrences_scheduled_for_reloading;
+       int arguments_scheduled_for_insertion;
+       int dominating_arguments_scheduled_for_insertion;
+       
        /* Statistics fields (per expression)  */
        int saved_occurrences;
        int reloaded_occurrences;