1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py 2; RUN: opt -slp-vectorizer -S -o - -mtriple=x86_64-unknown-linux-gnu < %s | FileCheck %s 3 4%struct.sw = type { float, float, float, float } 5 6define { <2 x float>, <2 x float> } @foo(%struct.sw* %v) { 7; CHECK-LABEL: @foo( 8; CHECK-NEXT: entry: 9; CHECK-NEXT: [[TMP0:%.*]] = load float, float* undef, align 4 10; CHECK-NEXT: [[X:%.*]] = getelementptr inbounds [[STRUCT_SW:%.*]], %struct.sw* [[V:%.*]], i64 0, i32 0 11; CHECK-NEXT: [[TMP1:%.*]] = load float, float* undef, align 4 12; CHECK-NEXT: [[TMP2:%.*]] = bitcast float* [[X]] to <2 x float>* 13; CHECK-NEXT: [[TMP3:%.*]] = load <2 x float>, <2 x float>* [[TMP2]], align 16 14; CHECK-NEXT: [[SHUFFLE:%.*]] = shufflevector <2 x float> [[TMP3]], <2 x float> poison, <4 x i32> <i32 1, i32 0, i32 0, i32 1> 15; CHECK-NEXT: [[TMP4:%.*]] = insertelement <4 x float> poison, float [[TMP0]], i32 0 16; CHECK-NEXT: [[TMP5:%.*]] = insertelement <4 x float> [[TMP4]], float [[TMP1]], i32 1 17; CHECK-NEXT: [[SHUFFLE1:%.*]] = shufflevector <4 x float> [[TMP5]], <4 x float> poison, <4 x i32> <i32 0, i32 undef, i32 1, i32 undef> 18; CHECK-NEXT: [[TMP6:%.*]] = fmul <4 x float> [[SHUFFLE]], [[SHUFFLE1]] 19; CHECK-NEXT: [[TMP7:%.*]] = fadd <4 x float> [[TMP6]], poison 20; CHECK-NEXT: [[TMP8:%.*]] = fadd <4 x float> [[TMP7]], poison 21; CHECK-NEXT: [[TMP9:%.*]] = fadd <4 x float> [[TMP8]], poison 22; CHECK-NEXT: [[TMP10:%.*]] = extractelement <4 x float> [[TMP9]], i32 0 23; CHECK-NEXT: [[VEC1:%.*]] = insertelement <2 x float> undef, float [[TMP10]], i32 0 24; CHECK-NEXT: [[TMP11:%.*]] = extractelement <4 x float> [[TMP9]], i32 1 25; CHECK-NEXT: [[VEC2:%.*]] = insertelement <2 x float> [[VEC1]], float [[TMP11]], i32 1 26; CHECK-NEXT: [[TMP12:%.*]] = extractelement <4 x float> [[TMP9]], i32 2 27; CHECK-NEXT: [[VEC3:%.*]] = insertelement <2 x float> undef, float [[TMP12]], i32 0 28; CHECK-NEXT: [[TMP13:%.*]] = extractelement <4 x float> [[TMP9]], i32 3 29; CHECK-NEXT: [[VEC4:%.*]] = insertelement <2 x float> [[VEC3]], float [[TMP13]], i32 1 30; CHECK-NEXT: [[INS1:%.*]] = insertvalue { <2 x float>, <2 x float> } undef, <2 x float> [[VEC2]], 0 31; CHECK-NEXT: [[INS2:%.*]] = insertvalue { <2 x float>, <2 x float> } [[INS1]], <2 x float> [[VEC4]], 1 32; CHECK-NEXT: ret { <2 x float>, <2 x float> } [[INS2]] 33; 34entry: 35 %0 = load float, float* undef, align 4 36 %x = getelementptr inbounds %struct.sw, %struct.sw* %v, i64 0, i32 0 37 %1 = load float, float* %x, align 16 38 %y = getelementptr inbounds %struct.sw, %struct.sw* %v, i64 0, i32 1 39 %2 = load float, float* %y, align 4 40 %mul3 = fmul float %0, %2 41 %add = fadd float undef, %mul3 42 %add6 = fadd float %add, undef 43 %add9 = fadd float %add6, undef 44 %mul12 = fmul float %1, undef 45 %add16 = fadd float %mul12, undef 46 %add20 = fadd float undef, %add16 47 %add24 = fadd float undef, %add20 48 %3 = load float, float* undef, align 4 49 %mul27 = fmul float %1, %3 50 %add31 = fadd float %mul27, undef 51 %add35 = fadd float undef, %add31 52 %add39 = fadd float undef, %add35 53 %mul45 = fmul float %2, undef 54 %add46 = fadd float undef, %mul45 55 %add50 = fadd float undef, %add46 56 %add54 = fadd float undef, %add50 57 %vec1 = insertelement <2 x float> undef, float %add9, i32 0 58 %vec2 = insertelement <2 x float> %vec1, float %add24, i32 1 59 %vec3 = insertelement <2 x float> undef, float %add39, i32 0 60 %vec4 = insertelement <2 x float> %vec3, float %add54, i32 1 61 %ins1 = insertvalue { <2 x float>, <2 x float> } undef, <2 x float> %vec2, 0 62 %ins2 = insertvalue { <2 x float>, <2 x float> } %ins1, <2 x float> %vec4, 1 63 ret { <2 x float>, <2 x float> } %ins2 64} 65