From: Sanjay Patel Date: Tue, 21 Mar 2017 20:14:38 +0000 (+0000) Subject: [InstCombine] regenerate checks; NFC X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0be9db9ff3babe0d3f83f371ce4f23493940e71d;p=llvm [InstCombine] regenerate checks; NFC git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298432 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Transforms/InstCombine/vector_insertelt_shuffle.ll b/test/Transforms/InstCombine/vector_insertelt_shuffle.ll index b3e614653cf..8db937a9a34 100644 --- a/test/Transforms/InstCombine/vector_insertelt_shuffle.ll +++ b/test/Transforms/InstCombine/vector_insertelt_shuffle.ll @@ -1,94 +1,93 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py ; RUN: opt < %s -instcombine -S | FileCheck %s -define<4 x float> @foo(<4 x float> %x) { +; insertelements should fold to shuffle +define <4 x float> @foo(<4 x float> %x) { +; CHECK-LABEL: @foo( +; CHECK-NEXT: [[INS2:%.*]] = shufflevector <4 x float> %x, <4 x float> , <4 x i32> +; CHECK-NEXT: ret <4 x float> [[INS2]] +; %ins1 = insertelement<4 x float> %x, float 1.0, i32 1 %ins2 = insertelement<4 x float> %ins1, float 2.0, i32 2 - ret<4 x float> %ins2 + ret <4 x float> %ins2 } -; insertelements should fold to shuffle -; CHECK-LABEL: @foo -; CHECK-NEXT: shufflevector <4 x float> %{{.+}}, <4 x float> , <4 x i32> -; CHECK-NEXT: ret <4 x float> % - -define<4 x float> @bar(<4 x float> %x, float %a) { +define <4 x float> @bar(<4 x float> %x, float %a) { +; CHECK-LABEL: @bar( +; CHECK-NEXT: [[INS1:%.*]] = insertelement <4 x float> %x, float %a, i32 1 +; CHECK-NEXT: [[INS2:%.*]] = insertelement <4 x float> [[INS1]], float 2.000000e+00, i32 2 +; CHECK-NEXT: ret <4 x float> [[INS2]] +; %ins1 = insertelement<4 x float> %x, float %a, i32 1 %ins2 = insertelement<4 x float> %ins1, float 2.0, i32 2 - ret<4 x float> %ins2 + ret <4 x float> %ins2 } -; CHECK-LABEL: @bar -; CHECK-NEXT: insertelement <4 x float> %{{.+}}, float %{{.+}}, i32 1 -; CHECK-NEXT: insertelement <4 x float> %{{.+}}, float 2.000000e+00, i32 2 -; CHECK-NEXT: ret <4 x float> % - -define<4 x float> @baz(<4 x float> %x, i32 %a) { +define <4 x float> @baz(<4 x float> %x, i32 %a) { +; CHECK-LABEL: @baz( +; CHECK-NEXT: [[INS1:%.*]] = insertelement <4 x float> %x, float 1.000000e+00, i32 1 +; CHECK-NEXT: [[INS2:%.*]] = insertelement <4 x float> [[INS1]], float 2.000000e+00, i32 %a +; CHECK-NEXT: ret <4 x float> [[INS2]] +; %ins1 = insertelement<4 x float> %x, float 1.0, i32 1 %ins2 = insertelement<4 x float> %ins1, float 2.0, i32 %a - ret<4 x float> %ins2 + ret <4 x float> %ins2 } -; CHECK-LABEL: @baz -; CHECK-NEXT: insertelement <4 x float> %{{.+}}, float 1.000000e+00, i32 1 -; CHECK-NEXT: insertelement <4 x float> %ins1, float 2.000000e+00, i32 % -; CHECK-NEXT: ret <4 x float> % - -define<4 x float> @bazz(<4 x float> %x, i32 %a) { +; insertelements should fold to shuffle +define <4 x float> @bazz(<4 x float> %x, i32 %a) { +; CHECK-LABEL: @bazz( +; CHECK-NEXT: [[INS1:%.*]] = insertelement <4 x float> %x, float 1.000000e+00, i32 3 +; CHECK-NEXT: [[INS2:%.*]] = insertelement <4 x float> [[INS1]], float 5.000000e+00, i32 %a +; CHECK-NEXT: [[INS5:%.*]] = shufflevector <4 x float> [[INS2]], <4 x float> , <4 x i32> +; CHECK-NEXT: [[INS6:%.*]] = insertelement <4 x float> [[INS5]], float 7.000000e+00, i32 %a +; CHECK-NEXT: ret <4 x float> [[INS6]] +; %ins1 = insertelement<4 x float> %x, float 1.0, i32 3 %ins2 = insertelement<4 x float> %ins1, float 5.0, i32 %a %ins3 = insertelement<4 x float> %ins2, float 3.0, i32 2 %ins4 = insertelement<4 x float> %ins3, float 1.0, i32 1 %ins5 = insertelement<4 x float> %ins4, float 2.0, i32 2 %ins6 = insertelement<4 x float> %ins5, float 7.0, i32 %a - ret<4 x float> %ins6 + ret <4 x float> %ins6 } -; insertelements should fold to shuffle -; CHECK-LABEL: @bazz -; CHECK-NEXT: insertelement <4 x float> %{{.+}}, float 1.000000e+00, i32 3 -; CHECK-NEXT: insertelement <4 x float> %{{.+}}, float 5.000000e+00, i32 % -; CHECK-NEXT: shufflevector <4 x float> %{{.+}}, <4 x float> , <4 x i32> -; CHECK-NEXT: insertelement <4 x float> %{{.+}}, float 7.000000e+00, i32 % -; CHECK-NEXT: ret <4 x float> % - -define<4 x float> @bazzz(<4 x float> %x) { +define <4 x float> @bazzz(<4 x float> %x) { +; CHECK-LABEL: @bazzz( +; CHECK-NEXT: [[INS2:%.*]] = insertelement <4 x float> %x, float 2.000000e+00, i32 2 +; CHECK-NEXT: ret <4 x float> [[INS2]] +; %ins1 = insertelement<4 x float> %x, float 1.0, i32 5 %ins2 = insertelement<4 x float> %ins1, float 2.0, i32 2 - ret<4 x float> %ins2 + ret <4 x float> %ins2 } -; CHECK-LABEL: @bazzz -; CHECK-NEXT: insertelement <4 x float> %{{.+}}, float 2.000000e+00, i32 2 -; CHECK-NEXT: ret <4 x float> % - -define<4 x float> @bazzzz(<4 x float> %x) { +define <4 x float> @bazzzz(<4 x float> %x) { +; CHECK-LABEL: @bazzzz( +; CHECK-NEXT: [[INS1:%.*]] = insertelement <4 x float> %x, float 1.000000e+00, i32 undef +; CHECK-NEXT: [[INS2:%.*]] = insertelement <4 x float> %x, float 2.000000e+00, i32 2 +; CHECK-NEXT: ret <4 x float> [[INS2]] +; %ins1 = insertelement<4 x float> %x, float 1.0, i32 undef %ins2 = insertelement<4 x float> %ins1, float 2.0, i32 2 - ret<4 x float> %ins2 + ret <4 x float> %ins2 } -; CHECK-LABEL: @bazzzz -; CHECK-NEXT: insertelement <4 x float> %{{.+}}, float 1.000000e+00, i32 undef -; CHECK-NEXT: insertelement <4 x float> %{{.+}}, float 2.000000e+00, i32 2 -; CHECK-NEXT: ret <4 x float> % - -define<4 x float> @bazzzzz() { +define <4 x float> @bazzzzz() { +; CHECK-LABEL: @bazzzzz( +; CHECK-NEXT: ret <4 x float> +; %ins1 = insertelement <4 x float> insertelement (<4 x float> , float 4.0, i32 3), float 5.0, i32 1 %ins2 = insertelement<4 x float> %ins1, float 10.0, i32 2 - ret<4 x float> %ins2 + ret <4 x float> %ins2 } -; insertelements should fold to shuffle -; CHECK-LABEL: @bazzzzz -; CHECK-NEXT: ret <4 x float> - -define<4 x float> @bazzzzzz(<4 x float> %x, i32 %a) { +define <4 x float> @bazzzzzz(<4 x float> %x, i32 %a) { +; CHECK-LABEL: @bazzzzzz( +; CHECK-NEXT: ret <4 x float> +; %ins1 = insertelement <4 x float> insertelement (<4 x float> shufflevector (<4 x float> undef, <4 x float> , <4 x i32> ), float 4.0, i32 3), float 5.0, i32 1 - ret<4 x float> %ins1 + ret <4 x float> %ins1 } -; insertelements should fold to shuffle -; CHECK-LABEL: @bazzzzz -; CHECK-NEXT: ret <4 x float>