Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion llvm/lib/Target/Hexagon/AsmParser/HexagonAsmParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ void HexagonOperand::print(raw_ostream &OS, const MCAsmInfo &MAI) const {
break;
case Register:
OS << "<register R";
OS << getReg() << ">";
OS << getReg().id() << ">";
break;
case Token:
OS << "'" << getToken() << "'";
Expand Down
20 changes: 10 additions & 10 deletions llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCChecker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ bool HexagonMCChecker::checkSlots() {
bool HexagonMCChecker::checkPredicates() {
// Check for proper use of new predicate registers.
for (const auto &I : NewPreds) {
unsigned P = I;
MCRegister P = I;

if (!Defs.count(P) || LatePreds.count(P) || Defs.count(Hexagon::P3_0)) {
// Error out if the new predicate register is not defined,
Expand All @@ -398,7 +398,7 @@ bool HexagonMCChecker::checkPredicates() {

// Check for proper use of auto-anded of predicate registers.
for (const auto &I : LatePreds) {
unsigned P = I;
MCRegister P = I;

if (LatePreds.count(P) > 1 || Defs.count(P)) {
// Error out if predicate register defined "late" multiple times or
Expand Down Expand Up @@ -607,7 +607,7 @@ void HexagonMCChecker::checkRegisterCurDefs() {
bool HexagonMCChecker::checkRegisters() {
// Check for proper register definitions.
for (const auto &I : Defs) {
unsigned R = I.first;
MCRegister R = I.first;

if (isLoopRegister(R) && Defs.count(R) > 1 &&
(HexagonMCInstrInfo::isInnerLoop(MCB) ||
Expand All @@ -620,8 +620,8 @@ bool HexagonMCChecker::checkRegisters() {
if (SoftDefs.count(R)) {
// Error out for explicit changes to registers also weakly defined
// (e.g., "{ usr = r0; r0 = sfadd(...) }").
unsigned UsrR = Hexagon::USR; // Silence warning about mixed types in ?:.
unsigned BadR = RI.isSubRegister(Hexagon::USR, R) ? UsrR : R;
MCRegister UsrR = Hexagon::USR;
MCRegister BadR = RI.isSubRegister(Hexagon::USR, R) ? UsrR : R;
reportErrorRegisters(BadR);
return false;
}
Expand All @@ -633,8 +633,8 @@ bool HexagonMCChecker::checkRegisters() {
if (PM.count(Unconditional)) {
// Error out on an unconditional change when there are any other
// changes, conditional or not.
unsigned UsrR = Hexagon::USR;
unsigned BadR = RI.isSubRegister(Hexagon::USR, R) ? UsrR : R;
MCRegister UsrR = Hexagon::USR;
MCRegister BadR = RI.isSubRegister(Hexagon::USR, R) ? UsrR : R;
reportErrorRegisters(BadR);
return false;
}
Expand Down Expand Up @@ -664,7 +664,7 @@ bool HexagonMCChecker::checkRegisters() {

// Check for use of temporary definitions.
for (const auto &I : TmpDefs) {
unsigned R = I;
MCRegister R = I;

if (!Uses.count(R)) {
// special case for vhist
Expand Down Expand Up @@ -765,12 +765,12 @@ void HexagonMCChecker::compoundRegisterMap(unsigned &Register) {
}
}

void HexagonMCChecker::reportErrorRegisters(unsigned Register) {
void HexagonMCChecker::reportErrorRegisters(MCRegister Register) {
reportError("register `" + Twine(RI.getName(Register)) +
"' modified more than once");
}

void HexagonMCChecker::reportErrorNewValue(unsigned Register) {
void HexagonMCChecker::reportErrorNewValue(MCRegister Register) {
reportError("register `" + Twine(RI.getName(Register)) +
"' used with `.new' "
"but not validly modified in the same packet");
Expand Down
38 changes: 19 additions & 19 deletions llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCChecker.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,41 +39,41 @@ class HexagonMCChecker {
bool ReportErrors;

/// Set of definitions: register #, if predicated, if predicated true.
using PredSense = std::pair<unsigned, bool>;
using PredSense = std::pair<MCRegister, bool>;
static const PredSense Unconditional;
using PredSet = std::multiset<PredSense>;
using PredSetIterator = std::multiset<PredSense>::iterator;

using DefsIterator = DenseMap<unsigned, PredSet>::iterator;
DenseMap<unsigned, PredSet> Defs;
using DefsIterator = DenseMap<MCRegister, PredSet>::iterator;
DenseMap<MCRegister, PredSet> Defs;

/// Set of weak definitions whose clashes should be enforced selectively.
using SoftDefsIterator = std::set<unsigned>::iterator;
std::set<unsigned> SoftDefs;
using SoftDefsIterator = std::set<MCRegister>::iterator;
std::set<MCRegister> SoftDefs;

/// Set of temporary definitions not committed to the register file.
using TmpDefsIterator = std::set<unsigned>::iterator;
std::set<unsigned> TmpDefs;
using TmpDefsIterator = std::set<MCRegister>::iterator;
std::set<MCRegister> TmpDefs;

/// Set of new predicates used.
using NewPredsIterator = std::set<unsigned>::iterator;
std::set<unsigned> NewPreds;
using NewPredsIterator = std::set<MCRegister>::iterator;
std::set<MCRegister> NewPreds;

/// Set of predicates defined late.
using LatePredsIterator = std::multiset<unsigned>::iterator;
std::multiset<unsigned> LatePreds;
using LatePredsIterator = std::multiset<MCRegister>::iterator;
std::multiset<MCRegister> LatePreds;

/// Set of uses.
using UsesIterator = std::set<unsigned>::iterator;
std::set<unsigned> Uses;
using UsesIterator = std::set<MCRegister>::iterator;
std::set<MCRegister> Uses;

/// Pre-defined set of read-only registers.
using ReadOnlyIterator = std::set<unsigned>::iterator;
std::set<unsigned> ReadOnly;
using ReadOnlyIterator = std::set<MCRegister>::iterator;
std::set<MCRegister> ReadOnly;

// Contains the vector-pair-registers with the even number
// first ("v0:1", e.g.) used/def'd in this packet.
std::set<unsigned> ReversePairs;
std::set<MCRegister> ReversePairs;

void init();
void init(MCInst const &);
Expand Down Expand Up @@ -107,7 +107,7 @@ class HexagonMCChecker {

static void compoundRegisterMap(unsigned &);

bool isLoopRegister(unsigned R) const {
bool isLoopRegister(MCRegister R) const {
return (Hexagon::SA0 == R || Hexagon::LC0 == R || Hexagon::SA1 == R ||
Hexagon::LC1 == R);
}
Expand All @@ -120,8 +120,8 @@ class HexagonMCChecker {
MCSubtargetInfo const &STI, bool CopyReportErrors);

bool check(bool FullCheck = true);
void reportErrorRegisters(unsigned Register);
void reportErrorNewValue(unsigned Register);
void reportErrorRegisters(MCRegister Register);
void reportErrorNewValue(MCRegister Register);
void reportError(SMLoc Loc, Twine const &Msg);
void reportNote(SMLoc Loc, Twine const &Msg);
void reportError(Twine const &Msg);
Expand Down
Loading