diff options
author | Daniel Sanders <daniel_l_sanders@apple.com> | 2017-10-13 21:28:03 +0000 |
---|---|---|
committer | Daniel Sanders <daniel_l_sanders@apple.com> | 2017-10-13 21:28:03 +0000 |
commit | 11300cead8fd7ecc31f71cdf493e69e4c66a5e82 (patch) | |
tree | ec96a8c5ee9a0e7d9094a46e9e13d53555ae969d /llvm/utils/TableGen/CodeGenDAGPatterns.cpp | |
parent | 3b87939604dbbac3dbe7a60927fb53dc4a7fb3da (diff) | |
download | llvm-11300cead8fd7ecc31f71cdf493e69e4c66a5e82.zip llvm-11300cead8fd7ecc31f71cdf493e69e4c66a5e82.tar.gz llvm-11300cead8fd7ecc31f71cdf493e69e4c66a5e82.tar.bz2 |
[globalisel][tablegen] Add support for fpimm and import of APInt/APFloat based ImmLeaf.
Summary:
There's only a tablegen testcase for IntImmLeaf and not a CodeGen one
because the relevant rules are rejected for other reasons at the moment.
On AArch64, it's because there's an SDNodeXForm attached to the operand.
On X86, it's because the rule either emits multiple instructions or has
another predicate using PatFrag which cannot easily be supported at the
same time.
Reviewers: ab, t.p.northover, qcolombet, rovka, aditya_nandakumar
Reviewed By: qcolombet
Subscribers: aemerson, javed.absar, igorb, llvm-commits, kristof.beyls
Differential Revision: https://reviews.llvm.org/D36569
llvm-svn: 315761
Diffstat (limited to 'llvm/utils/TableGen/CodeGenDAGPatterns.cpp')
-rw-r--r-- | llvm/utils/TableGen/CodeGenDAGPatterns.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/utils/TableGen/CodeGenDAGPatterns.cpp b/llvm/utils/TableGen/CodeGenDAGPatterns.cpp index a9f1b0b..ced3e97 100644 --- a/llvm/utils/TableGen/CodeGenDAGPatterns.cpp +++ b/llvm/utils/TableGen/CodeGenDAGPatterns.cpp @@ -881,6 +881,14 @@ std::string TreePredicateFn::getImmType() const { return "int64_t"; } +std::string TreePredicateFn::getImmTypeIdentifier() const { + if (immCodeUsesAPInt()) + return "APInt"; + else if (immCodeUsesAPFloat()) + return "APFloat"; + return "I64"; +} + /// isAlwaysTrue - Return true if this is a noop predicate. bool TreePredicateFn::isAlwaysTrue() const { return getPredCode().empty() && getImmCode().empty(); |