15 #ifndef HEXAGONMCCHECKER_H
16 #define HEXAGONMCCHECKER_H
37 typedef std::pair<unsigned, bool> PredSense;
38 static const PredSense Unconditional;
39 typedef std::multiset<PredSense> PredSet;
40 typedef std::multiset<PredSense>::iterator PredSetIterator;
54 bool IsFloat, IsNVJ, Cond;
56 static NewSense Jmp(
bool isNVJ) {
57 NewSense NS = {0,
false, isNVJ,
61 static NewSense
Use(
unsigned PR,
bool True) {
62 NewSense NS = {PR,
false,
false,
66 static NewSense
Def(
unsigned PR,
bool True,
bool Float) {
67 NewSense NS = {PR, Float,
false,
78 typedef std::set<unsigned>::iterator SoftDefsIterator;
79 std::set<unsigned> SoftDefs;
82 typedef std::set<unsigned>::iterator TmpDefsIterator;
83 std::set<unsigned> TmpDefs;
86 typedef std::set<unsigned>::iterator NewPredsIterator;
87 std::set<unsigned> NewPreds;
90 typedef std::multiset<unsigned>::iterator LatePredsIterator;
91 std::multiset<unsigned> LatePreds;
94 typedef std::set<unsigned>::iterator UsesIterator;
95 std::set<unsigned> Uses;
102 typedef std::set<unsigned>::iterator ReadOnlyIterator;
103 std::set<unsigned> ReadOnly;
106 void init(
MCInst const &);
107 void initReg(
MCInst const &,
unsigned,
unsigned &PredReg,
bool &isTrue);
109 bool registerUsed(
unsigned Register);
112 bool checkBranches();
113 bool checkPredicates();
114 bool checkNewValues();
115 bool checkRegisters();
116 bool checkRegistersReadOnly();
117 bool checkEndloopBranches();
118 void checkRegisterCurDefs();
124 static void compoundRegisterMap(
unsigned &);
126 bool isPredicateRegister(
unsigned R)
const {
127 return (Hexagon::P0 == R || Hexagon::P1 == R || Hexagon::P2 == R ||
130 bool isLoopRegister(
unsigned R)
const {
131 return (Hexagon::SA0 == R || Hexagon::LC0 == R || Hexagon::SA1 == R ||
135 bool hasValidNewValueDef(
const NewSense &
Use,
const NewSenseList &Defs)
const;
142 bool check(
bool FullCheck =
true);
152 #endif // HEXAGONMCCHECKER_H
void reportErrorNewValue(unsigned Register)
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
A Use represents the edge between a Value definition and its users.
void reportWarning(llvm::Twine const &Msg)
Context object for machine code objects.
Instances of this class represent a single low-level machine instruction.
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
Interface to description of machine instruction set.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
HexagonMCChecker(MCContext &Context, MCInstrInfo const &MCII, MCSubtargetInfo const &STI, MCInst &mcb, const MCRegisterInfo &ri, bool ReportErrors=true)
Promote Memory to Register
void reportErrorRegisters(unsigned Register)
MCSubtargetInfo - Generic base class for all target subtargets.
bool check(bool FullCheck=true)
Check for a valid bundle.
void reportError(SMLoc Loc, llvm::Twine const &Msg)
Represents a location in source code.
This holds information about one operand of a machine instruction, indicating the register class for ...