LLVM: include/llvm/MCA/Stages/MicroOpQueueStage.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16#ifndef LLVM_MCA_STAGES_MICROOPQUEUESTAGE_H
17#define LLVM_MCA_STAGES_MICROOPQUEUESTAGE_H
18
21
22namespace llvm {
23namespace mca {
24
25
26class MicroOpQueueStage : public Stage {
28 unsigned NextAvailableSlotIdx;
29 unsigned CurrentInstructionSlotIdx;
30
31
32
33
34 const unsigned MaxIPC;
35 unsigned CurrentIPC;
36
37
38 unsigned AvailableEntries;
39
40
41
42
43 bool IsZeroLatencyStage;
44
45 MicroOpQueueStage(const MicroOpQueueStage &Other) = delete;
46 MicroOpQueueStage &operator=(const MicroOpQueueStage &Other) = delete;
47
48
49
50
51
52
53
54 unsigned getNormalizedOpcodes(const InstRef &IR) const {
55 unsigned NormalizedOpcodes =
56 std::min(static_cast<unsigned>(Buffer.size()),
57 IR.getInstruction()->getDesc().NumMicroOps);
58 return NormalizedOpcodes ? NormalizedOpcodes : 1U;
59 }
60
61 Error moveInstructions();
62
63public:
64 MicroOpQueueStage(unsigned Size, unsigned IPC = 0,
65 bool ZeroLatencyStage = true);
66
68 if (MaxIPC && CurrentIPC == MaxIPC)
69 return false;
70 unsigned NormalizedOpcodes = getNormalizedOpcodes(IR);
71 if (NormalizedOpcodes > AvailableEntries)
72 return false;
73 return true;
74 }
75
77 return AvailableEntries != Buffer.size();
78 }
79
83};
84
85}
86}
87
88#endif
Legalize the Machine IR a function s Machine IR
This file defines the SmallVector class.
This file defines a stage.
Lightweight error class with error context and mandatory checking.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
An InstRef contains both a SourceMgr index and Instruction pair.
bool isAvailable(const InstRef &IR) const override
Returns true if it can execute IR during this cycle.
Definition MicroOpQueueStage.h:67
Error cycleEnd() override
Called once at the end of each cycle.
bool hasWorkToComplete() const override
Returns true if some instructions are still executing this stage.
Definition MicroOpQueueStage.h:76
Error execute(InstRef &IR) override
The primary action that this stage performs on instruction IR.
Error cycleStart() override
Called once at the start of each cycle.
This is an optimization pass for GlobalISel generic memory operations.