[PATCH] DAGCombiner: Fold pointless truncate, bitcast, buildvector series

Arnold Schwaighofer aschwaighofer at apple.com
Fri Feb 15 13:57:52 PST 2013


For example (2xi32) (truncate ((2xi64) bitcast (buildvector i32 a, i32 x, i32 b, i32 y)))
can be folded into a (2xi32) (buildvector i32 a, i32 b).

Such a DAG would cause uneccessary vdup instructions followed by vmovn
instructions on ARM.

We legalize to such a DAG on ARM NEON for a setcc olt, 2xf64, 2xf64. For example, in
the vectorized version of the code below.

double A[N];
double B[N];

void test_double_compare_to_double() {
  int i;
  for(i=0;i<N;i++)
    A[i] = (double)(A[i] < B[i]);
}

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-DAGCombiner-Fold-pointless-truncate-bitcast-buildvec.patch
Type: application/octet-stream
Size: 4818 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130215/e986ee50/attachment.obj>
-------------- next part --------------


Thanks


More information about the llvm-commits mailing list