LLVM: include/llvm/MCA/IncrementalSourceMgr.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14#ifndef LLVM_MCA_INCREMENTALSOURCEMGR_H
15#define LLVM_MCA_INCREMENTALSOURCEMGR_H
16
19#include
20
21namespace llvm {
22namespace mca {
23
24
25
26
28
29
30
31
32 std::deque InstStorage;
33
34
35
36 std::deque<Instruction *> Staging;
37
38
39 unsigned TotalCounter = 0U;
40
41
42 bool EOS = false;
43
44
45 using InstFreedCallback = std::function<void(Instruction *)>;
46 InstFreedCallback InstFreedCB;
47
48public:
50
51
54
56
57
58
59
61
65
66 bool hasNext() const override { return !Staging.empty(); }
67 bool isEnd() const override { return EOS; }
68
71 return SourceRef(TotalCounter, *Staging.front());
72 }
73
74
76 InstStorage.emplace_back(std::move(Inst));
77 Staging.push_back(InstStorage.back().get());
78 }
79
80
82
83 void updateNext() override;
84
85
87
88#ifndef NDEBUG
89
91#endif
92};
93
94}
95}
96
97#endif
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This file contains abstract class SourceMgr and the default implementation, CircularSourceMgr.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
void setOnInstFreedCallback(InstFreedCallback CB)
Set a callback that is invoked when a mca::Instruction is no longer needed.
Definition IncrementalSourceMgr.h:60
void addRecycledInst(Instruction *Inst)
Add a recycled instruction.
Definition IncrementalSourceMgr.h:81
bool isEnd() const override
Whether the instruction stream has eneded.
Definition IncrementalSourceMgr.h:67
void addInst(UniqueInst &&Inst)
Add a new instruction.
Definition IncrementalSourceMgr.h:75
ArrayRef< UniqueInst > getInstructions() const override
Provides a fixed range of UniqueInst to iterate.
Definition IncrementalSourceMgr.h:62
SourceRef peekNext() const override
The next SourceRef.
Definition IncrementalSourceMgr.h:69
bool hasNext() const override
Whether there is any SourceRef to inspect / peek next.
Definition IncrementalSourceMgr.h:66
void endOfStream()
Mark the end of instruction stream.
Definition IncrementalSourceMgr.h:86
IncrementalSourceMgr & operator=(const IncrementalSourceMgr &)=delete
IncrementalSourceMgr()=default
IncrementalSourceMgr(const IncrementalSourceMgr &)=delete
An instruction propagated through the simulated instruction pipeline.
This class implements an extremely fast bulk output stream that can only output to a stream.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
std::pair< unsigned, const Instruction & > SourceRef
This is an optimization pass for GlobalISel generic memory operations.
Abstracting the input code sequence (a sequence of MCInst) and assigning unique identifiers to every ...
std::unique_ptr< Instruction > UniqueInst