@@ -28,26 +28,17 @@ void Compiler::fgPrintEdgeWeights()
2828
2929 printf (FMT_BB " " , bSrc->bbNum );
3030
31- if (edge->edgeWeightMin () < BB_MAX_WEIGHT )
31+ const weight_t weight = edge->getLikelyWeight ();
32+
33+ if (weight < BB_MAX_WEIGHT )
3234 {
33- printf (" (%f" , edge-> edgeWeightMin () );
35+ printf (" (%f) " , weight );
3436 }
3537 else
3638 {
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)" );
4940 }
50- printf ( " ) " );
41+
5142 if (edge->getNextPredEdge () != nullptr )
5243 {
5344 printf (" , " );
@@ -735,7 +726,6 @@ bool Compiler::fgDumpFlowGraph(Phases phase, PhasePosition pos)
735726 JITDUMP (" Writing out flow graph %s phase %s\n " , (pos == PhasePosition::PrePhase) ? " before" : " after" ,
736727 PhaseNames[phase]);
737728
738- bool validWeights = fgHaveValidEdgeWeights;
739729 double weightDivisor = (double )BasicBlock::getCalledCount (this );
740730 const char * escapedString;
741731 const char * regionString = " NONE" ;
@@ -791,14 +781,6 @@ bool Compiler::fgDumpFlowGraph(Phases phase, PhasePosition pos)
791781 {
792782 fprintf (fgxFile, " \n hasLoops=\" true\" " );
793783 }
794- if (validWeights)
795- {
796- fprintf (fgxFile, " \n validEdgeWeights=\" true\" " );
797- if (!fgSlopUsedInEdgeWeights && !fgRangeUsedInEdgeWeights)
798- {
799- fprintf (fgxFile, " \n exactEdgeWeights=\" true\" " );
800- }
801- }
802784 if (fgFirstColdBlock != nullptr )
803785 {
804786 fprintf (fgxFile, " \n firstColdBlock=\" %d\" " , fgFirstColdBlock->bbNum );
@@ -1081,11 +1063,8 @@ bool Compiler::fgDumpFlowGraph(Phases phase, PhasePosition pos)
10811063 fprintf (fgxFile, " [" );
10821064 }
10831065
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);
10891068
10901069 fprintf (fgxFile, " ];\n " );
10911070 }
@@ -1106,32 +1085,22 @@ bool Compiler::fgDumpFlowGraph(Phases phase, PhasePosition pos)
11061085 fprintf (fgxFile, " \n switchDefault=\" true\" " );
11071086 }
11081087 }
1109- if (validWeights)
1110- {
1111- weight_t edgeWeight = (edge->edgeWeightMin () + edge->edgeWeightMax ()) / 2 ;
1112- fprintf (fgxFile, " \n weight=" );
1113- fprintfDouble (fgxFile, ((double )edgeWeight) / weightDivisor);
11141088
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 )
11161096 {
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);
11211099 }
1122-
1123- if (edgeWeight > 0 )
1100+ if (edgeWeight < bTarget->bbWeight )
11241101 {
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);
11351104 }
11361105 }
11371106 }
0 commit comments