diff options
author | Roman Tereshin <rtereshin@apple.com> | 2018-05-24 00:24:15 +0000 |
---|---|---|
committer | Roman Tereshin <rtereshin@apple.com> | 2018-05-24 00:24:15 +0000 |
commit | a4c410d50d789f0556eed7ba996fe77846dfb962 (patch) | |
tree | b25e6ce783992ce5df95a7203dd563a714ca4771 /llvm/utils/TableGen/GlobalISelEmitter.cpp | |
parent | 6cef421b3464919d18a8bdc7326b6338d64409e2 (diff) | |
download | bcm5719-llvm-a4c410d50d789f0556eed7ba996fe77846dfb962.tar.gz bcm5719-llvm-a4c410d50d789f0556eed7ba996fe77846dfb962.zip |
[GlobalISel][InstructionSelect] Switching over root LLTs, perf patch 10
This patch continues a series of patches started by r332907 (reapplied
as r332917).
In this commit we introduce new matching opcode for the MatchTable:
GIM_SwitchType, similar to GIM_SwitchOpcode, and use it to switch over
LLTs of def operands of root instructions on the 2nd level of the
MatchTable within GIM_SwitchOpcode's cases.
This is expected to decrease time GlobalISel spends in its
InstructionSelect pass by about 6.5% for an -O0 build as measured on
sqlite3-amalgamation (http://sqlite.org/download.html) targeting
AArch64 (cross-compile on x86).
Reviewers: qcolombet, dsanders, bogner, aemerson, javed.absar
Reviewed By: qcolombet
Subscribers: rovka, llvm-commits, kristof.beyls
Differential Revision: https://reviews.llvm.org/D44700
llvm-svn: 333146
Diffstat (limited to 'llvm/utils/TableGen/GlobalISelEmitter.cpp')
-rw-r--r-- | llvm/utils/TableGen/GlobalISelEmitter.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/llvm/utils/TableGen/GlobalISelEmitter.cpp b/llvm/utils/TableGen/GlobalISelEmitter.cpp index dbfecf7d393..ad461f59256 100644 --- a/llvm/utils/TableGen/GlobalISelEmitter.cpp +++ b/llvm/utils/TableGen/GlobalISelEmitter.cpp @@ -4153,6 +4153,8 @@ void GroupMatcher::optimize() { } GlobalISelEmitter::optimizeRules<GroupMatcher>(Matchers, MatcherStorage) .swap(Matchers); + GlobalISelEmitter::optimizeRules<SwitchMatcher>(Matchers, MatcherStorage) + .swap(Matchers); } void GlobalISelEmitter::run(raw_ostream &OS) { @@ -4641,7 +4643,7 @@ void GroupMatcher::emit(MatchTable &Table) { } bool SwitchMatcher::isSupportedPredicateType(const PredicateMatcher &P) { - return isa<InstructionOpcodeMatcher>(P); + return isa<InstructionOpcodeMatcher>(P) || isa<LLTOperandMatcher>(P); } bool SwitchMatcher::candidateConditionMatches( @@ -4717,6 +4719,13 @@ void SwitchMatcher::emitPredicateSpecificOpcodes(const PredicateMatcher &P, << MatchTable::IntValue(Condition->getInsnVarID()); return; } + if (const auto *Condition = dyn_cast<LLTOperandMatcher>(&P)) { + Table << MatchTable::Opcode("GIM_SwitchType") << MatchTable::Comment("MI") + << MatchTable::IntValue(Condition->getInsnVarID()) + << MatchTable::Comment("Op") + << MatchTable::IntValue(Condition->getOpIdx()); + return; + } llvm_unreachable("emitPredicateSpecificOpcodes is broken: can not handle a " "predicate type that is claimed to be supported"); |