[llvm-commits] SROA regression - alloca <3 x i8>

Tom Stellard tom at stellard.net
Wed Oct 10 09:00:38 PDT 2012


I've filed this a bug for this:
http://llvm.org/bugs/show_bug.cgi?id=14055

On Tue, Oct 02, 2012 at 10:13:53AM -0400, Tom Stellard wrote:
> Hi Chandler,
> 
> I've spotted a regression in the new SROA pass.  The old scalarrepl pass
> will optimize away the alloca in the attached test case, but the new
> sroa pass will not.  Would you mind taking a look?
> 
> Thanks,
> Tom Stellard

> diff --git test/Transforms/SROA/3xi8-alloca.ll test/Transforms/SROA/3xi8-alloca.ll
> new file mode 100644
> index 0000000..636fe35
> --- /dev/null
> +++ test/Transforms/SROA/3xi8-alloca.ll
> @@ -0,0 +1,21 @@
> +; RUN: opt < %s -sroa -S | FileCheck %s
> +target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-f80:32:32-v16:16:16-v24:32:32-v32:32:32-v48:64:64-v64:64:64-v96:128:128-v128:128:128-v192:256:256-v256:256:256-v512:512:512-v1024:1024:1024-v2048:2048:2048-n8:16:32:64"
> +target triple = "r600--"
> +
> +define void @test(<3 x i8> addrspace(1)* nocapture %in, float addrspace(1)* nocapture %out) nounwind {
> +;CHECK-NOT: alloca
> +entry:
> +  %in_vc = alloca <3 x i8>, align 4
> +  %0 = load <3 x i8> addrspace(1)* %in
> +  store <3 x i8> %0, <3 x i8>* %in_vc, align 4
> +  %castToVec4 = bitcast <3 x i8>* %in_vc to <4 x i8>*
> +  %loadVec4 = load <4 x i8>* %castToVec4
> +  %1 = extractelement <4 x i8> %loadVec4, i32 0
> +  %conv.i = uitofp i8 %1 to float
> +  store float %conv.i, float addrspace(1)* %out
> +  ret void
> +}
> +
> +!opencl.kernels = !{!0}
> +
> +!0 = metadata !{void (<3 x i8> addrspace(1)*, float addrspace(1)*)* @test}

> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list