From e29c19091cca58db668407dfc5dd86c70e8b3d49 Mon Sep 17 00:00:00 2001 From: Hal Finkel Date: Mon, 22 Oct 2012 18:00:55 +0000 Subject: BBVectorize should ignore unreachable blocks. Unreachable blocks can have invalid instructions. For example, jump threading can produce self-referential instructions in unreachable blocks. Also, we should not be spending time optimizing unreachable code. Fixes PR14133. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166423 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Transforms/BBVectorize/simple-ldstr.ll | 32 +++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'test/Transforms/BBVectorize') diff --git a/test/Transforms/BBVectorize/simple-ldstr.ll b/test/Transforms/BBVectorize/simple-ldstr.ll index a5397eeb1f..c1e6a09eea 100644 --- a/test/Transforms/BBVectorize/simple-ldstr.ll +++ b/test/Transforms/BBVectorize/simple-ldstr.ll @@ -108,3 +108,35 @@ entry: ; CHECK-AO: store <2 x float> %mulf, <2 x float>* %0, align 8 ; CHECK-AO: ret void } + +; Simple 3-pair chain with loads and stores (unreachable) +define void @test4(i1 %bool, double* %a, double* %b, double* %c) nounwind uwtable readonly { +entry: + br i1 %bool, label %if.then1, label %if.end + +if.then1: + unreachable + br label %if.then + +if.then: + %i0 = load double* %a, align 8 + %i1 = load double* %b, align 8 + %mul = fmul double %i0, %i1 + %arrayidx3 = getelementptr inbounds double* %a, i64 1 + %i3 = load double* %arrayidx3, align 8 + %arrayidx4 = getelementptr inbounds double* %b, i64 1 + %i4 = load double* %arrayidx4, align 8 + %mul5 = fmul double %i3, %i4 + store double %mul, double* %c, align 8 + %arrayidx5 = getelementptr inbounds double* %c, i64 1 + store double %mul5, double* %arrayidx5, align 8 + br label %if.end + +if.end: + ret void +; CHECK: @test4 +; CHECK-NOT: <2 x double> +; CHECK-AO: @test4 +; CHECK-AO-NOT: <2 x double> +} + -- cgit v1.2.3