10 #ifndef LLVM_LIB_TARGET_HEXAGON_BITTRACKER_H 11 #define LLVM_LIB_TARGET_HEXAGON_BITTRACKER_H 29 class MachineRegisterInfo;
30 class MachineBasicBlock;
31 class MachineFunction;
33 class TargetRegisterClass;
34 class TargetRegisterInfo;
52 bool has(
unsigned Reg)
const;
66 void visitUsesOf(
unsigned Reg);
68 using CFGEdge = std::pair<int, int>;
69 using EdgeSetType = std::set<CFGEdge>;
70 using InstrSetType = std::set<const MachineInstr *>;
71 using EdgeQueueType = std::queue<CFGEdge>;
76 UseQueueType() : Uses(Dist) {}
78 unsigned size()
const {
88 if (Set.insert(MI).second)
104 std::priority_queue<MachineInstr*, std::vector<MachineInstr*>, Cmp> Uses;
110 void runEdgeQueue(
BitVector &BlockScanned);
118 EdgeSetType EdgeExec;
119 InstrSetType InstrExec;
145 :
Reg(MO.
getReg()), Sub(MO.getSubReg()) {}
201 if (Type ==
Ref && !(RefI == V.
RefI))
209 bool is(
unsigned T)
const {
211 return T == 0 ? Type == Zero
212 : (T == 1 ? Type == One :
false);
231 if (Type ==
Ref && RefI == Self)
258 return Type == Zero || Type == One;
262 assert(Type == Zero || Type == One);
322 uint16_t cl(
bool B)
const;
323 uint16_t ct(
bool B)
const;
345 static const unsigned DefaultBitN = 32;
353 return Map.find(Reg) != Map.end();
358 CellMapType::const_iterator
F = Map.find(Reg);
366 for (uint16_t i = 0; i < Width; ++i)
374 for (uint16_t i = 0; i < Width; ++i)
383 for (
unsigned i = 0; i <
W; ++i)
465 virtual BitMask mask(
unsigned Reg,
unsigned Sub)
const;
488 virtual uint16_t getPhysRegBitWidth(
unsigned Reg)
const;
496 #endif // LLVM_LIB_TARGET_HEXAGON_BITTRACKER_H
RegisterRef(unsigned R=0, unsigned S=0)
MachineEvaluator(const TargetRegisterInfo &T, MachineRegisterInfo &M)
const TargetRegisterInfo & TRI
BitValue(ValueType T=Top)
void trace(bool On=false)
This class represents lattice values for constants.
BitValue(unsigned Reg, uint16_t Pos)
static RegisterCell top(uint16_t Width)
Implements a dense probed hash-table based set.
void visit(const MachineInstr &MI)
unsigned getRegBitWidth(unsigned RCID)
Get the size in bits of a register from the register class RC.
static RegisterCell self(unsigned Reg, uint16_t Width)
unsigned const TargetRegisterInfo * TRI
void print_cells(raw_ostream &OS) const
The access may reference the value stored in memory.
BitValue & operator[](uint16_t BitN)
BitRef(unsigned R=0, uint16_t P=0)
BitMask(uint16_t b, uint16_t e)
bool reached(const MachineBasicBlock *B) const
Control flow instructions. These all have token chains.
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
unsigned const MachineRegisterInfo * MRI
constexpr bool isInt(int64_t x)
Checks if an integer fits into the given bit width.
const RegisterCell & lookup(unsigned Reg) const
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
virtual const TargetRegisterClass & composeWithSubRegIndex(const TargetRegisterClass &RC, unsigned Idx) const
static uint32_t rol(uint32_t Number, int Bits)
RegisterCell getRef(const RegisterRef &RR, const CellMapType &M) const
void subst(RegisterRef OldRR, RegisterRef NewRR)
virtual bool track(const TargetRegisterClass *RC) const
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
std::map< unsigned, RegisterCell > CellMapType
constexpr bool empty(const T &RangeOrContainer)
Test whether RangeOrContainer is empty. Similar to C++17 std::empty.
const BitValue & operator[](uint16_t BitN) const
This is the shared class of boolean and integer constants.
auto size(R &&Range, typename std::enable_if< std::is_same< typename std::iterator_traits< decltype(Range.begin())>::iterator_category, std::random_access_iterator_tag >::value, void >::type *=nullptr) -> decltype(std::distance(Range.begin(), Range.end()))
Get the size of a range.
static BitValue self(const BitRef &Self=BitRef())
MachineOperand class - Representation of each machine instruction operand.
bool is(unsigned T) const
MachineRegisterInfo & MRI
static unsigned getReg(const void *D, unsigned RC, unsigned RegNo)
MachineRegisterInfo - Keep track of information for virtual and physical registers, including vreg register classes, use/def chains for registers, etc.
bool operator!=(uint64_t V1, const APInt &V2)
Representation of each machine instruction.
BitTracker(const MachineEvaluator &E, MachineFunction &F)
bool has(unsigned Reg) const
raw_ostream & operator<<(raw_ostream &OS, const APInt &I)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
RegisterRef(const MachineOperand &MO)
RegisterCell(uint16_t Width=DefaultBitN)
A vector that has set insertion semantics.
void put(RegisterRef RR, const RegisterCell &RC)
This class implements an extremely fast bulk output stream that can only output to a stream...
bool operator==(uint64_t V1, const APInt &V2)
static RegisterCell ref(const RegisterCell &C)
bool meet(const BitValue &V, const BitRef &Self)
static BitValue ref(const BitValue &V)