[AArch64] Improve code generation of constant vectors
authorEvandro Menezes <e.menezes@samsung.com>
Mon, 5 Mar 2018 17:02:47 +0000 (17:02 +0000)
committerEvandro Menezes <e.menezes@samsung.com>
Mon, 5 Mar 2018 17:02:47 +0000 (17:02 +0000)
commitcd855f70c5230a79d0b91cbbf6fb959572e67c50
treee760fa88bff1e24b060a280861294b0e6a18b161
parent3402e876ef1112d9d97d5e6f0f9dab9f05b168b0
[AArch64] Improve code generation of constant vectors

Use the whole gammut of constant immediates available to set up a vector.
Instead of using, for example, `mov w0, #0xffff; dup v0.4s, w0`, which
transfers between register files, use the more efficient `movi v0.4s, #-1`
instead.  Not limited to just a few values, but any immediate value that can
be encoded by all the variants of `FMOV`, `MOVI`, `MVNI`, thus eliminating
the need to there be patterns to optimize special cases.

Differential revision: https://reviews.llvm.org/D42133

llvm-svn: 326718
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
llvm/lib/Target/AArch64/AArch64InstrInfo.td
llvm/test/CodeGen/AArch64/arm64-vector-insertion.ll
llvm/test/CodeGen/AArch64/build-one-lane.ll
llvm/test/CodeGen/AArch64/neon-bitwise-instructions.ll