[ARM] Look through concat when lowering in-place shuffles (VZIP, ..)
authorAhmed Bougacha <ahmed.bougacha@gmail.com>
Fri, 19 Jun 2015 02:32:35 +0000 (02:32 +0000)
committerAhmed Bougacha <ahmed.bougacha@gmail.com>
Fri, 19 Jun 2015 02:32:35 +0000 (02:32 +0000)
commit9a9094260d8147faf21289bca86d3035e30cf588
treec2d09575bbee1748fc2e43d4dab3bda677b6f5c2
parentd954601f636464a0beae2d8ae3883631bda9467f
[ARM] Look through concat when lowering in-place shuffles (VZIP, ..)

Currently, we canonicalize shuffles that produce a result larger than
their operands with:
  shuffle(concat(v1, undef), concat(v2, undef))
->
  shuffle(concat(v1, v2), undef)

because we can access quad vectors (see PerformVECTOR_SHUFFLECombine).

This is useful in the general case, but there are special cases where
native shuffles produce larger results: the two-result ops.

We can look through the concat when lowering them:
  shuffle(concat(v1, v2), undef)
->
  concat(VZIP(v1, v2):0, :1)

This lets us generate the native shuffles instead of scalarizing to
dozens of VMOVs.

Differential Revision: http://reviews.llvm.org/D10424

llvm-svn: 240118
llvm/lib/Target/ARM/ARMISelLowering.cpp
llvm/test/CodeGen/ARM/vtrn.ll
llvm/test/CodeGen/ARM/vuzp.ll
llvm/test/CodeGen/ARM/vzip.ll