From c77a10fe0a40861bcb4bd2a0c170c948a57be688 Mon Sep 17 00:00:00 2001 From: Cameron Zwarich Date: Sat, 26 Mar 2011 04:58:50 +0000 Subject: [PATCH] Fix a typo and add a test. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128331 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Scalar/ScalarReplAggregates.cpp | 2 +- test/Transforms/ScalarRepl/vector_promote.ll | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/lib/Transforms/Scalar/ScalarReplAggregates.cpp b/lib/Transforms/Scalar/ScalarReplAggregates.cpp index c261dede922..de7bb41e7de 100644 --- a/lib/Transforms/Scalar/ScalarReplAggregates.cpp +++ b/lib/Transforms/Scalar/ScalarReplAggregates.cpp @@ -380,7 +380,7 @@ bool ConvertToScalarInfo::MergeInVectorType(const VectorType *VInTy, return true; const Type *ElementTy = cast(VectorTy)->getElementType(); - const Type *InElementTy = cast(VectorTy)->getElementType(); + const Type *InElementTy = cast(VInTy)->getElementType(); // Do not allow mixed integer and floating-point accesses from vectors of // different sizes. diff --git a/test/Transforms/ScalarRepl/vector_promote.ll b/test/Transforms/ScalarRepl/vector_promote.ll index 67bbf71b362..c51c9247f54 100644 --- a/test/Transforms/ScalarRepl/vector_promote.ll +++ b/test/Transforms/ScalarRepl/vector_promote.ll @@ -187,3 +187,18 @@ entry: ; CHECK: extractelement <4 x i128> ; CHECK: insertelement <4 x i128> } + +define float @test13(<4 x float> %x, <2 x i32> %y) { + %a = alloca <4 x float> + store <4 x float> %x, <4 x float>* %a + %p = bitcast <4 x float>* %a to <2 x float>* + %b = load <2 x float>* %p + %q = getelementptr <4 x float>* %a, i32 0, i32 2 + %c = load float* %q + %r = bitcast <4 x float>* %a to <2 x i32>* + store <2 x i32> %y, <2 x i32>* %r + ret float %c +; CHECK: @test13 +; CHECK-NOT: alloca +; CHECK: bitcast <4 x float> %x to i128 +} -- 2.34.1