< prev index next >

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/ComputeBlockOrder.java

Print this page
rev 52509 : [mq]: graal

@@ -141,15 +141,15 @@
                 // We are at a merge. Check probabilities of predecessors that are not yet
                 // scheduled.
                 double unscheduledSum = 0.0;
                 for (T pred : mostLikelySuccessor.getPredecessors()) {
                     if (pred.getLinearScanNumber() == -1) {
-                        unscheduledSum += pred.probability();
+                        unscheduledSum += pred.getRelativeFrequency();
                     }
                 }
 
-                if (unscheduledSum > block.probability() / PENALTY_VERSUS_UNSCHEDULED) {
+                if (unscheduledSum > block.getRelativeFrequency() / PENALTY_VERSUS_UNSCHEDULED) {
                     // Add this merge only after at least one additional predecessor gets scheduled.
                     visitedBlocks.clear(mostLikelySuccessor.getId());
                     return null;
                 }
             }

@@ -210,12 +210,12 @@
      * Find the highest likely unvisited successor block of a given block.
      */
     private static <T extends AbstractBlockBase<T>> T findAndMarkMostLikelySuccessor(T block, BitSet visitedBlocks) {
         T result = null;
         for (T successor : block.getSuccessors()) {
-            assert successor.probability() >= 0.0 : "Probabilities must be positive";
-            if (!visitedBlocks.get(successor.getId()) && successor.getLoopDepth() >= block.getLoopDepth() && (result == null || successor.probability() >= result.probability())) {
+            assert successor.getRelativeFrequency() >= 0.0 : "Relative frequencies must be positive";
+            if (!visitedBlocks.get(successor.getId()) && successor.getLoopDepth() >= block.getLoopDepth() && (result == null || successor.getRelativeFrequency() >= result.getRelativeFrequency())) {
                 result = successor;
             }
         }
         if (result != null) {
             visitedBlocks.set(result.getId());

@@ -259,19 +259,19 @@
 
         @Override
         public int compare(T a, T b) {
             // Loop blocks before any loop exit block. The only exception are blocks that are
             // (almost) impossible to reach.
-            if (a.probability() > EPSILON && b.probability() > EPSILON) {
+            if (a.getRelativeFrequency() > EPSILON && b.getRelativeFrequency() > EPSILON) {
                 int diff = b.getLoopDepth() - a.getLoopDepth();
                 if (diff != 0) {
                     return diff;
                 }
             }
 
             // Blocks with high probability before blocks with low probability.
-            if (a.probability() > b.probability()) {
+            if (a.getRelativeFrequency() > b.getRelativeFrequency()) {
                 return -1;
             } else {
                 return 1;
             }
         }
< prev index next >