8265262: CITime - 'other' incorrectly calculated

Reviewed-by: thartmann, kvn
diff --git a/src/hotspot/share/opto/output.cpp b/src/hotspot/share/opto/output.cpp
index 784d09a..0e91d90 100644
--- a/src/hotspot/share/opto/output.cpp
+++ b/src/hotspot/share/opto/output.cpp
@@ -501,6 +501,9 @@
 // The architecture description provides short branch variants for some long
 // branch instructions. Replace eligible long branches with short branches.
 void PhaseOutput::shorten_branches(uint* blk_starts) {
+
+  Compile::TracePhase tp("shorten branches", &timers[_t_shortenBranches]);
+
   // Compute size of each block, method size, and relocation information size
   uint nblocks  = C->cfg()->number_of_blocks();
 
@@ -1360,6 +1363,8 @@
 
   // Compute the size of first NumberOfLoopInstrToAlign instructions at head
   // of a loop. It is used to determine the padding for loop alignment.
+  Compile::TracePhase tp("fill buffer", &timers[_t_fillBuffer]);
+
   compute_loop_first_inst_sizes();
 
   // Create oopmap set.
diff --git a/src/hotspot/share/opto/phase.cpp b/src/hotspot/share/opto/phase.cpp
index 9759c59..4b09205 100644
--- a/src/hotspot/share/opto/phase.cpp
+++ b/src/hotspot/share/opto/phase.cpp
@@ -64,24 +64,22 @@
     {
        tty->print_cr ("         Incremental Inline:  %7.3f s", timers[_t_incrInline].seconds());
        tty->print_cr ("           IdealLoop:           %7.3f s", timers[_t_incrInline_ideal].seconds());
-       tty->print_cr ("           IGVN:                %7.3f s", timers[_t_incrInline_igvn].seconds());
-       tty->print_cr ("           Inline:              %7.3f s", timers[_t_incrInline_inline].seconds());
-       tty->print_cr ("           Prune Useless:       %7.3f s", timers[_t_incrInline_pru].seconds());
+       tty->print_cr ("          (IGVN:                %7.3f s)", timers[_t_incrInline_igvn].seconds());
+       tty->print_cr ("          (Inline:              %7.3f s)", timers[_t_incrInline_inline].seconds());
+       tty->print_cr ("          (Prune Useless:       %7.3f s)", timers[_t_incrInline_pru].seconds());
 
        double other = timers[_t_incrInline].seconds() -
-        (timers[_t_incrInline_ideal].seconds() +
-         timers[_t_incrInline_igvn].seconds() +
-         timers[_t_incrInline_inline].seconds() +
-         timers[_t_incrInline_pru].seconds());
+        (timers[_t_incrInline_ideal].seconds());
        if (other > 0) {
          tty->print_cr("           Other:               %7.3f s", other);
        }
     }
-    tty->print_cr ("         Renumber Live:       %7.3f s", timers[_t_renumberLive].seconds());
+
     tty->print_cr ("         Vector:              %7.3f s", timers[_t_vector].seconds());
     tty->print_cr ("           Box elimination:   %7.3f s", timers[_t_vector_elimination].seconds());
     tty->print_cr ("             IGVN:            %7.3f s", timers[_t_vector_igvn].seconds());
     tty->print_cr ("             Prune Useless:   %7.3f s", timers[_t_vector_pru].seconds());
+    tty->print_cr ("         Renumber Live:       %7.3f s", timers[_t_renumberLive].seconds());
     tty->print_cr ("         IdealLoop:           %7.3f s", timers[_t_idealLoop].seconds());
     tty->print_cr ("         IdealLoop Verify:    %7.3f s", timers[_t_idealLoopVerify].seconds());
     tty->print_cr ("         Cond Const Prop:     %7.3f s", timers[_t_ccp].seconds());
@@ -94,6 +92,7 @@
       (timers[_t_escapeAnalysis].seconds() +
        timers[_t_iterGVN].seconds() +
        timers[_t_incrInline].seconds() +
+       timers[_t_vector].seconds() +
        timers[_t_renumberLive].seconds() +
        timers[_t_idealLoop].seconds() +
        timers[_t_idealLoopVerify].seconds() +
@@ -159,8 +158,23 @@
   }
   tty->print_cr ("       Code Emission:         %7.3f s", timers[_t_output].seconds());
   tty->print_cr ("         Insn Scheduling:     %7.3f s", timers[_t_instrSched].seconds());
+  tty->print_cr ("         Shorten branches:    %7.3f s", timers[_t_shortenBranches].seconds());
   tty->print_cr ("         Build OOP maps:      %7.3f s", timers[_t_buildOopMaps].seconds());
-  tty->print_cr ("       Code Installation:   %7.3f s", timers[_t_registerMethod].seconds());
+  tty->print_cr ("         Fill buffer:         %7.3f s", timers[_t_fillBuffer].seconds());
+  tty->print_cr ("         Code Installation:   %7.3f s", timers[_t_registerMethod].seconds());
+
+  {
+    double other = timers[_t_output].seconds() -
+                   (timers[_t_instrSched].seconds() +
+                    timers[_t_shortenBranches].seconds() +
+                    timers[_t_buildOopMaps].seconds() +
+                    timers[_t_fillBuffer].seconds() +
+                    timers[_t_registerMethod].seconds());
+
+    if (other > 0) {
+      tty->print_cr("         Other:               %7.3f s", other);
+    }
+  }
 
   if( timers[_t_temporaryTimer1].seconds() > 0 ) {
     tty->cr();
diff --git a/src/hotspot/share/opto/phase.hpp b/src/hotspot/share/opto/phase.hpp
index 32944f0..e09438b 100644
--- a/src/hotspot/share/opto/phase.hpp
+++ b/src/hotspot/share/opto/phase.hpp
@@ -111,9 +111,11 @@
     _t_peephole,
     _t_postalloc_expand,
     _t_output,
-       _t_instrSched,
-       _t_buildOopMaps,
-    _t_registerMethod,
+      _t_instrSched,
+      _t_shortenBranches,
+      _t_buildOopMaps,
+      _t_fillBuffer,
+      _t_registerMethod,
     _t_temporaryTimer1,
     _t_temporaryTimer2,
     max_phase_timers