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

Nadav Rotem nrotem at apple.com
Wed Feb 20 08:58:21 PST 2013


LGTM. 


On Feb 20, 2013, at 5:40 AM, Arnold Schwaighofer <aschwaighofer at apple.com> wrote:

> Ping.
> 
> 
> On Feb 15, 2013, at 4:24 PM, Arnold Schwaighofer <aschwaighofer at apple.com> wrote:
> 
>> Updated patch, moved the detailed explanation from the .ll test to llvm.org/bugs. We probably don't want this much text in an regression test.
>> 
>> 
>> <0001-DAGCombiner-Fold-pointless-truncate-bitcast-buildvec.patch>
>> 
>> Thanks
>> 
>> On Feb 15, 2013, at 3:57 PM, Arnold Schwaighofer <aschwaighofer at apple.com> wrote:
>> 
>>> 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]);
>>> }
>>> 
>>> <0001-DAGCombiner-Fold-pointless-truncate-bitcast-buildvec.patch>
> 
> 
> <0001-DAGCombiner-Fold-pointless-truncate-bitcast-buildvec.patch>




More information about the llvm-commits mailing list