From: Alexey Bataev Date: Wed, 4 Aug 2021 18:49:17 +0000 (-0700) Subject: [SLP][NFC]Add tests for constants/undefs used in insertelements, NFC. X-Git-Tag: upstream/15.0.7~34668 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8f465a0cfb7b2596768f749839dd53ab6a5e8dd3;p=platform%2Fupstream%2Fllvm.git [SLP][NFC]Add tests for constants/undefs used in insertelements, NFC. --- diff --git a/llvm/test/Transforms/SLPVectorizer/X86/sitofp.ll b/llvm/test/Transforms/SLPVectorizer/X86/sitofp.ll index 5cec75d..17e19d3 100644 --- a/llvm/test/Transforms/SLPVectorizer/X86/sitofp.ll +++ b/llvm/test/Transforms/SLPVectorizer/X86/sitofp.ll @@ -1096,6 +1096,40 @@ define <4 x double> @sitofp_4xi32_4f64(i32 %a0, i32 %a1, i32 %a2, i32 %a3) #0 { ret <4 x double> %res3 } +define <4 x double> @sitofp_with_const_4xi32_4f64(i32 %a2, i32 %a3) #0 { +; CHECK-LABEL: @sitofp_with_const_4xi32_4f64( +; CHECK-NEXT: [[TMP1:%.*]] = insertelement <2 x i32> poison, i32 [[A2:%.*]], i32 0 +; CHECK-NEXT: [[TMP2:%.*]] = insertelement <2 x i32> [[TMP1]], i32 [[A3:%.*]], i32 1 +; CHECK-NEXT: [[TMP3:%.*]] = sitofp <2 x i32> [[TMP2]] to <2 x double> +; CHECK-NEXT: [[RES0:%.*]] = insertelement <4 x double> undef, double 1.000000e+00, i32 3 +; CHECK-NEXT: [[TMP4:%.*]] = shufflevector <2 x double> [[TMP3]], <2 x double> poison, <4 x i32> +; CHECK-NEXT: [[RES31:%.*]] = shufflevector <4 x double> [[RES0]], <4 x double> [[TMP4]], <4 x i32> +; CHECK-NEXT: ret <4 x double> [[RES31]] +; + %cvt2 = sitofp i32 %a2 to double + %cvt3 = sitofp i32 %a3 to double + %res0 = insertelement <4 x double> undef, double 1.0, i32 3 + %res2 = insertelement <4 x double> %res0, double %cvt2, i32 0 + %res3 = insertelement <4 x double> %res2, double %cvt3, i32 1 + ret <4 x double> %res3 +} + +define <4 x double> @sitofp_with_undef_4xi32_4f64(i32 %a2, i32 %a3) #0 { +; CHECK-LABEL: @sitofp_with_undef_4xi32_4f64( +; CHECK-NEXT: [[TMP1:%.*]] = insertelement <2 x i32> poison, i32 [[A2:%.*]], i32 0 +; CHECK-NEXT: [[TMP2:%.*]] = insertelement <2 x i32> [[TMP1]], i32 [[A3:%.*]], i32 1 +; CHECK-NEXT: [[TMP3:%.*]] = sitofp <2 x i32> [[TMP2]] to <2 x double> +; CHECK-NEXT: [[TMP4:%.*]] = shufflevector <2 x double> [[TMP3]], <2 x double> poison, <4 x i32> +; CHECK-NEXT: [[RES31:%.*]] = shufflevector <4 x double> undef, <4 x double> [[TMP4]], <4 x i32> +; CHECK-NEXT: ret <4 x double> [[RES31]] +; + %cvt2 = sitofp i32 %a2 to double + %cvt3 = sitofp i32 %a3 to double + %res2 = insertelement <4 x double> undef, double %cvt2, i32 0 + %res3 = insertelement <4 x double> %res2, double %cvt3, i32 1 + ret <4 x double> %res3 +} + define <4 x float> @sitofp_4xi32_4f32(i32 %a0, i32 %a1, i32 %a2, i32 %a3) #0 { ; CHECK-LABEL: @sitofp_4xi32_4f32( ; CHECK-NEXT: [[TMP1:%.*]] = insertelement <4 x i32> poison, i32 [[A0:%.*]], i32 0