summaryrefslogtreecommitdiffstats
path: root/llvm/utils/TableGen
diff options
context:
space:
mode:
authorRoman Tereshin <rtereshin@apple.com>2018-05-23 23:58:10 +0000
committerRoman Tereshin <rtereshin@apple.com>2018-05-23 23:58:10 +0000
commit5f5e55008f70e65b66f84d313839cde8b74f0c34 (patch)
tree1b58dd5ed9feae770b61493d962c66f375a18f75 /llvm/utils/TableGen
parent8e8d4b91a8ac41d28e8db3a2b97143a0998856d8 (diff)
downloadbcm5719-llvm-5f5e55008f70e65b66f84d313839cde8b74f0c34.tar.gz
bcm5719-llvm-5f5e55008f70e65b66f84d313839cde8b74f0c34.zip
[GlobalISel][InstructionSelect] Moving Reg Bank Checks forward, perf patch 9
This patch continues a series of patches started by r332907 (reapplied as r332917). In this commit we move register bank checks back from epilogue of every rule matcher to a position locally close to the rest of the checks for a particular (nested) instruction. This increases the number of common conditions within 2nd level groups. This is expected to decrease time GlobalISel spends in its InstructionSelect pass by about 2% 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: 333144
Diffstat (limited to 'llvm/utils/TableGen')
-rw-r--r--llvm/utils/TableGen/GlobalISelEmitter.cpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/llvm/utils/TableGen/GlobalISelEmitter.cpp b/llvm/utils/TableGen/GlobalISelEmitter.cpp
index d353bf283e1..dbfecf7d393 100644
--- a/llvm/utils/TableGen/GlobalISelEmitter.cpp
+++ b/llvm/utils/TableGen/GlobalISelEmitter.cpp
@@ -4490,17 +4490,14 @@ void RuleMatcher::optimize() {
for (auto &Item : InsnVariableIDs) {
InstructionMatcher &InsnMatcher = *Item.first;
for (auto &OM : InsnMatcher.operands()) {
- // Register Banks checks rarely fail, but often crash as targets usually
- // provide only partially defined RegisterBankInfo::getRegBankFromRegClass
- // method. Often the problem is hidden as non-optimized MatchTable checks
- // banks rather late, most notably after checking target / function /
- // module features and a few opcodes. That makes these checks a)
- // beneficial to delay until the very end (we don't want to perform a lot
- // of checks that all pass and then fail at the very end) b) not safe to
- // have as early checks.
+ // Complex Patterns are usually expensive and they relatively rarely fail
+ // on their own: more often we end up throwing away all the work done by a
+ // matching part of a complex pattern because some other part of the
+ // enclosing pattern didn't match. All of this makes it beneficial to
+ // delay complex patterns until the very end of the rule matching,
+ // especially for targets having lots of complex patterns.
for (auto &OP : OM->predicates())
- if (isa<RegisterBankOperandMatcher>(OP) ||
- isa<ComplexPatternOperandMatcher>(OP))
+ if (isa<ComplexPatternOperandMatcher>(OP))
EpilogueMatchers.emplace_back(std::move(OP));
OM->eraseNullPredicates();
}
OpenPOWER on IntegriCloud