59
59
* representation (IR).
60
60
* <p>
61
61
* This phase traverses all sections of the code, sorts and identifies the hottest regions of the IR
62
- * - typically loops or frequently executed blocks - wand generates a report highlighting any known
62
+ * - typically loops or frequently executed blocks - and generates a report highlighting any known
63
63
* performance-critical observations related to those regions (if any are present).
64
64
* </p>
65
65
* <p>
66
66
* The resulting report can be used to guide further performance analysis or optimization efforts.
67
67
* </p>
68
- *
68
+ *
69
69
* The phase is written in an agnostic way so it can be applied at any point in time in the
70
70
* compilation pipeline.
71
71
*/
@@ -77,7 +77,7 @@ public static class Options {
77
77
public static final OptionKey <Boolean > ReportHotCodePartsToIGV = new OptionKey <>(false );
78
78
@ Option (help = "Specifies the debug level for dumping hottest code parts to the Ideal Graph Visualizer (IGV)." , type = OptionType .Debug )
79
79
public static final OptionKey <Integer > ReportHotCodIGVLevel = new OptionKey <>(1 );
80
- @ Option (help = "" , type = OptionType .Debug )
80
+ @ Option (help = "Specifies the minimum relative frequency for reporting hot code regions. " , type = OptionType .Debug )
81
81
public static final OptionKey <Double > MinimalFrequencyToReport = new OptionKey <>(1D );
82
82
//@formatter:on
83
83
}
@@ -206,17 +206,15 @@ protected void run(StructuredGraph graph, C c) {
206
206
// report the 3 hottest blocks and the 3 hottest loops and 3 hottest loops by local loop
207
207
// frequency
208
208
final List <HIRBlock > hottestBlocks = new ArrayList <>();
209
- final List <Loop > hottestLocalLoops = new ArrayList <>();
210
- final List <Loop > hottestGlobalLoops = new ArrayList <>();
211
209
212
210
Collections .addAll (hottestBlocks , cfg .reversePostOrder ());
213
211
hottestBlocks .sort ((x , y ) -> Double .compare (y .getRelativeFrequency (), x .getRelativeFrequency ()));
214
212
215
213
ld .detectCountedLoops ();
216
- hottestLocalLoops . addAll (ld .loops ());
214
+ final List < Loop > hottestLocalLoops = new ArrayList <> (ld .loops ());
217
215
hottestLocalLoops .sort ((x , y ) -> Double .compare (y .localLoopFrequency (), x .localLoopFrequency ()));
218
216
219
- hottestGlobalLoops . addAll (ld .loops ());
217
+ final List < Loop > hottestGlobalLoops = new ArrayList <> (ld .loops ());
220
218
hottestGlobalLoops .sort ((x , y ) -> Double .compare (y .getCFGLoop ().getHeader ().getRelativeFrequency (), x .getCFGLoop ().getHeader ().getRelativeFrequency ()));
221
219
222
220
final List <HIRBlock > hottestFirstBlocks = takeUntil (hottestBlocks , REPORT_HOT_FIRST_N );
@@ -326,7 +324,7 @@ private static void reportMemoryKillANYInLoop(Loop l, Node inside, ControlFlowGr
326
324
SingleMemoryKill sk = MemoryKill .asSingleMemoryKill (inside );
327
325
if (sk .getKilledLocationIdentity ().isAny ()) {
328
326
if (inside instanceof FixedNode ) {
329
- // else we dont have a cfg position
327
+ // else we don't have a cfg position
330
328
warn ("Node %s kills any and has relative f=%s in loop %s %n\t Potential Action Item: Determine if operation is required and replace with less intrusive memory effect if possible.%n" ,
331
329
inside , cfg .blockFor (inside ).getRelativeFrequency (), l );
332
330
} else {
0 commit comments