From: Andrea Di Biagio Date: Wed, 7 Sep 2016 14:50:07 +0000 (+0000) Subject: Regenerate vector bitcast folding tests using update_test_checks.py. X-Git-Tag: llvmorg-4.0.0-rc1~10457 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bdd576dbb0fe4934c216819645787a563bff0914;p=platform%2Fupstream%2Fllvm.git Regenerate vector bitcast folding tests using update_test_checks.py. Two tests have been merged together, regenerated and then moved to a more appropriate directory. No functional change. llvm-svn: 280814 --- diff --git a/llvm/test/Transforms/InstCombine/bitcast-vec-uniform.ll b/llvm/test/Transforms/InstCombine/bitcast-vec-uniform.ll deleted file mode 100644 index bfb7719..0000000 --- a/llvm/test/Transforms/InstCombine/bitcast-vec-uniform.ll +++ /dev/null @@ -1,70 +0,0 @@ -; RUN: opt < %s -instcombine -S | FileCheck %s - -; CHECK-LABEL: @a( -; CHECK-NOT: bitcast -; CHECK: ret -define <4 x i32> @a(<1 x i64> %y) { - %c = bitcast <2 x i64> to <4 x i32> - ret <4 x i32> %c -} - -; CHECK-LABEL: @b( -; CHECK-NOT: bitcast -; CHECK: ret - -define <4 x i32> @b(<1 x i64> %y) { - %c = bitcast <2 x i64> to <4 x i32> - ret <4 x i32> %c -} - -; CHECK-LABEL: @foo( -; CHECK-NOT: bitcast -; CHECK: ret - -; from MultiSource/Benchmarks/Bullet -define <2 x float> @foo() { - %cast = bitcast i64 -1 to <2 x float> - ret <2 x float> %cast -} - - -; CHECK-LABEL: @foo2( -; CHECK-NOT: bitcast -; CHECK: ret -define <2 x double> @foo2() { - %cast = bitcast i128 -1 to <2 x double> - ret <2 x double> %cast -} - -; CHECK-LABEL: @foo3( -; CHECK-NOT: bitcast -; CHECK: ret -define <1 x float> @foo3() { - %cast = bitcast i32 -1 to <1 x float> - ret <1 x float> %cast -} - -; CHECK-LABEL: @foo4( -; CHECK-NOT: bitcast -; CHECK: ret -define float @foo4() { - %cast = bitcast <1 x i32 > to float - ret float %cast -} - -; CHECK-LABEL: @foo5( -; CHECK-NOT: bitcast -; CHECK: ret -define double @foo5() { - %cast = bitcast <2 x i32 > to double - ret double %cast -} - - -; CHECK-LABEL: @foo6( -; CHECK-NOT: bitcast -; CHECK: ret -define <2 x double> @foo6() { - %cast = bitcast <4 x i32> to <2 x double> - ret <2 x double> %cast -} diff --git a/llvm/test/Transforms/InstCombine/bitcast-vector-fold.ll b/llvm/test/Transforms/InstCombine/bitcast-vector-fold.ll deleted file mode 100644 index 04c2861..0000000 --- a/llvm/test/Transforms/InstCombine/bitcast-vector-fold.ll +++ /dev/null @@ -1,38 +0,0 @@ -; RUN: opt < %s -instcombine -S | not grep bitcast -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" -target triple = "i686-apple-darwin8" - -define <2 x i64> @test1() { - %tmp3 = bitcast <4 x i32> < i32 0, i32 1, i32 2, i32 3 > to <2 x i64> - ret <2 x i64> %tmp3 -} - -define <4 x i32> @test2() { - %tmp3 = bitcast <2 x i64> < i64 0, i64 1 > to <4 x i32> - ret <4 x i32> %tmp3 -} - -define <2 x double> @test3() { - %tmp3 = bitcast <4 x i32> < i32 0, i32 1, i32 2, i32 3 > to <2 x double> - ret <2 x double> %tmp3 -} - -define <4 x float> @test4() { - %tmp3 = bitcast <2 x i64> < i64 0, i64 1 > to <4 x float> - ret <4 x float> %tmp3 -} - -define <2 x i64> @test5() { - %tmp3 = bitcast <4 x float> to <2 x i64> - ret <2 x i64> %tmp3 -} - -define <4 x i32> @test6() { - %tmp3 = bitcast <2 x double> to <4 x i32> - ret <4 x i32> %tmp3 -} - -define i32 @test7() { - %tmp3 = bitcast <2 x half> to i32 - ret i32 %tmp3 -} diff --git a/llvm/test/Transforms/InstSimplify/bitcast-vector-fold.ll b/llvm/test/Transforms/InstSimplify/bitcast-vector-fold.ll new file mode 100644 index 0000000..68783438 --- /dev/null +++ b/llvm/test/Transforms/InstSimplify/bitcast-vector-fold.ll @@ -0,0 +1,125 @@ +; NOTE: Assertions have been autogenerated by utils/update_test_checks.py +; RUN: opt < %s -instsimplify -S | FileCheck %s +target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-f64:32:64-v64:64:64-v128:128:128" + +define <2 x i64> @test1() { +; CHECK-LABEL: @test1( +; CHECK-NEXT: ret <2 x i64> +; + %tmp3 = bitcast <4 x i32> < i32 0, i32 1, i32 2, i32 3 > to <2 x i64> + ret <2 x i64> %tmp3 +} + +define <4 x i32> @test2() { +; CHECK-LABEL: @test2( +; CHECK-NEXT: ret <4 x i32> +; + %tmp3 = bitcast <2 x i64> < i64 0, i64 1 > to <4 x i32> + ret <4 x i32> %tmp3 +} + +define <2 x double> @test3() { +; CHECK-LABEL: @test3( +; CHECK-NEXT: ret <2 x double> +; + %tmp3 = bitcast <4 x i32> < i32 0, i32 1, i32 2, i32 3 > to <2 x double> + ret <2 x double> %tmp3 +} + +define <4 x float> @test4() { +; CHECK-LABEL: @test4( +; CHECK-NEXT: ret <4 x float> +; + %tmp3 = bitcast <2 x i64> < i64 0, i64 1 > to <4 x float> + ret <4 x float> %tmp3 +} + +define <2 x i64> @test5() { +; CHECK-LABEL: @test5( +; CHECK-NEXT: ret <2 x i64> +; + %tmp3 = bitcast <4 x float> to <2 x i64> + ret <2 x i64> %tmp3 +} + +define <4 x i32> @test6() { +; CHECK-LABEL: @test6( +; CHECK-NEXT: ret <4 x i32> +; + %tmp3 = bitcast <2 x double> to <4 x i32> + ret <4 x i32> %tmp3 +} + +define i32 @test7() { +; CHECK-LABEL: @test7( +; CHECK-NEXT: ret i32 1118464 +; + %tmp3 = bitcast <2 x half> to i32 + ret i32 %tmp3 +} + +define <4 x i32> @test8(<1 x i64> %y) { +; CHECK-LABEL: @test8( +; CHECK-NEXT: ret <4 x i32> zeroinitializer +; + %c = bitcast <2 x i64> to <4 x i32> + ret <4 x i32> %c +} + +define <4 x i32> @test9(<1 x i64> %y) { +; CHECK-LABEL: @test9( +; CHECK-NEXT: ret <4 x i32> +; + %c = bitcast <2 x i64> to <4 x i32> + ret <4 x i32> %c +} + +; from MultiSource/Benchmarks/Bullet +define <2 x float> @foo() { +; CHECK-LABEL: @foo( +; CHECK-NEXT: ret <2 x float> +; + %cast = bitcast i64 -1 to <2 x float> + ret <2 x float> %cast +} + + +define <2 x double> @foo2() { +; CHECK-LABEL: @foo2( +; CHECK-NEXT: ret <2 x double> +; + %cast = bitcast i128 -1 to <2 x double> + ret <2 x double> %cast +} + +define <1 x float> @foo3() { +; CHECK-LABEL: @foo3( +; CHECK-NEXT: ret <1 x float> +; + %cast = bitcast i32 -1 to <1 x float> + ret <1 x float> %cast +} + +define float @foo4() { +; CHECK-LABEL: @foo4( +; CHECK-NEXT: ret float 0xFFFFFFFFE0000000 +; + %cast = bitcast <1 x i32 > to float + ret float %cast +} + +define double @foo5() { +; CHECK-LABEL: @foo5( +; CHECK-NEXT: ret double 0xFFFFFFFFFFFFFFFF +; + %cast = bitcast <2 x i32 > to double + ret double %cast +} + +define <2 x double> @foo6() { +; CHECK-LABEL: @foo6( +; CHECK-NEXT: ret <2 x double> +; + %cast = bitcast <4 x i32> to <2 x double> + ret <2 x double> %cast +}