@@ -28,26 +28,17 @@ void Compiler::fgPrintEdgeWeights()
28
28
29
29
printf(FMT_BB " ", bSrc->bbNum);
30
30
31
- if (edge->edgeWeightMin() < BB_MAX_WEIGHT)
31
+ const weight_t weight = edge->getLikelyWeight();
32
+
33
+ if (weight < BB_MAX_WEIGHT)
32
34
{
33
- printf("(%f", edge->edgeWeightMin() );
35
+ printf("(%f) ", weight );
34
36
}
35
37
else
36
38
{
37
- printf("(MAX");
38
- }
39
- if (edge->edgeWeightMin() != edge->edgeWeightMax())
40
- {
41
- if (edge->edgeWeightMax() < BB_MAX_WEIGHT)
42
- {
43
- printf("..%f", edge->edgeWeightMax());
44
- }
45
- else
46
- {
47
- printf("..MAX");
48
- }
39
+ printf("(MAX)");
49
40
}
50
- printf(")");
41
+
51
42
if (edge->getNextPredEdge() != nullptr)
52
43
{
53
44
printf(", ");
@@ -735,7 +726,6 @@ bool Compiler::fgDumpFlowGraph(Phases phase, PhasePosition pos)
735
726
JITDUMP("Writing out flow graph %s phase %s\n", (pos == PhasePosition::PrePhase) ? "before" : "after",
736
727
PhaseNames[phase]);
737
728
738
- bool validWeights = fgHaveValidEdgeWeights;
739
729
double weightDivisor = (double)BasicBlock::getCalledCount(this);
740
730
const char* escapedString;
741
731
const char* regionString = "NONE";
@@ -791,14 +781,6 @@ bool Compiler::fgDumpFlowGraph(Phases phase, PhasePosition pos)
791
781
{
792
782
fprintf(fgxFile, "\n hasLoops=\"true\"");
793
783
}
794
- if (validWeights)
795
- {
796
- fprintf(fgxFile, "\n validEdgeWeights=\"true\"");
797
- if (!fgSlopUsedInEdgeWeights && !fgRangeUsedInEdgeWeights)
798
- {
799
- fprintf(fgxFile, "\n exactEdgeWeights=\"true\"");
800
- }
801
- }
802
784
if (fgFirstColdBlock != nullptr)
803
785
{
804
786
fprintf(fgxFile, "\n firstColdBlock=\"%d\"", fgFirstColdBlock->bbNum);
@@ -1081,11 +1063,8 @@ bool Compiler::fgDumpFlowGraph(Phases phase, PhasePosition pos)
1081
1063
fprintf(fgxFile, " [");
1082
1064
}
1083
1065
1084
- if (validWeights)
1085
- {
1086
- weight_t edgeWeight = (edge->edgeWeightMin() + edge->edgeWeightMax()) / 2;
1087
- fprintf(fgxFile, "%slabel=\"%7.2f\"", sep, (double)edgeWeight / weightDivisor);
1088
- }
1066
+ const weight_t edgeWeight = edge->getLikelyWeight();
1067
+ fprintf(fgxFile, "%slabel=\"%7.2f\"", sep, (double)edgeWeight / weightDivisor);
1089
1068
1090
1069
fprintf(fgxFile, "];\n");
1091
1070
}
@@ -1106,32 +1085,22 @@ bool Compiler::fgDumpFlowGraph(Phases phase, PhasePosition pos)
1106
1085
fprintf(fgxFile, "\n switchDefault=\"true\"");
1107
1086
}
1108
1087
}
1109
- if (validWeights)
1110
- {
1111
- weight_t edgeWeight = (edge->edgeWeightMin() + edge->edgeWeightMax()) / 2;
1112
- fprintf(fgxFile, "\n weight=");
1113
- fprintfDouble(fgxFile, ((double)edgeWeight) / weightDivisor);
1114
1088
1115
- if (edge->edgeWeightMin() != edge->edgeWeightMax())
1089
+ const weight_t edgeWeight = edge->getLikelyWeight();
1090
+ fprintf(fgxFile, "\n weight=");
1091
+ fprintfDouble(fgxFile, ((double)edgeWeight) / weightDivisor);
1092
+
1093
+ if (edgeWeight > 0)
1094
+ {
1095
+ if (edgeWeight < bSource->bbWeight)
1116
1096
{
1117
- fprintf(fgxFile, "\n minWeight=");
1118
- fprintfDouble(fgxFile, ((double)edge->edgeWeightMin()) / weightDivisor);
1119
- fprintf(fgxFile, "\n maxWeight=");
1120
- fprintfDouble(fgxFile, ((double)edge->edgeWeightMax()) / weightDivisor);
1097
+ fprintf(fgxFile, "\n out=");
1098
+ fprintfDouble(fgxFile, ((double)edgeWeight) / sourceWeightDivisor);
1121
1099
}
1122
-
1123
- if (edgeWeight > 0)
1100
+ if (edgeWeight < bTarget->bbWeight)
1124
1101
{
1125
- if (edgeWeight < bSource->bbWeight)
1126
- {
1127
- fprintf(fgxFile, "\n out=");
1128
- fprintfDouble(fgxFile, ((double)edgeWeight) / sourceWeightDivisor);
1129
- }
1130
- if (edgeWeight < bTarget->bbWeight)
1131
- {
1132
- fprintf(fgxFile, "\n in=");
1133
- fprintfDouble(fgxFile, ((double)edgeWeight) / targetWeightDivisor);
1134
- }
1102
+ fprintf(fgxFile, "\n in=");
1103
+ fprintfDouble(fgxFile, ((double)edgeWeight) / targetWeightDivisor);
1135
1104
}
1136
1105
}
1137
1106
}
0 commit comments