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/utils/TableGen/Common/CodeGenRegisters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1333,7 +1333,7 @@ CodeGenSubRegIndex *CodeGenRegBank::getSubRegIdx(const Record *Def) {

const CodeGenSubRegIndex *
CodeGenRegBank::findSubRegIdx(const Record *Def) const {
return Def2SubRegIdx.lookup(Def);
return Def2SubRegIdx.at(Def);
}

CodeGenRegister *CodeGenRegBank::getReg(const Record *Def) {
Expand Down
1 change: 0 additions & 1 deletion llvm/utils/TableGen/DAGISelMatcherGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,6 @@ void MatcherGen::EmitResultLeafAsOperand(const TreePatternNode &N,
// 7 bit and we cannot use StringInteger.
if (RB.getSubRegIndices().size() > 127) {
const CodeGenSubRegIndex *I = RB.findSubRegIdx(Def);
assert(I && "Cannot find subreg index by name!");
if (I->EnumValue > 127) {
AddMatcher(new EmitIntegerMatcher(I->EnumValue, MVT::i32,
NextRecordedOperandNo));
Expand Down
12 changes: 7 additions & 5 deletions llvm/utils/TableGen/GlobalISelEmitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1333,7 +1333,7 @@ Error GlobalISelEmitter::importLeafNodeRenderer(
}

if (R->isSubClassOf("SubRegIndex")) {
const CodeGenSubRegIndex *SubRegIndex = CGRegs.getSubRegIdx(R);
const CodeGenSubRegIndex *SubRegIndex = CGRegs.findSubRegIdx(R);
MIBuilder.addRenderer<ImmRenderer>(SubRegIndex->EnumValue);
return Error::success();
}
Expand Down Expand Up @@ -1606,7 +1606,8 @@ Expected<action_iterator> GlobalISelEmitter::importExplicitUseRenderers(
if (!SubRegInit)
return failedImport("EXTRACT_SUBREG child #1 is not a subreg index");

CodeGenSubRegIndex *SubIdx = CGRegs.getSubRegIdx(SubRegInit->getDef());
const CodeGenSubRegIndex *SubIdx =
CGRegs.findSubRegIdx(SubRegInit->getDef());
const TreePatternNode &ValChild = Dst.getChild(0);
if (!ValChild.isLeaf()) {
// We really have to handle the source instruction, and then insert a
Expand Down Expand Up @@ -1675,7 +1676,8 @@ Expected<action_iterator> GlobalISelEmitter::importExplicitUseRenderers(

if (const DefInit *SubRegInit =
dyn_cast<DefInit>(SubRegChild.getLeafValue())) {
CodeGenSubRegIndex *SubIdx = CGRegs.getSubRegIdx(SubRegInit->getDef());
const CodeGenSubRegIndex *SubIdx =
CGRegs.findSubRegIdx(SubRegInit->getDef());

if (Error Err = importNodeRenderer(M, DstMIBuilder, ValChild, InsertPt))
return Err;
Expand Down Expand Up @@ -2004,7 +2006,7 @@ const CodeGenRegisterClass *GlobalISelEmitter::inferSuperRegisterClass(
const DefInit *SubRegInit = dyn_cast<DefInit>(SubRegIdxNode.getLeafValue());
if (!SubRegInit)
return nullptr;
const CodeGenSubRegIndex *SubIdx = CGRegs.getSubRegIdx(SubRegInit->getDef());
const CodeGenSubRegIndex *SubIdx = CGRegs.findSubRegIdx(SubRegInit->getDef());

// Use the information we found above to find a minimal register class which
// supports the subregister and type we want.
Expand Down Expand Up @@ -2034,7 +2036,7 @@ const CodeGenSubRegIndex *GlobalISelEmitter::inferSubRegIndexForNode(
const DefInit *SubRegInit = dyn_cast<DefInit>(SubRegIdxNode.getLeafValue());
if (!SubRegInit)
return nullptr;
return CGRegs.getSubRegIdx(SubRegInit->getDef());
return CGRegs.findSubRegIdx(SubRegInit->getDef());
}

Expected<RuleMatcher> GlobalISelEmitter::runOnPattern(const PatternToMatch &P) {
Expand Down
Loading