[llvm] r311917 - Address r311914 review comments
Matthias Braun via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 28 13:11:27 PDT 2017
Author: matze
Date: Mon Aug 28 13:11:27 2017
New Revision: 311917
URL: http://llvm.org/viewvc/llvm-project?rev=311917&view=rev
Log:
Address r311914 review comments
Modified:
llvm/trunk/test/TableGen/ConcatenatedSubregs.td
llvm/trunk/utils/TableGen/CodeGenRegisters.cpp
Modified: llvm/trunk/test/TableGen/ConcatenatedSubregs.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/TableGen/ConcatenatedSubregs.td?rev=311917&r1=311916&r2=311917&view=diff
==============================================================================
--- llvm/trunk/test/TableGen/ConcatenatedSubregs.td (original)
+++ llvm/trunk/test/TableGen/ConcatenatedSubregs.td Mon Aug 28 13:11:27 2017
@@ -13,6 +13,12 @@ class MyClass<int size, list<ValueType>
let Size = size;
}
+// Register Example:
+// D0_D1 -- D0 (sub0) -- S0 (ssub0)
+// \ \- S1 (ssub1)
+// \ D1 (sub1) -- S2 (ssub2)
+// \- S3 (ssub3)
+
def sub0 : SubRegIndex<32>;
def sub1 : SubRegIndex<32, 32>;
def sub2 : SubRegIndex<32, 64>;
Modified: llvm/trunk/utils/TableGen/CodeGenRegisters.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CodeGenRegisters.cpp?rev=311917&r1=311916&r2=311917&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/CodeGenRegisters.cpp (original)
+++ llvm/trunk/utils/TableGen/CodeGenRegisters.cpp Mon Aug 28 13:11:27 2017
@@ -122,12 +122,11 @@ LaneBitmask CodeGenSubRegIndex::computeL
void CodeGenSubRegIndex::setConcatenationOf(
ArrayRef<CodeGenSubRegIndex*> Parts) {
- if (ConcatenationOf.empty()) {
+ if (ConcatenationOf.empty())
ConcatenationOf.assign(Parts.begin(), Parts.end());
- } else {
+ else
assert(std::equal(Parts.begin(), Parts.end(),
ConcatenationOf.begin()) && "parts consistent");
- }
}
void CodeGenSubRegIndex::computeConcatTransitiveClosure() {
@@ -492,16 +491,15 @@ void CodeGenRegister::computeSecondarySu
SmallVector<CodeGenSubRegIndex*, 8> Parts;
// We know that the first component is (SubRegIdx,SubReg). However we
// may still need to split it into smaller subregister parts.
- assert(Cand->ExplicitSubRegs[0] == SubReg);
- assert(getSubRegIndex(SubReg) == SubRegIdx);
+ assert(Cand->ExplicitSubRegs[0] == SubReg && "LeadingSuperRegs correct");
+ assert(getSubRegIndex(SubReg) == SubRegIdx && "LeadingSuperRegs correct");
for (CodeGenRegister *SubReg : Cand->ExplicitSubRegs) {
if (CodeGenSubRegIndex *SubRegIdx = getSubRegIndex(SubReg)) {
if (SubRegIdx->ConcatenationOf.empty()) {
Parts.push_back(SubRegIdx);
- } else {
+ } else
for (CodeGenSubRegIndex *SubIdx : SubRegIdx->ConcatenationOf)
Parts.push_back(SubIdx);
- }
} else {
// Sub-register doesn't exist.
Parts.clear();
More information about the llvm-commits
mailing list