diff options
author | Daniel Sanders <daniel_l_sanders@apple.com> | 2017-11-30 18:48:35 +0000 |
---|---|---|
committer | Daniel Sanders <daniel_l_sanders@apple.com> | 2017-11-30 18:48:35 +0000 |
commit | f499b2bf1fca94da16358228d7a5dc94bc851ba4 (patch) | |
tree | d8c548d03be7a369cd54624d5c5791765e06c61e /llvm/utils/TableGen/GlobalISelEmitter.cpp | |
parent | ca6dbf1440e66f8a726cda3797c5e61b2376ec8d (diff) | |
download | bcm5719-llvm-f499b2bf1fca94da16358228d7a5dc94bc851ba4.tar.gz bcm5719-llvm-f499b2bf1fca94da16358228d7a5dc94bc851ba4.zip |
[globalisel][tablegen] Add support for specific immediates in the match pattern
This enables a few rules such as ARM's uxtb instruction.
llvm-svn: 319457
Diffstat (limited to 'llvm/utils/TableGen/GlobalISelEmitter.cpp')
-rw-r--r-- | llvm/utils/TableGen/GlobalISelEmitter.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/utils/TableGen/GlobalISelEmitter.cpp b/llvm/utils/TableGen/GlobalISelEmitter.cpp index f82b2fd3e9b..d9048c231c2 100644 --- a/llvm/utils/TableGen/GlobalISelEmitter.cpp +++ b/llvm/utils/TableGen/GlobalISelEmitter.cpp @@ -2812,6 +2812,14 @@ Expected<action_iterator> GlobalISelEmitter::importExplicitUseRenderer( return failedImport("Dst pattern child isn't a leaf node or an MBB" + llvm::to_string(*DstChild)); } + // It could be a specific immediate in which case we should just check for + // that immediate. + if (const IntInit *ChildIntInit = + dyn_cast<IntInit>(DstChild->getLeafValue())) { + DstMIBuilder.addRenderer<ImmRenderer>(ChildIntInit->getValue()); + return InsertPt; + } + // Otherwise, we're looking for a bog-standard RegisterClass operand. if (auto *ChildDefInit = dyn_cast<DefInit>(DstChild->getLeafValue())) { auto *ChildRec = ChildDefInit->getDef(); |