llvm-project/llvm/tools/llvm-mca/lib
Andrea Di Biagio 373a4ccf6c [llvm-mca][MC] Add the ability to declare which processor resources model load/store queues (PR36666).
This patch adds the ability to specify via tablegen which processor resources
are load/store queue resources.

A new tablegen class named MemoryQueue can be optionally used to mark resources
that model load/store queues.  Information about the load/store queue is
collected at 'CodeGenSchedule' stage, and analyzed by the 'SubtargetEmitter' to
initialize two new fields in struct MCExtraProcessorInfo named `LoadQueueID` and
`StoreQueueID`.  Those two fields are identifiers for buffered resources used to
describe the load queue and the store queue.
Field `BufferSize` is interpreted as the number of entries in the queue, while
the number of units is a throughput indicator (i.e. number of available pickers
for loads/stores).

At construction time, LSUnit in llvm-mca checks for the presence of extra
processor information (i.e. MCExtraProcessorInfo) in the scheduling model.  If
that information is available, and fields LoadQueueID and StoreQueueID are set
to a value different than zero (i.e. the invalid processor resource index), then
LSUnit initializes its LoadQueue/StoreQueue based on the BufferSize value
declared by the two processor resources.

With this patch, we more accurately track dynamic dispatch stalls caused by the
lack of LS tokens (i.e. load/store queue full). This is also shown by the
differences in two BdVer2 tests. Stalls that were previously classified as
generic SCHEDULER FULL stalls, are not correctly classified either as "load
queue full" or "store queue full".

About the differences in the -scheduler-stats view: those differences are
expected, because entries in the load/store queue are not released at
instruction issue stage. Instead, those are released at instruction executed
stage.  This is the main reason why for the modified tests, the load/store
queues gets full before PdEx is full.

Differential Revision: https://reviews.llvm.org/D54957

llvm-svn: 347857
2018-11-29 12:15:56 +00:00
..
HardwareUnits [llvm-mca][MC] Add the ability to declare which processor resources model load/store queues (PR36666). 2018-11-29 12:15:56 +00:00
Stages [llvm-mca] Use a small vector for instructions in the EntryStage. 2018-11-09 12:29:57 +00:00
CMakeLists.txt [llvm-mca] PR39261: Rename FetchStage to EntryStage. 2018-11-08 17:49:30 +00:00
Context.cpp [llvm-mca][MC] Add the ability to declare which processor resources model load/store queues (PR36666). 2018-11-29 12:15:56 +00:00
HWEventListener.cpp [llvm-mca] Move namespace mca inside llvm:: 2018-10-30 15:56:08 +00:00
InstrBuilder.cpp [llvm-mca] Add support for instructions with a variadic number of operands. 2018-11-25 12:46:24 +00:00
Instruction.cpp [llvm-mca] Use a SmallVector instead of std::vector to track register reads/writes. NFCI 2018-11-22 14:48:53 +00:00
LLVMBuild.txt [MCA] Remove dependency on CodeGen. 2018-09-21 01:54:08 +00:00
Pipeline.cpp Reapply "[llvm-mca] Return the total number of cycles from method Pipeline::run()." 2018-11-28 19:31:19 +00:00
Support.cpp [llvm-mca] Move namespace mca inside llvm:: 2018-10-30 15:56:08 +00:00