1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py 2; RUN: %if x86-registered-target %{ opt -passes=slp-vectorizer -S < %s -mtriple=x86_64-unknown-linux -slp-threshold=-165 | FileCheck %s %} 3; RUN: %if aarch64-registered-target %{ opt -passes=slp-vectorizer -S < %s -mtriple=aarch64-unknown-linux -slp-threshold=-165 | FileCheck %s %} 4 5define void @test1(i128 %p0, i128 %p1, i128 %p2, i128 %p3, <4 x i128> %vec) { 6; CHECK-LABEL: @test1( 7; CHECK-NEXT: entry: 8; CHECK-NEXT: [[TMP0:%.*]] = insertelement <2 x i128> poison, i128 [[P0:%.*]], i32 0 9; CHECK-NEXT: [[TMP1:%.*]] = insertelement <2 x i128> [[TMP0]], i128 [[P1:%.*]], i32 1 10; CHECK-NEXT: [[TMP2:%.*]] = trunc <2 x i128> [[TMP1]] to <2 x i32> 11; CHECK-NEXT: [[TMP3:%.*]] = shufflevector <2 x i32> [[TMP2]], <2 x i32> poison, <4 x i32> <i32 0, i32 1, i32 0, i32 1> 12; CHECK-NEXT: [[TMP4:%.*]] = insertelement <2 x i128> poison, i128 [[P2:%.*]], i32 0 13; CHECK-NEXT: [[TMP5:%.*]] = insertelement <2 x i128> [[TMP4]], i128 [[P3:%.*]], i32 1 14; CHECK-NEXT: [[TMP6:%.*]] = trunc <2 x i128> [[TMP5]] to <2 x i32> 15; CHECK-NEXT: [[TMP7:%.*]] = shufflevector <2 x i32> [[TMP6]], <2 x i32> poison, <4 x i32> <i32 0, i32 1, i32 0, i32 1> 16; CHECK-NEXT: [[T5:%.*]] = trunc i128 [[P1]] to i32 17; CHECK-NEXT: [[TMP8:%.*]] = sdiv <4 x i32> [[TMP3]], [[TMP7]] 18; CHECK-NEXT: [[TMP9:%.*]] = trunc <4 x i128> [[VEC:%.*]] to <4 x i32> 19; CHECK-NEXT: [[TMP10:%.*]] = trunc <4 x i128> [[VEC]] to <4 x i32> 20; CHECK-NEXT: [[TMP11:%.*]] = shufflevector <2 x i32> [[TMP2]], <2 x i32> [[TMP6]], <4 x i32> <i32 poison, i32 0, i32 3, i32 2> 21; CHECK-NEXT: [[TMP12:%.*]] = shufflevector <4 x i32> [[TMP10]], <4 x i32> [[TMP11]], <4 x i32> <i32 0, i32 5, i32 6, i32 7> 22; CHECK-NEXT: [[TMP13:%.*]] = sdiv <4 x i32> [[TMP8]], [[TMP12]] 23; CHECK-NEXT: br label [[BB:%.*]] 24; CHECK: bb: 25; CHECK-NEXT: [[TMP14:%.*]] = phi <4 x i32> [ [[TMP13]], [[ENTRY:%.*]] ] 26; CHECK-NEXT: ret void 27; 28entry: 29 %t1 = trunc i128 %p0 to i32 30 %t2 = trunc i128 %p1 to i32 31 %t3 = trunc i128 %p2 to i32 32 %t4 = trunc i128 %p3 to i32 33 %t5 = trunc i128 %p1 to i32 34 %t6 = trunc i128 %p0 to i32 35 %t7 = trunc i128 %p3 to i32 36 %t8 = trunc i128 %p2 to i32 37 %m0 = sdiv i32 %t1, %t3 38 %m1 = sdiv i32 %t2, %t4 39 %m2 = sdiv i32 %t1, %t3 40 %m3 = sdiv i32 %t2, %t4 41 %e0 = extractelement <4 x i128> %vec, i32 0 42 %t9 = trunc i128 %e0 to i32 43 %d0 = sdiv i32 %m0, %t9 44 %d1 = sdiv i32 %m1, %t6 45 %d2 = sdiv i32 %m2, %t7 46 %d3 = sdiv i32 %m3, %t8 47 br label %bb 48 49bb: 50 %phi0 = phi i32 [ %d0, %entry ] 51 %phi1 = phi i32 [ %d1, %entry ] 52 %phi2 = phi i32 [ %d2, %entry ] 53 %phi3 = phi i32 [ %d3, %entry ] 54 ret void 55} 56