[PATCH] D36534: [aarch64] Support APInt and APFloat in ImmLeaf subclasses and make AArch64 use them.

Daniel Sanders via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 9 10:31:25 PDT 2017


dsanders created this revision.
Herald added subscribers: kristof.beyls, igorb, javed.absar, rengolin, aemerson.

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 int64_t's
produced by zero-extending an APInt, APInt itself, 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 https://reviews.llvm.org/D36086


https://reviews.llvm.org/D36534

Files:
  include/llvm/ADT/APFloat.h
  include/llvm/CodeGen/SelectionDAGNodes.h
  include/llvm/Target/TargetSelectionDAG.td
  lib/Target/AArch64/AArch64InstrFormats.td
  utils/TableGen/CodeGenDAGPatterns.cpp
  utils/TableGen/CodeGenDAGPatterns.h
  utils/TableGen/GlobalISelEmitter.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D36534.110433.patch
Type: text/x-patch
Size: 12160 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170809/e070330b/attachment-0001.bin>


More information about the llvm-commits mailing list