From c97094552c332ef6d29fa01ddfc20d0ba89b1901 Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Wed, 16 Jul 2008 07:28:14 +0000 Subject: [PATCH] Fix PR2296. Do not transform x86_sse2_storel_dq into a full-width store. llvm-svn: 53666 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp | 1 - .../InstCombine/2008-07-16-sse2_storel_dq.ll | 13 +++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 llvm/test/Transforms/InstCombine/2008-07-16-sse2_storel_dq.ll diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp index 743c0c1a302f..c35d92c28f07 100644 --- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp @@ -8646,7 +8646,6 @@ Instruction *InstCombiner::visitCallInst(CallInst &CI) { case Intrinsic::x86_sse_storeu_ps: case Intrinsic::x86_sse2_storeu_pd: case Intrinsic::x86_sse2_storeu_dq: - case Intrinsic::x86_sse2_storel_dq: // Turn X86 storeu -> store if the pointer is known aligned. if (GetOrEnforceKnownAlignment(II->getOperand(1), 16) >= 16) { const Type *OpPtrTy = diff --git a/llvm/test/Transforms/InstCombine/2008-07-16-sse2_storel_dq.ll b/llvm/test/Transforms/InstCombine/2008-07-16-sse2_storel_dq.ll new file mode 100644 index 000000000000..49e6cdd0377d --- /dev/null +++ b/llvm/test/Transforms/InstCombine/2008-07-16-sse2_storel_dq.ll @@ -0,0 +1,13 @@ +; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep {store } +; PR2296 + +@G = common global double 0.000000e+00, align 16 + +define void @x(<2 x i64> %y) nounwind { +entry: + bitcast <2 x i64> %y to <4 x i32> + call void @llvm.x86.sse2.storel.dq( i8* bitcast (double* @G to i8*), <4 x i32> %0 ) nounwind + ret void +} + +declare void @llvm.x86.sse2.storel.dq(i8*, <4 x i32>) nounwind -- GitLab