[llvm-commits] [llvm] r132759 - in /llvm/trunk: lib/Transforms/Scalar/ScalarReplAggregates.cpp test/Transforms/ScalarRepl/2011-06-08-VectorExtractValue.ll

Eli Friedman eli.friedman at gmail.com
Wed Jun 8 15:58:16 PDT 2011


On Wed, Jun 8, 2011 at 3:08 PM, Cameron Zwarich <zwarich at apple.com> wrote:
> Author: zwarich
> Date: Wed Jun  8 17:08:31 2011
> New Revision: 132759
>
> URL: http://llvm.org/viewvc/llvm-project?rev=132759&view=rev
> Log:
> Fix an assymmetry between ConvertScalar_ExtractValue and ConvertScalar_InsertValue. The
> former was using the size of the entire alloca, whereas the latter was correctly using
> the allocated size of the immediate type being converted (which may differ from the size
> of the alloca). This fixes PR10082.
[...]
> +define float @test2() uwtable ssp {
> +entry:
> +  %ref.tmp2 = alloca {<2 x float>, float}, align 16
> +  %tmpcast = bitcast {<2 x float>, float}* %ref.tmp2 to float*
> +  %tmpcast2 = getelementptr {<2 x float>, float}* %ref.tmp2, i64 0, i32 1
> +  %0 = getelementptr {<2 x float>, float}* %ref.tmp2, i64 0, i32 0
> +  store <2 x float> zeroinitializer, <2 x float>* %0, align 16
> +  store float 1.0, float* %tmpcast2, align 4
> +  %r1 = load float* %tmpcast, align 4
> +  %r2 = load float* %tmpcast2, align 4
> +  %r = fadd float %r1, %r2
> +  ret float %r
> +}

I forgot to mention: the reason for including this test was to make
sure it doesn't get miscompiled.  And with your patch, it does get
miscompiled...

-Eli




More information about the llvm-commits mailing list