In the common case where we are shuffling a vector, emit an
llvm vector shuffle instead of a bunch of insert/extract operations.
For:   vec4 = vec4.yyyy;  // splat

Emit:
        %tmp1 = shufflevector <4 x float> %tmp, <4 x float> undef, <4 x i32> < i32 1, i32 1, i32 1, i32 1 > 

instead of:

        %tmp1 = extractelement <4 x float> %tmp, i32 1          
        %tmp2 = insertelement <4 x float> undef, float %tmp1, i32 0             
        %tmp3 = extractelement <4 x float> %tmp, i32 1          
        %tmp4 = insertelement <4 x float> %tmp2, float %tmp3, i32 1             
        %tmp5 = extractelement <4 x float> %tmp, i32 1          
        %tmp6 = insertelement <4 x float> %tmp4, float %tmp5, i32 2             
        %tmp7 = extractelement <4 x float> %tmp, i32 1          
        %tmp8 = insertelement <4 x float> %tmp6, float %tmp7, i32 3             



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40779 91177308-0d34-0410-b5e6-96231b3b80d8
1 file changed