; NOTE: Assertions have been autogenerated by utils/update_test_checks.py ; RUN: opt < %s -passes=instsimplify -S -data-layout="e-p:32:32:32-i1:8:8-i8:8:8-f64:32:64-v64:64:64-v128:128:128" | FileCheck %s --check-prefixes=CHECK,LE ; RUN: opt < %s -passes=instsimplify -use-constant-int-for-fixed-length-splat -S -data-layout="e-p:32:32:32-i1:8:8-i8:8:8-f64:32:64-v64:64:64-v128:128:128" | FileCheck %s --check-prefixes=CHECK,LE ; RUN: opt < %s -passes=instsimplify -S -data-layout="E-p:32:32:32-i1:8:8-i8:8:8-f64:32:64-v64:64:64-v128:128:128" | FileCheck %s --check-prefixes=CHECK,BE define <2 x i64> @test1() { ; LE-LABEL: @test1( ; LE-NEXT: ret <2 x i64> ; ; BE-LABEL: @test1( ; BE-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() { ; LE-LABEL: @test2( ; LE-NEXT: ret <4 x i32> ; ; BE-LABEL: @test2( ; BE-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() { ; LE-LABEL: @test3( ; LE-NEXT: ret <2 x double> ; ; BE-LABEL: @test3( ; BE-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() { ; LE-LABEL: @test4( ; LE-NEXT: ret <4 x float> ; ; BE-LABEL: @test4( ; BE-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() { ; LE-LABEL: @test5( ; LE-NEXT: ret <2 x i64> ; ; BE-LABEL: @test5( ; BE-NEXT: ret <2 x i64> ; %tmp3 = bitcast <4 x float> to <2 x i64> ret <2 x i64> %tmp3 } define <4 x i32> @test6() { ; LE-LABEL: @test6( ; LE-NEXT: ret <4 x i32> ; ; BE-LABEL: @test6( ; BE-NEXT: ret <4 x i32> ; %tmp3 = bitcast <2 x double> to <4 x i32> ret <4 x i32> %tmp3 } define i32 @test7() { ; LE-LABEL: @test7( ; LE-NEXT: ret i32 1118464 ; ; BE-LABEL: @test7( ; BE-NEXT: ret i32 285212689 ; %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> splat (i32 -1) ; %c = bitcast <2 x i64> to <4 x i32> ret <4 x i32> %c } define <1 x i1> @test10() { ; CHECK-LABEL: @test10( ; CHECK-NEXT: ret <1 x i1> zeroinitializer ; %ret = icmp eq <1 x i64> to i64)>, zeroinitializer ret <1 x i1> %ret } define <4 x i24> @test11() { ; LE-LABEL: @test11( ; LE-NEXT: ret <4 x i24> ; ; BE-LABEL: @test11( ; BE-NEXT: ret <4 x i24> ; %c = bitcast <3 x i32> to <4 x i24> ret <4 x i24> %c } define <8 x i24> @test12() { ; LE-LABEL: @test12( ; LE-NEXT: ret <8 x i24> splat (i24 1) ; ; BE-LABEL: @test12( ; BE-NEXT: ret <8 x i24> ; %c = bitcast <3 x i64> to <8 x i24> ret <8 x i24> %c } define <3 x i32> @test13() { ; LE-LABEL: @test13( ; LE-NEXT: ret <3 x i32> splat (i32 1) ; ; BE-LABEL: @test13( ; BE-NEXT: ret <3 x i32> ; %c = bitcast <4 x i24> to <3 x i32> ret <3 x i32> %c } define <3 x i64> @test14() { ; LE-LABEL: @test14( ; LE-NEXT: ret <3 x i64> ; ; BE-LABEL: @test14( ; BE-NEXT: ret <3 x i64> ; %c = bitcast <8 x i24> splat (i24 1) to <3 x i64> ret <3 x i64> %c } ; from MultiSource/Benchmarks/Bullet define <2 x float> @foo() { ; CHECK-LABEL: @foo( ; CHECK-NEXT: ret <2 x float> splat (float -nan(0x3FFFFF)) ; %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> splat (double -nan(0x7FFFFFFFFFFFF)) ; %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> splat (float -nan(0x3FFFFF)) ; %cast = bitcast i32 -1 to <1 x float> ret <1 x float> %cast } define float @foo4() { ; CHECK-LABEL: @foo4( ; CHECK-NEXT: ret float -nan(0x3FFFFF) ; %cast = bitcast <1 x i32 > to float ret float %cast } define double @foo5() { ; CHECK-LABEL: @foo5( ; CHECK-NEXT: ret double -nan(0x7FFFFFFFFFFFF) ; %cast = bitcast <2 x i32 > to double ret double %cast } define <2 x double> @foo6() { ; CHECK-LABEL: @foo6( ; CHECK-NEXT: ret <2 x double> splat (double -nan(0x7FFFFFFFFFFFF)) ; %cast = bitcast <4 x i32> to <2 x double> ret <2 x double> %cast } define <4 x i32> @bitcast_constexpr_4i32_2i64_u2() { ; LE-LABEL: @bitcast_constexpr_4i32_2i64_u2( ; LE-NEXT: ret <4 x i32> ; ; BE-LABEL: @bitcast_constexpr_4i32_2i64_u2( ; BE-NEXT: ret <4 x i32> ; %cast = bitcast <2 x i64> to <4 x i32> ret <4 x i32> %cast } define <4 x i32> @bitcast_constexpr_4i32_2i64_1u() { ; LE-LABEL: @bitcast_constexpr_4i32_2i64_1u( ; LE-NEXT: ret <4 x i32> ; ; BE-LABEL: @bitcast_constexpr_4i32_2i64_1u( ; BE-NEXT: ret <4 x i32> ; %cast = bitcast <2 x i64> to <4 x i32> ret <4 x i32> %cast } define <4 x i32> @bitcast_constexpr_4i32_2i64() { ; LE-LABEL: @bitcast_constexpr_4i32_2i64( ; LE-NEXT: ret <4 x i32> ; ; BE-LABEL: @bitcast_constexpr_4i32_2i64( ; BE-NEXT: ret <4 x i32> ; %cast = bitcast <2 x i64> to <4 x i32> ret <4 x i32> %cast } define <8 x i16> @bitcast_constexpr_8i16_2i64_u2() { ; LE-LABEL: @bitcast_constexpr_8i16_2i64_u2( ; LE-NEXT: ret <8 x i16> ; ; BE-LABEL: @bitcast_constexpr_8i16_2i64_u2( ; BE-NEXT: ret <8 x i16> ; %cast = bitcast <2 x i64> to <8 x i16> ret <8 x i16> %cast } define <8 x i16> @bitcast_constexpr_8i16_2i64_1u() { ; LE-LABEL: @bitcast_constexpr_8i16_2i64_1u( ; LE-NEXT: ret <8 x i16> ; ; BE-LABEL: @bitcast_constexpr_8i16_2i64_1u( ; BE-NEXT: ret <8 x i16> ; %cast = bitcast <2 x i64> to <8 x i16> ret <8 x i16> %cast } define <8 x i16> @bitcast_constexpr_8i16_2i64_u65536() { ; LE-LABEL: @bitcast_constexpr_8i16_2i64_u65536( ; LE-NEXT: ret <8 x i16> ; ; BE-LABEL: @bitcast_constexpr_8i16_2i64_u65536( ; BE-NEXT: ret <8 x i16> ; %cast = bitcast <2 x i64> to <8 x i16> ret <8 x i16> %cast } define <16 x i8> @bitcast_constexpr_16i8_2i64_u2() { ; LE-LABEL: @bitcast_constexpr_16i8_2i64_u2( ; LE-NEXT: ret <16 x i8> ; ; BE-LABEL: @bitcast_constexpr_16i8_2i64_u2( ; BE-NEXT: ret <16 x i8> ; %cast = bitcast <2 x i64> to <16 x i8> ret <16 x i8> %cast } define <16 x i8> @bitcast_constexpr_16i8_2i64_256u() { ; LE-LABEL: @bitcast_constexpr_16i8_2i64_256u( ; LE-NEXT: ret <16 x i8> ; ; BE-LABEL: @bitcast_constexpr_16i8_2i64_256u( ; BE-NEXT: ret <16 x i8> ; %cast = bitcast <2 x i64> to <16 x i8> ret <16 x i8> %cast } define <16 x i8> @bitcast_constexpr_16i8_2i64_u256() { ; LE-LABEL: @bitcast_constexpr_16i8_2i64_u256( ; LE-NEXT: ret <16 x i8> ; ; BE-LABEL: @bitcast_constexpr_16i8_2i64_u256( ; BE-NEXT: ret <16 x i8> ; %cast = bitcast <2 x i64> to <16 x i8> ret <16 x i8> %cast } define <8 x i16> @bitcast_constexpr_8i16_4i32_uu22() { ; LE-LABEL: @bitcast_constexpr_8i16_4i32_uu22( ; LE-NEXT: ret <8 x i16> ; ; BE-LABEL: @bitcast_constexpr_8i16_4i32_uu22( ; BE-NEXT: ret <8 x i16> ; %cast = bitcast <4 x i32> to <8 x i16> ret <8 x i16> %cast } define <8 x i16> @bitcast_constexpr_8i16_4i32_10uu() { ; LE-LABEL: @bitcast_constexpr_8i16_4i32_10uu( ; LE-NEXT: ret <8 x i16> ; ; BE-LABEL: @bitcast_constexpr_8i16_4i32_10uu( ; BE-NEXT: ret <8 x i16> ; %cast = bitcast <4 x i32> to <8 x i16> ret <8 x i16> %cast } define <8 x i16> @bitcast_constexpr_8i16_4i32_u257u256() { ; LE-LABEL: @bitcast_constexpr_8i16_4i32_u257u256( ; LE-NEXT: ret <8 x i16> ; ; BE-LABEL: @bitcast_constexpr_8i16_4i32_u257u256( ; BE-NEXT: ret <8 x i16> ; %cast = bitcast <4 x i32> to <8 x i16> ret <8 x i16> %cast } define <16 x i8> @bitcast_constexpr_16i8_4i32_u2u2() { ; LE-LABEL: @bitcast_constexpr_16i8_4i32_u2u2( ; LE-NEXT: ret <16 x i8> ; ; BE-LABEL: @bitcast_constexpr_16i8_4i32_u2u2( ; BE-NEXT: ret <16 x i8> ; %cast = bitcast <4 x i32> to <16 x i8> ret <16 x i8> %cast } define <16 x i8> @bitcast_constexpr_16i8_4i32_1u1u() { ; LE-LABEL: @bitcast_constexpr_16i8_4i32_1u1u( ; LE-NEXT: ret <16 x i8> ; ; BE-LABEL: @bitcast_constexpr_16i8_4i32_1u1u( ; BE-NEXT: ret <16 x i8> ; %cast = bitcast <4 x i32> to <16 x i8> ret <16 x i8> %cast } define <16 x i8> @bitcast_constexpr_16i8_4i32_u256uu() { ; LE-LABEL: @bitcast_constexpr_16i8_4i32_u256uu( ; LE-NEXT: ret <16 x i8> ; ; BE-LABEL: @bitcast_constexpr_16i8_4i32_u256uu( ; BE-NEXT: ret <16 x i8> ; %cast = bitcast <4 x i32> to <16 x i8> ret <16 x i8> %cast } define <16 x i8> @bitcast_constexpr_16i8_8i16_u2u2u2u2() { ; LE-LABEL: @bitcast_constexpr_16i8_8i16_u2u2u2u2( ; LE-NEXT: ret <16 x i8> ; ; BE-LABEL: @bitcast_constexpr_16i8_8i16_u2u2u2u2( ; BE-NEXT: ret <16 x i8> ; %cast = bitcast <8 x i16> to <16 x i8> ret <16 x i8> %cast } define <16 x i8> @bitcast_constexpr_16i8_8i16_1u1u1u1u() { ; LE-LABEL: @bitcast_constexpr_16i8_8i16_1u1u1u1u( ; LE-NEXT: ret <16 x i8> ; ; BE-LABEL: @bitcast_constexpr_16i8_8i16_1u1u1u1u( ; BE-NEXT: ret <16 x i8> ; %cast = bitcast <8 x i16> to <16 x i8> ret <16 x i8> %cast } define <16 x i8> @bitcast_constexpr_16i8_8i16_u256uuu256uu() { ; LE-LABEL: @bitcast_constexpr_16i8_8i16_u256uuu256uu( ; LE-NEXT: ret <16 x i8> ; ; BE-LABEL: @bitcast_constexpr_16i8_8i16_u256uuu256uu( ; BE-NEXT: ret <16 x i8> ; %cast = bitcast <8 x i16> to <16 x i8> ret <16 x i8> %cast } define <4 x i24> @bitcast_constexpr_4i24_3i32_u1u() { ; LE-LABEL: @bitcast_constexpr_4i24_3i32_u1u( ; LE-NEXT: ret <4 x i24> ; ; BE-LABEL: @bitcast_constexpr_4i24_3i32_u1u( ; BE-NEXT: ret <4 x i24> ; %cast = bitcast <3 x i32> to <4 x i24> ret <4 x i24> %cast } define <3 x i32> @bitcast_constexpr_3i32_4i24_n1255uu() { ; LE-LABEL: @bitcast_constexpr_3i32_4i24_n1255uu( ; LE-NEXT: ret <3 x i32> ; ; BE-LABEL: @bitcast_constexpr_3i32_4i24_n1255uu( ; BE-NEXT: ret <3 x i32> ; %cast = bitcast <4 x i24> to <3 x i32> ret <3 x i32> %cast } define <1 x i32> @bitcast_constexpr_scalar_fp_to_vector_int() { ; CHECK-LABEL: @bitcast_constexpr_scalar_fp_to_vector_int( ; CHECK-NEXT: ret <1 x i32> splat (i32 1065353216) ; %res = bitcast float 1.0 to <1 x i32> ret <1 x i32> %res } define <2 x i64> @bitcast_constexpr_4f32_2i64_1111() { ; CHECK-LABEL: @bitcast_constexpr_4f32_2i64_1111( ; CHECK-NEXT: ret <2 x i64> splat (i64 4575657222473777152) ; %res = bitcast <4 x float> splat (float 1.0) to <2 x i64> ret <2 x i64> %res } define <2 x b64> @bitcast_constexpr_16i8_2b64() { ; CHECK-LABEL: @bitcast_constexpr_16i8_2b64( ; CHECK-NEXT: ret <2 x b64> splat (b64 144680345676153346) ; %res = bitcast <16 x i8> splat (i8 2) to <2 x b64> ret <2 x b64> %res } define <2 x b64> @bitcast_constexpr_16b8_2b64() { ; CHECK-LABEL: @bitcast_constexpr_16b8_2b64( ; CHECK-NEXT: ret <2 x b64> splat (b64 144680345676153346) ; %res = bitcast <16 x b8> splat (b8 2) to <2 x b64> ret <2 x b64> %res } define <2 x i64> @bitcast_constexpr_4b32_2i64() { ; LE-LABEL: @bitcast_constexpr_4b32_2i64( ; LE-NEXT: ret <2 x i64> ; ; BE-LABEL: @bitcast_constexpr_4b32_2i64( ; BE-NEXT: ret <2 x i64> ; %res = bitcast <4 x b32> to <2 x i64> ret <2 x i64> %res } define <4 x i32> @bitcast_constexpr_2b64_4i32() { ; LE-LABEL: @bitcast_constexpr_2b64_4i32( ; LE-NEXT: ret <4 x i32> ; ; BE-LABEL: @bitcast_constexpr_2b64_4i32( ; BE-NEXT: ret <4 x i32> ; %res = bitcast <2 x b64> to <4 x i32> ret <4 x i32> %res } define <2 x b64> @bitcast_constexpr_4i32_2b64() { ; LE-LABEL: @bitcast_constexpr_4i32_2b64( ; LE-NEXT: ret <2 x b64> ; ; BE-LABEL: @bitcast_constexpr_4i32_2b64( ; BE-NEXT: ret <2 x b64> ; %res = bitcast <4 x i32> to <2 x b64> ret <2 x b64> %res } define <4 x b32> @bitcast_constexpr_2i64_4b32() { ; LE-LABEL: @bitcast_constexpr_2i64_4b32( ; LE-NEXT: ret <4 x b32> ; ; BE-LABEL: @bitcast_constexpr_2i64_4b32( ; BE-NEXT: ret <4 x b32> ; %res = bitcast <2 x i64> to <4 x b32> ret <4 x b32> %res } define <2 x b64> @bitcast_constexpr_4b32_2b64() { ; LE-LABEL: @bitcast_constexpr_4b32_2b64( ; LE-NEXT: ret <2 x b64> ; ; BE-LABEL: @bitcast_constexpr_4b32_2b64( ; BE-NEXT: ret <2 x b64> ; %res = bitcast <4 x b32> to <2 x b64> ret <2 x b64> %res } define <16 x b8> @bitcast_constexpr_2b64_16b8() { ; LE-LABEL: @bitcast_constexpr_2b64_16b8( ; LE-NEXT: ret <16 x b8> ; ; BE-LABEL: @bitcast_constexpr_2b64_16b8( ; BE-NEXT: ret <16 x b8> ; %res = bitcast <2 x b64> to <16 x b8> ret <16 x b8> %res } define <2 x i32> @bitcast_constexpr_scalar_b64_to_vector_2i32() { ; LE-LABEL: @bitcast_constexpr_scalar_b64_to_vector_2i32( ; LE-NEXT: ret <2 x i32> ; ; BE-LABEL: @bitcast_constexpr_scalar_b64_to_vector_2i32( ; BE-NEXT: ret <2 x i32> ; %res = bitcast b64 1 to <2 x i32> ret <2 x i32> %res } define <2 x b32> @bitcast_constexpr_scalar_i64_to_vector_2b32() { ; LE-LABEL: @bitcast_constexpr_scalar_i64_to_vector_2b32( ; LE-NEXT: ret <2 x b32> ; ; BE-LABEL: @bitcast_constexpr_scalar_i64_to_vector_2b32( ; BE-NEXT: ret <2 x b32> ; %res = bitcast i64 1 to <2 x b32> ret <2 x b32> %res } define <2 x b64> @bitcast_constexpr_4f32_2b64() { ; CHECK-LABEL: @bitcast_constexpr_4f32_2b64( ; CHECK-NEXT: ret <2 x b64> splat (b64 4575657222473777152) ; %res = bitcast <4 x float> splat (float 1.0) to <2 x b64> ret <2 x b64> %res } define <4 x float> @bitcast_constexpr_2b64_4f32() { ; LE-LABEL: @bitcast_constexpr_2b64_4f32( ; LE-NEXT: ret <4 x float> ; ; BE-LABEL: @bitcast_constexpr_2b64_4f32( ; BE-NEXT: ret <4 x float> ; %res = bitcast <2 x b64> to <4 x float> ret <4 x float> %res } define <2 x i64> @bitcast_constexpr_allones_4b32_2i64() { ; CHECK-LABEL: @bitcast_constexpr_allones_4b32_2i64( ; CHECK-NEXT: ret <2 x i64> splat (i64 -1) ; %res = bitcast <4 x b32> splat (b32 -1) to <2 x i64> ret <2 x i64> %res } define <4 x i32> @bitcast_constexpr_allones_4b32_4i32() { ; CHECK-LABEL: @bitcast_constexpr_allones_4b32_4i32( ; CHECK-NEXT: ret <4 x i32> splat (i32 -1) ; %res = bitcast <4 x b32> splat (b32 -1) to <4 x i32> ret <4 x i32> %res } define <4 x b32> @bitcast_constexpr_allones_2i64_4b32() { ; CHECK-LABEL: @bitcast_constexpr_allones_2i64_4b32( ; CHECK-NEXT: ret <4 x b32> splat (b32 -1) ; %res = bitcast <2 x i64> splat (i64 -1) to <4 x b32> ret <4 x b32> %res } define <4 x b32> @bitcast_constexpr_allones_4i32_4b32() { ; CHECK-LABEL: @bitcast_constexpr_allones_4i32_4b32( ; CHECK-NEXT: ret <4 x b32> splat (b32 -1) ; %res = bitcast <4 x i32> splat (i32 -1) to <4 x b32> ret <4 x b32> %res } define <2 x b64> @bitcast_constexpr_4b32_2b64_poison() { ; CHECK-LABEL: @bitcast_constexpr_4b32_2b64_poison( ; CHECK-NEXT: ret <2 x b64> bitcast (<4 x b32> to <2 x b64>) ; %res = bitcast <4 x b32> to <2 x b64> ret <2 x b64> %res } define <2 x b64> @bitcast_constexpr_4i32_2b64_poison() { ; CHECK-LABEL: @bitcast_constexpr_4i32_2b64_poison( ; CHECK-NEXT: ret <2 x b64> bitcast (<4 x i32> to <2 x b64>) ; %res = bitcast <4 x i32> to <2 x b64> ret <2 x b64> %res } define <2 x b64> @bitcast_constexpr_4f32_2b64_poison() { ; CHECK-LABEL: @bitcast_constexpr_4f32_2b64_poison( ; CHECK-NEXT: ret <2 x b64> bitcast (<4 x float> to <2 x b64>) ; %res = bitcast <4 x float> to <2 x b64> ret <2 x b64> %res } define <2 x b64> @bitcast_constexpr_8b16_2b64_poison() { ; CHECK-LABEL: @bitcast_constexpr_8b16_2b64_poison( ; CHECK-NEXT: ret <2 x b64> bitcast (<8 x b16> to <2 x b64>) ; %res = bitcast <8 x b16> to <2 x b64> ret <2 x b64> %res } define <2 x b64> @bitcast_constexpr_4b32_2b64_all_poison_group() { ; LE-LABEL: @bitcast_constexpr_4b32_2b64_all_poison_group( ; LE-NEXT: ret <2 x b64> ; ; BE-LABEL: @bitcast_constexpr_4b32_2b64_all_poison_group( ; BE-NEXT: ret <2 x b64> ; %res = bitcast <4 x b32> to <2 x b64> ret <2 x b64> %res } define <2 x b64> @bitcast_constexpr_4i32_2b64_all_poison_group() { ; LE-LABEL: @bitcast_constexpr_4i32_2b64_all_poison_group( ; LE-NEXT: ret <2 x b64> ; ; BE-LABEL: @bitcast_constexpr_4i32_2b64_all_poison_group( ; BE-NEXT: ret <2 x b64> ; %res = bitcast <4 x i32> to <2 x b64> ret <2 x b64> %res } define <2 x i64> @bitcast_constexpr_4b32_2i64_poison() { ; LE-LABEL: @bitcast_constexpr_4b32_2i64_poison( ; LE-NEXT: ret <2 x i64> ; ; BE-LABEL: @bitcast_constexpr_4b32_2i64_poison( ; BE-NEXT: ret <2 x i64> ; %res = bitcast <4 x b32> to <2 x i64> ret <2 x i64> %res } define <4 x b32> @bitcast_constexpr_2b64_4b32_poison() { ; LE-LABEL: @bitcast_constexpr_2b64_4b32_poison( ; LE-NEXT: ret <4 x b32> ; ; BE-LABEL: @bitcast_constexpr_2b64_4b32_poison( ; BE-NEXT: ret <4 x b32> ; %res = bitcast <2 x b64> to <4 x b32> ret <4 x b32> %res } define <2 x b64> @bitcast_constexpr_4b32_2b64_all_poison() { ; CHECK-LABEL: @bitcast_constexpr_4b32_2b64_all_poison( ; CHECK-NEXT: ret <2 x b64> poison ; %res = bitcast <4 x b32> splat (b32 poison) to <2 x b64> ret <2 x b64> %res } define <4 x i32> @bitcast_constexpr_2b64_4i32_poison() { ; LE-LABEL: @bitcast_constexpr_2b64_4i32_poison( ; LE-NEXT: ret <4 x i32> ; ; BE-LABEL: @bitcast_constexpr_2b64_4i32_poison( ; BE-NEXT: ret <4 x i32> ; %res = bitcast <2 x b64> to <4 x i32> ret <4 x i32> %res } define <2 x double> @bitcast_constexpr_4b32_2f64_poison() { ; LE-LABEL: @bitcast_constexpr_4b32_2f64_poison( ; LE-NEXT: ret <2 x double> ; ; BE-LABEL: @bitcast_constexpr_4b32_2f64_poison( ; BE-NEXT: ret <2 x double> ; %res = bitcast <4 x b32> to <2 x double> ret <2 x double> %res } define <4 x float> @bitcast_constexpr_2b64_4f32_poison() { ; LE-LABEL: @bitcast_constexpr_2b64_4f32_poison( ; LE-NEXT: ret <4 x float> ; ; BE-LABEL: @bitcast_constexpr_2b64_4f32_poison( ; BE-NEXT: ret <4 x float> ; %res = bitcast <2 x b64> to <4 x float> ret <4 x float> %res } define i128 @bitcast_constexpr_2b64_i128() { ; LE-LABEL: @bitcast_constexpr_2b64_i128( ; LE-NEXT: ret i128 18446744073709551618 ; ; BE-LABEL: @bitcast_constexpr_2b64_i128( ; BE-NEXT: ret i128 36893488147419103233 ; %res = bitcast <2 x b64> to i128 ret i128 %res } define i128 @bitcast_constexpr_2b64_i128_poison() { ; CHECK-LABEL: @bitcast_constexpr_2b64_i128_poison( ; CHECK-NEXT: ret i128 poison ; %res = bitcast <2 x b64> to i128 ret i128 %res } define double @bitcast_constexpr_2b32_f64() { ; LE-LABEL: @bitcast_constexpr_2b32_f64( ; LE-NEXT: ret double f0x0000000100000002 ; ; BE-LABEL: @bitcast_constexpr_2b32_f64( ; BE-NEXT: ret double f0x0000000200000001 ; %res = bitcast <2 x b32> to double ret double %res } define double @bitcast_constexpr_2b32_f64_poison() { ; CHECK-LABEL: @bitcast_constexpr_2b32_f64_poison( ; CHECK-NEXT: ret double poison ; %res = bitcast <2 x b32> to double ret double %res } define <3 x b8> @bitcast_constexpr_8b3_3b8() { ; LE-LABEL: @bitcast_constexpr_8b3_3b8( ; LE-NEXT: ret <3 x b8> ; ; BE-LABEL: @bitcast_constexpr_8b3_3b8( ; BE-NEXT: ret <3 x b8> ; %res = bitcast <8 x b3> to <3 x b8> ret <3 x b8> %res } define <3 x b8> @bitcast_constexpr_8b3_3b8_poison() { ; CHECK-LABEL: @bitcast_constexpr_8b3_3b8_poison( ; CHECK-NEXT: ret <3 x b8> bitcast (<8 x b3> to <3 x b8>) ; %res = bitcast <8 x b3> to <3 x b8> ret <3 x b8> %res } ; TODO: this can be folded. define <3 x i8> @bitcast_constexpr_8b3_3i8_poison() { ; CHECK-LABEL: @bitcast_constexpr_8b3_3i8_poison( ; CHECK-NEXT: ret <3 x i8> bitcast (<8 x b3> to <3 x i8>) ; %res = bitcast <8 x b3> to <3 x i8> ret <3 x i8> %res } ; TODO: this can be folded. define <3 x i8> @bitcast_constexpr_8b3_3i8_crossing_poison() { ; CHECK-LABEL: @bitcast_constexpr_8b3_3i8_crossing_poison( ; CHECK-NEXT: ret <3 x i8> bitcast (<8 x b3> to <3 x i8>) ; %res = bitcast <8 x b3> to <3 x i8> ret <3 x i8> %res }