summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrzysztof Parzyszek <kparzysz@codeaurora.org>2017-03-24 19:18:29 +0000
committerKrzysztof Parzyszek <kparzysz@codeaurora.org>2017-03-24 19:18:29 +0000
commitedd1ca203b1ee622c3b027d14a94867269a13c55 (patch)
tree459b0d13dabf981bbcb4d10dde6320dfc78d11b9
parent4994bc0474d62ad742329584af5e230e5c56649d (diff)
downloadbcm5719-llvm-edd1ca203b1ee622c3b027d14a94867269a13c55.tar.gz
bcm5719-llvm-edd1ca203b1ee622c3b027d14a94867269a13c55.zip
Revert r298652 on Quentin's request
llvm-svn: 298727
-rw-r--r--llvm/include/llvm/MC/MCRegisterInfo.h9
-rw-r--r--llvm/include/llvm/Target/TargetRegisterInfo.h5
-rw-r--r--llvm/utils/TableGen/RegisterInfoEmitter.cpp8
3 files changed, 15 insertions, 7 deletions
diff --git a/llvm/include/llvm/MC/MCRegisterInfo.h b/llvm/include/llvm/MC/MCRegisterInfo.h
index 0e8008f88c3..76ab4ad3539 100644
--- a/llvm/include/llvm/MC/MCRegisterInfo.h
+++ b/llvm/include/llvm/MC/MCRegisterInfo.h
@@ -41,6 +41,7 @@ public:
const uint16_t RegsSize;
const uint16_t RegSetSize;
const uint16_t ID;
+ const uint16_t RegSize, Alignment; // Size & Alignment of register in bytes
const int8_t CopyCost;
const bool Allocatable;
@@ -79,6 +80,14 @@ public:
return contains(Reg1) && contains(Reg2);
}
+ /// getSize - Return the size of the register in bytes, which is also the size
+ /// of a stack slot allocated to hold a spilled copy of this register.
+ unsigned getSize() const { return RegSize; }
+
+ /// getAlignment - Return the minimum required alignment for a register of
+ /// this class.
+ unsigned getAlignment() const { return Alignment; }
+
/// getCopyCost - Return the cost of copying a value between two registers in
/// this class. A negative number means the register class is very expensive
/// to copy e.g. status flag register classes.
diff --git a/llvm/include/llvm/Target/TargetRegisterInfo.h b/llvm/include/llvm/Target/TargetRegisterInfo.h
index 3f5daea63ab..5a4f1a709ef 100644
--- a/llvm/include/llvm/Target/TargetRegisterInfo.h
+++ b/llvm/include/llvm/Target/TargetRegisterInfo.h
@@ -45,7 +45,6 @@ public:
// Instance variables filled by tablegen, do not use!
const MCRegisterClass *MC;
- const uint16_t SpillSize, SpillAlignment;
const vt_iterator VTs;
const uint32_t *SubClassMask;
const uint16_t *SuperRegIndices;
@@ -95,10 +94,10 @@ public:
/// Return the size of the register in bytes, which is also the size
/// of a stack slot allocated to hold a spilled copy of this register.
- unsigned getSize() const { return SpillSize; }
+ unsigned getSize() const { return MC->getSize(); }
/// Return the minimum required alignment for a register of this class.
- unsigned getAlignment() const { return SpillAlignment; }
+ unsigned getAlignment() const { return MC->getAlignment(); }
/// Return the cost of copying a value between two registers in this class.
/// A negative number means the register class is very expensive
diff --git a/llvm/utils/TableGen/RegisterInfoEmitter.cpp b/llvm/utils/TableGen/RegisterInfoEmitter.cpp
index 6ab38b6e124..b75be13c048 100644
--- a/llvm/utils/TableGen/RegisterInfoEmitter.cpp
+++ b/llvm/utils/TableGen/RegisterInfoEmitter.cpp
@@ -1025,12 +1025,16 @@ RegisterInfoEmitter::runMCDesc(raw_ostream &OS, CodeGenTarget &Target,
for (const auto &RC : RegisterClasses) {
// Asserts to make sure values will fit in table assuming types from
// MCRegisterInfo.h
+ assert((RC.SpillSize/8) <= 0xffff && "SpillSize too large.");
+ assert((RC.SpillAlignment/8) <= 0xffff && "SpillAlignment too large.");
assert(RC.CopyCost >= -128 && RC.CopyCost <= 127 && "Copy cost too large.");
OS << " { " << RC.getName() << ", " << RC.getName() << "Bits, "
<< RegClassStrings.get(RC.getName()) << ", "
<< RC.getOrder().size() << ", sizeof(" << RC.getName() << "Bits), "
<< RC.getQualifiedName() + "RegClassID" << ", "
+ << RC.SpillSize/8 << ", "
+ << RC.SpillAlignment/8 << ", "
<< RC.CopyCost << ", "
<< ( RC.Allocatable ? "true" : "false" ) << " },\n";
}
@@ -1312,13 +1316,9 @@ RegisterInfoEmitter::runTargetDesc(raw_ostream &OS, CodeGenTarget &Target,
<< " { // Register class instances\n";
for (const auto &RC : RegisterClasses) {
- assert(isUInt<16>(RC.SpillSize/8) && "SpillSize too large.");
- assert(isUInt<16>(RC.SpillAlignment/8) && "SpillAlignment too large.");
OS << " extern const TargetRegisterClass " << RC.getName()
<< "RegClass = {\n " << '&' << Target.getName()
<< "MCRegisterClasses[" << RC.getName() << "RegClassID],\n "
- << RC.SpillSize/8 << ", /* SpillSize */\n "
- << RC.SpillAlignment/8 << ", /* SpillAlignment */\n "
<< "VTLists + " << VTSeqs.get(RC.VTs) << ",\n " << RC.getName()
<< "SubClassMask,\n SuperRegIdxSeqs + "
<< SuperRegIdxSeqs.get(SuperRegIdxLists[RC.EnumValue]) << ",\n ";
OpenPOWER on IntegriCloud