From: Chris Lattner Date: Thu, 27 Apr 2006 21:13:58 +0000 (+0000) Subject: This should turn into one vector shuffle instruction. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=011ec7f29cb0162b77012e12a0391077a5f74d2d;p=oota-llvm.git This should turn into one vector shuffle instruction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27996 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Transforms/InstCombine/vec_insert_to_shuffle.ll b/test/Transforms/InstCombine/vec_insert_to_shuffle.ll new file mode 100644 index 00000000000..03792036918 --- /dev/null +++ b/test/Transforms/InstCombine/vec_insert_to_shuffle.ll @@ -0,0 +1,14 @@ +; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep shufflevec | wc -l | grep 1 && +; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep insertelement && +; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep extractelement + +<4 x float> %test(<4 x float> %tmp, <4 x float> %tmp1) { + %tmp4 = extractelement <4 x float> %tmp, uint 1 ; [#uses=1] + %tmp2 = extractelement <4 x float> %tmp, uint 3 ; [#uses=1] + %tmp1 = extractelement <4 x float> %tmp1, uint 0 ; [#uses=1] + %tmp128 = insertelement <4 x float> undef, float %tmp4, uint 0 ; <<4 x float>> [#uses=1] + %tmp130 = insertelement <4 x float> %tmp128, float undef, uint 1 ; <<4 x float>> [#uses=1] + %tmp132 = insertelement <4 x float> %tmp130, float %tmp2, uint 2 ; <<4 x float>> [#uses=1] + %tmp134 = insertelement <4 x float> %tmp132, float %tmp1, uint 3 ; <<4 x float>> [#uses=1] + ret <4 x float> %tmp134 +}