[AArch64] Look through bitcast when looking for extract_high subvector
authorDavid Green <david.green@arm.com>
Sun, 12 Jun 2022 09:59:09 +0000 (10:59 +0100)
committerDavid Green <david.green@arm.com>
Sun, 12 Jun 2022 09:59:09 +0000 (10:59 +0100)
commit963c0a014700ab07bd7c81ffd1789425a297f0fb
treec95fbbc3c5c5f297275fd0404a9a6e23820e4d01
parent2d2da259c8726fd5c974c01122a9689981a12196
[AArch64] Look through bitcast when looking for extract_high subvector

Since D61806, DAGCombiner has folded subvector_extract(bitcast(..)) to
bitcast(subvector_extract(..)), which would place a bitcast between a
subvector_extract and the operation that could be converted to a high
neon instruction (like smull2). This adds better matching for the
subvector_extract, through the tablegen extract_high PatFrags to
optionally skip the bitcast under little ending, still matchings an
extract of the high half of the input vector.

I didn't update the extract_high of a duplicate patterns, as the
ComplexPattern need names operands. I did add a extract_high_dup_v8i16
PatFrag to abstract away the common code, which can be extended in a
future patch.

Differential Revision: https://reviews.llvm.org/D126782
llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp
llvm/lib/Target/AArch64/AArch64InstrFormats.td
llvm/lib/Target/AArch64/AArch64InstrInfo.td
llvm/test/CodeGen/AArch64/highextractbitcast.ll