From 588c490aad40054bb3cab8258f2754ab35726110 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 11 Oct 2009 22:45:17 +0000 Subject: [PATCH] filecheckize git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83805 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Transforms/InstCombine/shuffle.ll | 28 ++++++++++++-------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/test/Transforms/InstCombine/shuffle.ll b/test/Transforms/InstCombine/shuffle.ll index ba5a734dec7..2e7af908563 100644 --- a/test/Transforms/InstCombine/shuffle.ll +++ b/test/Transforms/InstCombine/shuffle.ll @@ -1,19 +1,17 @@ -; RUN: opt < %s -instcombine -S | \ -; RUN: grep shufflevec | count 1 -; RUN: opt < %s -instcombine -S | \ -; RUN: not grep insertelement -; RUN: opt < %s -instcombine -S | \ -; RUN: not grep extractelement -; END. +; RUN: opt < %s -instcombine -S | FileCheck %s -define <4 x float> @test(<4 x float> %tmp, <4 x float> %tmp1) { - %tmp4 = extractelement <4 x float> %tmp, i32 1 ; [#uses=1] - %tmp2 = extractelement <4 x float> %tmp, i32 3 ; [#uses=1] - %tmp1.upgrd.1 = extractelement <4 x float> %tmp1, i32 0 ; [#uses=1] - %tmp128 = insertelement <4 x float> undef, float %tmp4, i32 0 ; <<4 x float>> [#uses=1] - %tmp130 = insertelement <4 x float> %tmp128, float undef, i32 1 ; <<4 x float>> [#uses=1] - %tmp132 = insertelement <4 x float> %tmp130, float %tmp2, i32 2 ; <<4 x float>> [#uses=1] - %tmp134 = insertelement <4 x float> %tmp132, float %tmp1.upgrd.1, i32 3 ; <<4 x float>> [#uses=1] +; This should turn into a single shuffle. +define <4 x float> @test1(<4 x float> %tmp, <4 x float> %tmp1) { +; CHECK: @test1 +; CHECK-NEXT: shufflevector +; CHECK-NEXT: ret + %tmp4 = extractelement <4 x float> %tmp, i32 1 + %tmp2 = extractelement <4 x float> %tmp, i32 3 + %tmp1.upgrd.1 = extractelement <4 x float> %tmp1, i32 0 + %tmp128 = insertelement <4 x float> undef, float %tmp4, i32 0 + %tmp130 = insertelement <4 x float> %tmp128, float undef, i32 1 + %tmp132 = insertelement <4 x float> %tmp130, float %tmp2, i32 2 + %tmp134 = insertelement <4 x float> %tmp132, float %tmp1.upgrd.1, i32 3 ret <4 x float> %tmp134 } -- 2.34.1