summaryrefslogtreecommitdiffstats
path: root/llvm/utils/TableGen/GlobalISelEmitter.cpp
diff options
context:
space:
mode:
authorDaniel Sanders <daniel_l_sanders@apple.com>2017-10-09 18:14:53 +0000
committerDaniel Sanders <daniel_l_sanders@apple.com>2017-10-09 18:14:53 +0000
commit4d4e7650dcfa1fe2b0129b0884baa5a2bdc0df56 (patch)
treee82d95445295f5ce835b958aa1c11b3b762c3b1d /llvm/utils/TableGen/GlobalISelEmitter.cpp
parent0b9db4c1fa58dc42ce8eba8fe4f193bf0438a551 (diff)
downloadbcm5719-llvm-4d4e7650dcfa1fe2b0129b0884baa5a2bdc0df56.tar.gz
bcm5719-llvm-4d4e7650dcfa1fe2b0129b0884baa5a2bdc0df56.zip
[globalisel] Add support for ValueType operands in patterns.
It's rare but there are a small number of patterns like this: (set i64:$dst, (add i64:$src1, i64:$src2)) These should be equivalent to register classes except they shouldn't check for a specific register bank. This doesn't occur in AArch64/ARM/X86 but does occasionally come up in other in-tree targets such as BPF. llvm-svn: 315226
Diffstat (limited to 'llvm/utils/TableGen/GlobalISelEmitter.cpp')
-rw-r--r--llvm/utils/TableGen/GlobalISelEmitter.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/llvm/utils/TableGen/GlobalISelEmitter.cpp b/llvm/utils/TableGen/GlobalISelEmitter.cpp
index 5a85503e710..eb2d128dc96 100644
--- a/llvm/utils/TableGen/GlobalISelEmitter.cpp
+++ b/llvm/utils/TableGen/GlobalISelEmitter.cpp
@@ -2122,6 +2122,13 @@ Error GlobalISelEmitter::importChildMatcher(InstructionMatcher &InsnMatcher,
return Error::success();
}
+ // Check for ValueType.
+ if (ChildRec->isSubClassOf("ValueType")) {
+ // We already added a type check as standard practice so this doesn't need
+ // to do anything.
+ return Error::success();
+ }
+
// Check for ComplexPattern's.
if (ChildRec->isSubClassOf("ComplexPattern")) {
const auto &ComplexPattern = ComplexPatternEquivs.find(ChildRec);
@@ -2200,7 +2207,8 @@ Error GlobalISelEmitter::importExplicitUseRenderer(
}
if (ChildRec->isSubClassOf("RegisterClass") ||
- ChildRec->isSubClassOf("RegisterOperand")) {
+ ChildRec->isSubClassOf("RegisterOperand") ||
+ ChildRec->isSubClassOf("ValueType")) {
DstMIBuilder.addRenderer<CopyRenderer>(0, InsnMatcher,
DstChild->getName());
return Error::success();
OpenPOWER on IntegriCloud