[llvm-dev] Setting the value of MicroOpBufferSize correctly

Stefan Pintilie via llvm-dev llvm-dev at lists.llvm.org
Wed Oct 25 10:50:23 PDT 2017


Hi, 

I've been trying to determine how to properly set the MicroOpBufferSize 
parameter. Based on the documentation in the header file:
  // "> 1" means the processor is out-of-order. This is a machine 
independent
  // estimate of highly machine specific characteristics such as the 
register
  // renaming pool and reorder buffer.
Power 9 is out-of-order and so it makes sense to use a value greater than 
1. However we don't quite have a reorder buffer in the theoretical sense 
where we can pick any instruction in the buffer to dispatch next. As a 
result, I'm looking for a better understanding of how this parameter is 
used in the scheduler.

I've noticed that the only place where it matters if the value of 
MicroOpBufferSize is 2 or 200 is in 
GenericScheduler::checkAcyclicLatency(). In other places in the code we 
only care if we have values that fall in one of the three categories: 0, 
1, or > 1. 
Here is my understanding of what that function does (and I could be very 
wrong on this one) and please correct me if I am wrong. 

We can have two critical paths through a loop. One is cyclic (use-def 
cross loop iterations) and one is acyclic (everything can be computed in 
one iteration). If the acyclic path is greater than the cyclic path by 
more than the size of the instruction buffer then we have to make sure 
that we don't run out of instructions to dispatch in the instruction 
buffer. So, we set a flag Rem.IsAcyclicLatencyLimited and then 
tryCandidate checks this flag when making decisions. 
Is this correct? 
If that is what we are doing here then I think the proper value for this 
parameter is the full size of the instruction buffer on the P9 hardware. 
All we really care about is whether or not we will run out of instructions 
to dispatch while waiting for an instruction. We don't really care about 
HOW the out-of-order dispatch is done as long as we don't run out of 
instructions. 
Does my logic make sense?

I want to set the parameter but I want to make sure I understand what is 
going on. 

Thank you, 
Stefan 


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20171025/4d93b4bc/attachment.html>


More information about the llvm-dev mailing list