[AArch64] Generalize extract-high DUP extension to MOVI/MVNI.
authorAhmed Bougacha <ahmed.bougacha@gmail.com>
Tue, 16 Jun 2015 01:18:14 +0000 (01:18 +0000)
committerAhmed Bougacha <ahmed.bougacha@gmail.com>
Tue, 16 Jun 2015 01:18:14 +0000 (01:18 +0000)
commit819a6b7d4b3f1479526e12a62158b8acbf0fd535
treed44f595872dbf7cf0d2690fa961aff672ca01fa5
parentd4521f1dd5946b728bb93b5b3729ec4c49967407
[AArch64] Generalize extract-high DUP extension to MOVI/MVNI.

These are really immediate DUPs, and suffer from the same problem
with long instructions with a high/2 variant (e.g. smull).

By extending a MOVI (or DUP, before this patch), we can avoid an ext
on the other operand of the long instruction, e.g. turning:
    ext.16b v0, v0, v0, #8
    movi.4h v1, #0x53
    smull.4s  v0, v0, v1
into:
    movi.8h v1, #0x53
    smull2.4s  v0, v0, v1

While there, add a now-necessary combine to fold (VT NVCAST (VT x)).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239799 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/AArch64/AArch64ISelLowering.cpp
test/CodeGen/AArch64/arm64-neon-2velem-high.ll