diff options
author | Hal Finkel <hfinkel@anl.gov> | 2012-10-22 18:00:55 +0000 |
---|---|---|
committer | Hal Finkel <hfinkel@anl.gov> | 2012-10-22 18:00:55 +0000 |
commit | 931c52b84ca0ecf8f1736a080ac851e09628e5a2 (patch) | |
tree | c948256d9186d43da86ffbc958a21c323d7416a8 /llvm/test/Transforms/BBVectorize/simple-ldstr.ll | |
parent | dbf47836341087b7058187302fb980053ea08537 (diff) | |
download | bcm5719-llvm-931c52b84ca0ecf8f1736a080ac851e09628e5a2.tar.gz bcm5719-llvm-931c52b84ca0ecf8f1736a080ac851e09628e5a2.zip |
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.
llvm-svn: 166423
Diffstat (limited to 'llvm/test/Transforms/BBVectorize/simple-ldstr.ll')
-rw-r--r-- | llvm/test/Transforms/BBVectorize/simple-ldstr.ll | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/llvm/test/Transforms/BBVectorize/simple-ldstr.ll b/llvm/test/Transforms/BBVectorize/simple-ldstr.ll index a5397eeb1f9..c1e6a09eea2 100644 --- a/llvm/test/Transforms/BBVectorize/simple-ldstr.ll +++ b/llvm/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> +} + |