19 #define DEBUG_TYPE "llvm-mca"
21 Error MicroOpQueueStage::moveInstructions() {
22 InstRef
IR = Buffer[CurrentInstructionSlotIdx];
27 Buffer[CurrentInstructionSlotIdx].invalidate();
28 unsigned NormalizedOpcodes = getNormalizedOpcodes(
IR);
29 CurrentInstructionSlotIdx += NormalizedOpcodes;
30 CurrentInstructionSlotIdx %= Buffer.size();
31 AvailableEntries += NormalizedOpcodes;
32 IR = Buffer[CurrentInstructionSlotIdx];
38 MicroOpQueueStage::MicroOpQueueStage(
unsigned Size,
unsigned IPC,
39 bool ZeroLatencyStage)
40 : NextAvailableSlotIdx(0), CurrentInstructionSlotIdx(0), MaxIPC(IPC),
41 CurrentIPC(0), IsZeroLatencyStage(ZeroLatencyStage) {
42 Buffer.resize(Size ? Size : 1);
43 AvailableEntries = Buffer.size();
47 Buffer[NextAvailableSlotIdx] =
IR;
48 unsigned NormalizedOpcodes = getNormalizedOpcodes(
IR);
49 NextAvailableSlotIdx += NormalizedOpcodes;
50 NextAvailableSlotIdx %= Buffer.size();
51 AvailableEntries -= NormalizedOpcodes;
58 if (!IsZeroLatencyStage)
59 return moveInstructions();
64 if (IsZeroLatencyStage)
65 return moveInstructions();