Recommit r355224 "[TableGen][SelectionDAG][X86] Add specific isel matchers for immAll...
authorCraig Topper <craig.topper@intel.com>
Sun, 10 Mar 2019 05:21:52 +0000 (05:21 +0000)
committerCraig Topper <craig.topper@intel.com>
Sun, 10 Mar 2019 05:21:52 +0000 (05:21 +0000)
commit1a872f2b15157dc8a85aac85167d08b73cef1e76
tree8d74e5597c513655d6a5cf60a1286a2f2e46758a
parentb68566aec32d7bf361a51183b4f161d14e50f0c6
Recommit r355224 "[TableGen][SelectionDAG][X86] Add specific isel matchers for immAllZerosV/immAllOnesV. Remove bitcasts from X86 patterns that are no longer necessary."

Includes a fix to emit a CheckOpcode for build_vector when immAllZerosV/immAllOnesV is used as a pattern root. This means it can't be used to look through bitcasts when used as a root, but that's probably ok. This extra CheckOpcode will ensure that the first match in the isel table will be a SwitchOpcode which is needed by the caching optimization in the ISel Matcher.

Original commit message:

Previously we had build_vector PatFrags that called ISD::isBuildVectorAllZeros/Ones. Internally the ISD::isBuildVectorAllZeros/Ones look through bitcasts, but we aren't able to take advantage of that in isel. Instead of we have to canonicalize the types of the all zeros/ones build_vectors and insert bitcasts. Then we have to pattern match those exact bitcasts.

By emitting specific matchers for these 2 nodes, we can make isel look through any bitcasts without needing to explicitly match them. We should also be able to remove the canonicalization to vXi32 from lowering, but I've left that for a follow up.

This removes something like 40,000 bytes from the X86 isel table.

Differential Revision: https://reviews.llvm.org/D58595

llvm-svn: 355784
12 files changed:
llvm/include/llvm/CodeGen/SelectionDAGISel.h
llvm/include/llvm/Target/TargetSelectionDAG.td
llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
llvm/lib/Target/SystemZ/SystemZOperators.td
llvm/lib/Target/X86/X86InstrAVX512.td
llvm/lib/Target/X86/X86InstrSSE.td
llvm/lib/Target/X86/X86InstrVecCompiler.td
llvm/utils/TableGen/CodeGenDAGPatterns.cpp
llvm/utils/TableGen/DAGISelMatcher.cpp
llvm/utils/TableGen/DAGISelMatcher.h
llvm/utils/TableGen/DAGISelMatcherEmitter.cpp
llvm/utils/TableGen/DAGISelMatcherGen.cpp