[ARM] Allow `ARMVectorRegCast` to match bitconverts too. (NFC)
authorSimon Tatham <simon.tatham@arm.com>
Mon, 17 Feb 2020 17:05:52 +0000 (17:05 +0000)
committerSimon Tatham <simon.tatham@arm.com>
Tue, 18 Feb 2020 09:34:50 +0000 (09:34 +0000)
commit9dcc1667abfc49bf6d44688a02e12cd96244ea72
tree086b1d07aacbb06386bf0b7cd6ab5daad615c005
parent68b49f7ef49eec068b7ddcf86c868e2a193e64e1
[ARM] Allow `ARMVectorRegCast` to match bitconverts too. (NFC)

Summary:
When we start putting instances of `ARMVectorRegCast` in complex isel
patterns, it will be awkward that they're often turned into the more
standard `bitconvert` in little-endian mode. We'd rather not have to
write separate isel patterns for the two endiannesses, matching
different but equivalent cast operations.

This change aims to fix that awkwardness in advance, by turning the
Tablegen record `ARMVectorRegCast` from a simple `SDNode` instance
into a `PatFrags` that can match either kind of cast – with a
predicate that prevents it matching a bitconvert in the big-endian
case, where bitconvert isn't semantically identical.

No existing code generation should be affected by this change, but it
will enable the patterns introduced by D74336 to work in both
endiannesses.

Reviewers: dmgreen

Reviewed By: dmgreen

Subscribers: kristof.beyls, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D74716
llvm/lib/Target/ARM/ARMInstrInfo.td
llvm/lib/Target/ARM/ARMInstrMVE.td
llvm/lib/Target/ARM/ARMInstrNEON.td