diff options
author | Daniel Sanders <daniel_l_sanders@apple.com> | 2017-10-13 20:42:18 +0000 |
---|---|---|
committer | Daniel Sanders <daniel_l_sanders@apple.com> | 2017-10-13 20:42:18 +0000 |
commit | 649c585710df40c22765fcc1822cc2d0f0ebb4c2 (patch) | |
tree | 35d2c064af1353194ec3c266b2aa14dbf7ac0b9e /llvm/utils/TableGen/CodeGenDAGPatterns.h | |
parent | d76ed069eb208db4b8342003abb7e09f24b35bc1 (diff) | |
download | bcm5719-llvm-649c585710df40c22765fcc1822cc2d0f0ebb4c2.tar.gz bcm5719-llvm-649c585710df40c22765fcc1822cc2d0f0ebb4c2.zip |
[aarch64] Support APInt and APFloat in ImmLeaf subclasses and make AArch64 use them.
Summary:
The purpose of this patch is to expose more information about ImmLeaf-like
PatLeaf's so that GlobalISel can learn to import them. Previously, ImmLeaf
could only be used to test int64_t's produced by sign-extending an APInt.
Other tests on immediates had to use the generic PatLeaf and extract the
constant using C++.
With this patch, tablegen will know how to generate predicates for APInt,
and APFloat. This will allow it to 'do the right thing' for both SelectionDAG
and GlobalISel which require different methods of extracting the immediate
from the IR.
This is NFC for SelectionDAG since the new code is equivalent to the
previous code. It's also NFC for FastISel because FastIselShouldIgnore is 1
for the ImmLeaf subclasses. Enabling FastIselShouldIgnore == 0 for these new
subclasses will require a significant re-factor of FastISel.
For GlobalISel, it's currently NFC because the relevant code to import the
affected rules is not yet present. This will be added in a later patch.
Depends on D36086
Reviewers: ab, t.p.northover, qcolombet, rovka, aditya_nandakumar
Reviewed By: qcolombet
Subscribers: bjope, aemerson, rengolin, javed.absar, igorb, llvm-commits, kristof.beyls
Differential Revision: https://reviews.llvm.org/D36534
llvm-svn: 315747
Diffstat (limited to 'llvm/utils/TableGen/CodeGenDAGPatterns.h')
-rw-r--r-- | llvm/utils/TableGen/CodeGenDAGPatterns.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/utils/TableGen/CodeGenDAGPatterns.h b/llvm/utils/TableGen/CodeGenDAGPatterns.h index 2b434261680..3033986fdd4 100644 --- a/llvm/utils/TableGen/CodeGenDAGPatterns.h +++ b/llvm/utils/TableGen/CodeGenDAGPatterns.h @@ -475,9 +475,14 @@ public: /// appropriate. std::string getCodeToRunOnSDNode() const; + /// Get the data type of the argument to getImmediatePredicateCode(). + std::string getImmType() const; + private: std::string getPredCode() const; std::string getImmCode() const; + bool immCodeUsesAPInt() const; + bool immCodeUsesAPFloat() const; }; |