-
Enhancement
-
Resolution: Unresolved
-
P4
-
21, 22
The output of TraceLoopOpts could be improved to provide more information about loop opts. Here are some ideas (non-exhaustive):
- Pre/Main/Post: Dump index of CountedLoopNode head of pre, main and post loop
- Loop Unswitching: Dump index of LoopNode head of fast and slow loop
- Loop Peeling/Partial Peeling: Dump index of new LoopNode head.
- Loop Predication: Dump index of newly created predicate and possibly the index of the check which was removed from the loop
- Print a message when a new round of loop opts start with a counter (each time we call PhaseIdealLoop::optimize())
- Check if other things could be included from PhaseIdealLoop::build_and_optimize():
- Optimizations such as PhaseIdealLoop::duplicate_loop_backedge()
- build_loop_early/late
- Printing the loop head with the indentation to signal the loop nesting depth/level does not add much benefit when printed for a loop optimization like Loop Peeling or Loop Unswitching. Example of unswitching a loop at depth 3 (since Jira removes multiple whitespace, I've indicated the spaces with <>):
Unswitch 1 <spaces for depth 3>Loop: N284/N216 limit_check profile_predicated predicated counted [0,100),+1 (2147483648 iters) has_sfpt strip_mined
- ...
Related to that but not fitting into the TraceLoopOpts flag per se (maybe worth investigating in a separate RFE):
Add a similar output for other non-loop-opts phases like IGVN, CCP etc. This could be a combined "TraceCompilerOpts" flag including this additional output and the output from TraceLoopOpts. While doing so, we could consider implementing "TraceCompilerOpts" with UL (unified logging) to have more fine-grained control. We could also think about converting TraceLoopOpts to UL (optional and not the main objective of this RFE).
- Pre/Main/Post: Dump index of CountedLoopNode head of pre, main and post loop
- Loop Unswitching: Dump index of LoopNode head of fast and slow loop
- Loop Peeling/Partial Peeling: Dump index of new LoopNode head.
- Loop Predication: Dump index of newly created predicate and possibly the index of the check which was removed from the loop
- Print a message when a new round of loop opts start with a counter (each time we call PhaseIdealLoop::optimize())
- Check if other things could be included from PhaseIdealLoop::build_and_optimize():
- Optimizations such as PhaseIdealLoop::duplicate_loop_backedge()
- build_loop_early/late
- Printing the loop head with the indentation to signal the loop nesting depth/level does not add much benefit when printed for a loop optimization like Loop Peeling or Loop Unswitching. Example of unswitching a loop at depth 3 (since Jira removes multiple whitespace, I've indicated the spaces with <>):
Unswitch 1 <spaces for depth 3>Loop: N284/N216 limit_check profile_predicated predicated counted [0,100),+1 (2147483648 iters) has_sfpt strip_mined
- ...
Related to that but not fitting into the TraceLoopOpts flag per se (maybe worth investigating in a separate RFE):
Add a similar output for other non-loop-opts phases like IGVN, CCP etc. This could be a combined "TraceCompilerOpts" flag including this additional output and the output from TraceLoopOpts. While doing so, we could consider implementing "TraceCompilerOpts" with UL (unified logging) to have more fine-grained control. We could also think about converting TraceLoopOpts to UL (optional and not the main objective of this RFE).