[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-hotspot-compiler-dev
Subject:    Re: Instruction Scheduling in the C2 Compiler
From:       Krystal Mok <rednaxelafx () gmail ! com>
Date:       2015-06-15 19:26:34
Message-ID: CA+cQ+tQFk+gYmOTxB0OjS=AfiOOfDH++XNqAvxShAMkSBU_oFQ () mail ! gmail ! com
[Download RAW message or body]

Hi Ahmed,

Greetings. If you're looking for scheduling logic in C2, that would mostly
be in opto/gcm.cpp and opto/lcm.cpp, for Global Code Motion and Local Code
Motion, respectively.

The place that initiates code scheduling is from Compile::Code_Gen() in
opto/compile.cpp:

2320   // Build a proper-looking CFG
2321   PhaseCFG cfg(node_arena(), root(), matcher);
2322   _cfg = &cfg;
2323   {
2324     TracePhase tp("scheduler", &timers[_t_scheduler]);
2325     bool success = cfg.do_global_code_motion(); // <- Scheduling
initiated from here
2326     if (!success) {
2327       return;
2328     }
2329
2330     print_method(PHASE_GLOBAL_CODE_MOTION, 2);
2331     NOT_PRODUCT( verify_graph_edges(); )
2332     debug_only( cfg.verify(); )
2333   }

Follow that path and you'll be able to find all the code you need.

Best regards,
Kris


On Mon, Jun 15, 2015 at 10:56 AM, Ahmed Khawaja <ahmed.khawaja@oracle.com>
wrote:

> Greetings,
>
>            I am inquiring as to what would be a good starting point to get
> familiar with the current instruction scheduling capabilities of the C2
> compiler in hotspot. I am relatively new to working with Hotspot and have
> primarily been working with the macro-assembler and will now be looking at
> the instruction scheduling abilities. I am going through the source code
> now but I am not exactly sure where instruction scheduling is done. The
> OpenJDK wiki also seems to be somewhat empty on this and the compiler
> passes in general.
>
> Thanks in advance,
>    Ahmed
>

[Attachment #3 (text/html)]

<div dir="ltr">Hi Ahmed,<div><br></div><div>Greetings. If you&#39;re looking for \
scheduling logic in C2, that would mostly be in opto/gcm.cpp and opto/lcm.cpp, for \
Global Code Motion and Local Code Motion, respectively.</div><div><br></div><div>The \
place that initiates code scheduling is from Compile::Code_Gen() in \
opto/compile.cpp:</div><div><br></div><div><div>2320    // Build a proper-looking \
CFG</div><div>2321    PhaseCFG cfg(node_arena(), root(), matcher);</div><div>2322    \
_cfg = &amp;cfg;</div><div>2323    {</div><div>2324       TracePhase \
tp(&quot;scheduler&quot;, &amp;timers[_t_scheduler]);</div><div>2325       bool \
success = cfg.do_global_code_motion(); // &lt;- Scheduling initiated from \
here</div><div>2326       if (!success) {</div><div>2327          \
return;</div><div>2328       }</div><div>2329  </div><div>2330       \
print_method(PHASE_GLOBAL_CODE_MOTION, 2);</div><div>2331       NOT_PRODUCT( \
verify_graph_edges(); )</div><div>2332       debug_only( cfg.verify(); \
)</div><div>2333    }</div></div><div><br></div><div>Follow that path and you&#39;ll \
be able to find all the code you need.</div><div><br></div><div>Best \
regards,</div><div>Kris</div><div><br></div></div><div class="gmail_extra"><br><div \
class="gmail_quote">On Mon, Jun 15, 2015 at 10:56 AM, Ahmed Khawaja <span \
dir="ltr">&lt;<a href="mailto:ahmed.khawaja@oracle.com" \
target="_blank">ahmed.khawaja@oracle.com</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex">Greetings,<br> <br>
                 I am inquiring as to what would be a good starting point to get \
familiar with the current instruction scheduling capabilities of the C2 compiler in \
hotspot. I am relatively new to working with Hotspot and have primarily been working \
with the macro-assembler and will now be looking at the instruction scheduling \
abilities. I am going through the source code now but I am not exactly sure where \
instruction scheduling is done. The OpenJDK wiki also seems to be somewhat empty on \
this and the compiler passes in general.<br> <br>
Thanks in advance,<br>
     Ahmed<br>
</blockquote></div><br></div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic