From e764b9b3dc21ba212efb80dcd623c50c8f6fa80a Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Wed, 2 Aug 2017 14:22:53 +0000 Subject: [PATCH] [SLPVectorizer] Test update, NFC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309814 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../SLPVectorizer/AArch64/gather-root.ll | 181 +++++++++++++++++---- 1 file changed, 151 insertions(+), 30 deletions(-) diff --git a/test/Transforms/SLPVectorizer/AArch64/gather-root.ll b/test/Transforms/SLPVectorizer/AArch64/gather-root.ll index 68d6ebd27a5..0ea08b79694 100644 --- a/test/Transforms/SLPVectorizer/AArch64/gather-root.ll +++ b/test/Transforms/SLPVectorizer/AArch64/gather-root.ll @@ -8,37 +8,115 @@ target triple = "aarch64--linux-gnu" @a = common global [80 x i8] zeroinitializer, align 16 +define void @PR28330(i32 %n) { ; DEFAULT-LABEL: @PR28330( -; DEFAULT: %tmp17 = phi i32 [ %bin.extra, %for.body ], [ 0, %entry ] -; DEFAULT: %[[S0:.+]] = select <8 x i1> %1, <8 x i32> , <8 x i32> -; DEFAULT: %[[Rdx:.+]] = call i32 @llvm.experimental.vector.reduce.add.i32.v8i32(<8 x i32> %[[S0]]) -; DEFAULT: %bin.extra = add i32 %[[Rdx]], %tmp17 +; DEFAULT-NEXT: entry: +; DEFAULT-NEXT: [[TMP0:%.*]] = load <8 x i8>, <8 x i8>* bitcast (i8* getelementptr inbounds ([80 x i8], [80 x i8]* @a, i64 0, i64 1) to <8 x i8>*), align 1 +; DEFAULT-NEXT: [[TMP1:%.*]] = icmp eq <8 x i8> [[TMP0]], zeroinitializer +; DEFAULT-NEXT: br label [[FOR_BODY:%.*]] +; DEFAULT: for.body: +; DEFAULT-NEXT: [[TMP17:%.*]] = phi i32 [ [[BIN_EXTRA:%.*]], [[FOR_BODY]] ], [ 0, [[ENTRY:%.*]] ] +; DEFAULT-NEXT: [[TMP2:%.*]] = select <8 x i1> [[TMP1]], <8 x i32> , <8 x i32> +; DEFAULT-NEXT: [[TMP20:%.*]] = add i32 [[TMP17]], undef +; DEFAULT-NEXT: [[TMP22:%.*]] = add i32 [[TMP20]], undef +; DEFAULT-NEXT: [[TMP24:%.*]] = add i32 [[TMP22]], undef +; DEFAULT-NEXT: [[TMP26:%.*]] = add i32 [[TMP24]], undef +; DEFAULT-NEXT: [[TMP28:%.*]] = add i32 [[TMP26]], undef +; DEFAULT-NEXT: [[TMP30:%.*]] = add i32 [[TMP28]], undef +; DEFAULT-NEXT: [[TMP32:%.*]] = add i32 [[TMP30]], undef +; DEFAULT-NEXT: [[TMP3:%.*]] = call i32 @llvm.experimental.vector.reduce.add.i32.v8i32(<8 x i32> [[TMP2]]) +; DEFAULT-NEXT: [[BIN_EXTRA]] = add i32 [[TMP3]], [[TMP17]] +; DEFAULT-NEXT: [[TMP34:%.*]] = add i32 [[TMP32]], undef +; DEFAULT-NEXT: br label [[FOR_BODY]] ; ; GATHER-LABEL: @PR28330( -; GATHER: %tmp17 = phi i32 [ %bin.extra, %for.body ], [ 0, %entry ] -; GATHER: %tmp19 = select i1 %tmp1, i32 -720, i32 -80 -; GATHER: %tmp21 = select i1 %tmp3, i32 -720, i32 -80 -; GATHER: %tmp23 = select i1 %tmp5, i32 -720, i32 -80 -; GATHER: %tmp25 = select i1 %tmp7, i32 -720, i32 -80 -; GATHER: %tmp27 = select i1 %tmp9, i32 -720, i32 -80 -; GATHER: %tmp29 = select i1 %tmp11, i32 -720, i32 -80 -; GATHER: %tmp31 = select i1 %tmp13, i32 -720, i32 -80 -; GATHER: %tmp33 = select i1 %tmp15, i32 -720, i32 -80 -; GATHER: %[[I0:.+]] = insertelement <8 x i32> undef, i32 %tmp19, i32 0 -; GATHER: %[[I1:.+]] = insertelement <8 x i32> %[[I0]], i32 %tmp21, i32 1 -; GATHER: %[[I2:.+]] = insertelement <8 x i32> %[[I1]], i32 %tmp23, i32 2 -; GATHER: %[[I3:.+]] = insertelement <8 x i32> %[[I2]], i32 %tmp25, i32 3 -; GATHER: %[[I4:.+]] = insertelement <8 x i32> %[[I3]], i32 %tmp27, i32 4 -; GATHER: %[[I5:.+]] = insertelement <8 x i32> %[[I4]], i32 %tmp29, i32 5 -; GATHER: %[[I6:.+]] = insertelement <8 x i32> %[[I5]], i32 %tmp31, i32 6 -; GATHER: %[[I7:.+]] = insertelement <8 x i32> %[[I6]], i32 %tmp33, i32 7 -; GATHER: %[[Rdx:.+]] = call i32 @llvm.experimental.vector.reduce.add.i32.v8i32(<8 x i32> %[[I7]]) -; GATHER: %bin.extra = add i32 %[[Rdx]], %tmp17 +; GATHER-NEXT: entry: +; GATHER-NEXT: [[TMP0:%.*]] = load i8, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @a, i64 0, i64 1), align 1 +; GATHER-NEXT: [[TMP1:%.*]] = icmp eq i8 [[TMP0]], 0 +; GATHER-NEXT: [[TMP2:%.*]] = load i8, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @a, i64 0, i64 2), align 2 +; GATHER-NEXT: [[TMP3:%.*]] = icmp eq i8 [[TMP2]], 0 +; GATHER-NEXT: [[TMP4:%.*]] = load i8, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @a, i64 0, i64 3), align 1 +; GATHER-NEXT: [[TMP5:%.*]] = icmp eq i8 [[TMP4]], 0 +; GATHER-NEXT: [[TMP6:%.*]] = load i8, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @a, i64 0, i64 4), align 4 +; GATHER-NEXT: [[TMP7:%.*]] = icmp eq i8 [[TMP6]], 0 +; GATHER-NEXT: [[TMP8:%.*]] = load i8, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @a, i64 0, i64 5), align 1 +; GATHER-NEXT: [[TMP9:%.*]] = icmp eq i8 [[TMP8]], 0 +; GATHER-NEXT: [[TMP10:%.*]] = load i8, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @a, i64 0, i64 6), align 2 +; GATHER-NEXT: [[TMP11:%.*]] = icmp eq i8 [[TMP10]], 0 +; GATHER-NEXT: [[TMP12:%.*]] = load i8, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @a, i64 0, i64 7), align 1 +; GATHER-NEXT: [[TMP13:%.*]] = icmp eq i8 [[TMP12]], 0 +; GATHER-NEXT: [[TMP14:%.*]] = load i8, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @a, i64 0, i64 8), align 8 +; GATHER-NEXT: [[TMP15:%.*]] = icmp eq i8 [[TMP14]], 0 +; GATHER-NEXT: br label [[FOR_BODY:%.*]] +; GATHER: for.body: +; GATHER-NEXT: [[TMP17:%.*]] = phi i32 [ [[BIN_EXTRA:%.*]], [[FOR_BODY]] ], [ 0, [[ENTRY:%.*]] ] +; GATHER-NEXT: [[TMP19:%.*]] = select i1 [[TMP1]], i32 -720, i32 -80 +; GATHER-NEXT: [[TMP20:%.*]] = add i32 [[TMP17]], [[TMP19]] +; GATHER-NEXT: [[TMP21:%.*]] = select i1 [[TMP3]], i32 -720, i32 -80 +; GATHER-NEXT: [[TMP22:%.*]] = add i32 [[TMP20]], [[TMP21]] +; GATHER-NEXT: [[TMP23:%.*]] = select i1 [[TMP5]], i32 -720, i32 -80 +; GATHER-NEXT: [[TMP24:%.*]] = add i32 [[TMP22]], [[TMP23]] +; GATHER-NEXT: [[TMP25:%.*]] = select i1 [[TMP7]], i32 -720, i32 -80 +; GATHER-NEXT: [[TMP26:%.*]] = add i32 [[TMP24]], [[TMP25]] +; GATHER-NEXT: [[TMP27:%.*]] = select i1 [[TMP9]], i32 -720, i32 -80 +; GATHER-NEXT: [[TMP28:%.*]] = add i32 [[TMP26]], [[TMP27]] +; GATHER-NEXT: [[TMP29:%.*]] = select i1 [[TMP11]], i32 -720, i32 -80 +; GATHER-NEXT: [[TMP30:%.*]] = add i32 [[TMP28]], [[TMP29]] +; GATHER-NEXT: [[TMP31:%.*]] = select i1 [[TMP13]], i32 -720, i32 -80 +; GATHER-NEXT: [[TMP32:%.*]] = add i32 [[TMP30]], [[TMP31]] +; GATHER-NEXT: [[TMP33:%.*]] = select i1 [[TMP15]], i32 -720, i32 -80 +; GATHER-NEXT: [[TMP0:%.*]] = insertelement <8 x i32> undef, i32 [[TMP19]], i32 0 +; GATHER-NEXT: [[TMP1:%.*]] = insertelement <8 x i32> [[TMP0]], i32 [[TMP21]], i32 1 +; GATHER-NEXT: [[TMP2:%.*]] = insertelement <8 x i32> [[TMP1]], i32 [[TMP23]], i32 2 +; GATHER-NEXT: [[TMP3:%.*]] = insertelement <8 x i32> [[TMP2]], i32 [[TMP25]], i32 3 +; GATHER-NEXT: [[TMP4:%.*]] = insertelement <8 x i32> [[TMP3]], i32 [[TMP27]], i32 4 +; GATHER-NEXT: [[TMP5:%.*]] = insertelement <8 x i32> [[TMP4]], i32 [[TMP29]], i32 5 +; GATHER-NEXT: [[TMP6:%.*]] = insertelement <8 x i32> [[TMP5]], i32 [[TMP31]], i32 6 +; GATHER-NEXT: [[TMP7:%.*]] = insertelement <8 x i32> [[TMP6]], i32 [[TMP33]], i32 7 +; GATHER-NEXT: [[TMP8:%.*]] = call i32 @llvm.experimental.vector.reduce.add.i32.v8i32(<8 x i32> [[TMP7]]) +; GATHER-NEXT: [[BIN_EXTRA]] = add i32 [[TMP8]], [[TMP17]] +; GATHER-NEXT: [[TMP34:%.*]] = add i32 [[TMP32]], [[TMP33]] +; GATHER-NEXT: br label [[FOR_BODY]] ; ; MAX-COST-LABEL: @PR28330( -; MAX-COST-NOT: shufflevector - -define void @PR28330(i32 %n) { +; MAX-COST-NEXT: entry: +; MAX-COST-NEXT: [[TMP0:%.*]] = load i8, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @a, i64 0, i64 1), align 1 +; MAX-COST-NEXT: [[TMP1:%.*]] = icmp eq i8 [[TMP0]], 0 +; MAX-COST-NEXT: [[TMP2:%.*]] = load i8, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @a, i64 0, i64 2), align 2 +; MAX-COST-NEXT: [[TMP3:%.*]] = icmp eq i8 [[TMP2]], 0 +; MAX-COST-NEXT: [[TMP4:%.*]] = load i8, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @a, i64 0, i64 3), align 1 +; MAX-COST-NEXT: [[TMP5:%.*]] = icmp eq i8 [[TMP4]], 0 +; MAX-COST-NEXT: [[TMP6:%.*]] = load i8, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @a, i64 0, i64 4), align 4 +; MAX-COST-NEXT: [[TMP7:%.*]] = icmp eq i8 [[TMP6]], 0 +; MAX-COST-NEXT: [[TMP8:%.*]] = load i8, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @a, i64 0, i64 5), align 1 +; MAX-COST-NEXT: [[TMP9:%.*]] = icmp eq i8 [[TMP8]], 0 +; MAX-COST-NEXT: [[TMP10:%.*]] = load i8, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @a, i64 0, i64 6), align 2 +; MAX-COST-NEXT: [[TMP11:%.*]] = icmp eq i8 [[TMP10]], 0 +; MAX-COST-NEXT: [[TMP12:%.*]] = load i8, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @a, i64 0, i64 7), align 1 +; MAX-COST-NEXT: [[TMP13:%.*]] = icmp eq i8 [[TMP12]], 0 +; MAX-COST-NEXT: [[TMP14:%.*]] = load i8, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @a, i64 0, i64 8), align 8 +; MAX-COST-NEXT: [[TMP15:%.*]] = icmp eq i8 [[TMP14]], 0 +; MAX-COST-NEXT: br label [[FOR_BODY:%.*]] +; MAX-COST: for.body: +; MAX-COST-NEXT: [[TMP17:%.*]] = phi i32 [ [[TMP34:%.*]], [[FOR_BODY]] ], [ 0, [[ENTRY:%.*]] ] +; MAX-COST-NEXT: [[TMP19:%.*]] = select i1 [[TMP1]], i32 -720, i32 -80 +; MAX-COST-NEXT: [[TMP20:%.*]] = add i32 [[TMP17]], [[TMP19]] +; MAX-COST-NEXT: [[TMP21:%.*]] = select i1 [[TMP3]], i32 -720, i32 -80 +; MAX-COST-NEXT: [[TMP22:%.*]] = add i32 [[TMP20]], [[TMP21]] +; MAX-COST-NEXT: [[TMP23:%.*]] = select i1 [[TMP5]], i32 -720, i32 -80 +; MAX-COST-NEXT: [[TMP24:%.*]] = add i32 [[TMP22]], [[TMP23]] +; MAX-COST-NEXT: [[TMP25:%.*]] = select i1 [[TMP7]], i32 -720, i32 -80 +; MAX-COST-NEXT: [[TMP26:%.*]] = add i32 [[TMP24]], [[TMP25]] +; MAX-COST-NEXT: [[TMP27:%.*]] = select i1 [[TMP9]], i32 -720, i32 -80 +; MAX-COST-NEXT: [[TMP28:%.*]] = add i32 [[TMP26]], [[TMP27]] +; MAX-COST-NEXT: [[TMP29:%.*]] = select i1 [[TMP11]], i32 -720, i32 -80 +; MAX-COST-NEXT: [[TMP30:%.*]] = add i32 [[TMP28]], [[TMP29]] +; MAX-COST-NEXT: [[TMP31:%.*]] = select i1 [[TMP13]], i32 -720, i32 -80 +; MAX-COST-NEXT: [[TMP32:%.*]] = add i32 [[TMP30]], [[TMP31]] +; MAX-COST-NEXT: [[TMP33:%.*]] = select i1 [[TMP15]], i32 -720, i32 -80 +; MAX-COST-NEXT: [[TMP34]] = add i32 [[TMP32]], [[TMP33]] +; MAX-COST-NEXT: br label [[FOR_BODY]] +; entry: %tmp0 = load i8, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @a, i64 0, i64 1), align 1 %tmp1 = icmp eq i8 %tmp0, 0 @@ -95,8 +173,8 @@ define void @PR32038(i32 %n) { ; DEFAULT-NEXT: [[TMP28:%.*]] = add i32 [[TMP26]], undef ; DEFAULT-NEXT: [[TMP30:%.*]] = add i32 [[TMP28]], undef ; DEFAULT-NEXT: [[TMP32:%.*]] = add i32 [[TMP30]], undef -; DEFAULT-NEXT: [[Rdx:%.*]] = call i32 @llvm.experimental.vector.reduce.add.i32.v8i32(<8 x i32> [[TMP2]]) -; DEFAULT-NEXT: [[BIN_EXTRA]] = add i32 [[Rdx]], -5 +; DEFAULT-NEXT: [[TMP3:%.*]] = call i32 @llvm.experimental.vector.reduce.add.i32.v8i32(<8 x i32> [[TMP2]]) +; DEFAULT-NEXT: [[BIN_EXTRA]] = add i32 [[TMP3]], -5 ; DEFAULT-NEXT: [[TMP34:%.*]] = add i32 [[TMP32]], undef ; DEFAULT-NEXT: br label [[FOR_BODY]] ; @@ -144,12 +222,55 @@ define void @PR32038(i32 %n) { ; GATHER-NEXT: [[TMP5:%.*]] = insertelement <8 x i32> [[TMP4]], i32 [[TMP29]], i32 5 ; GATHER-NEXT: [[TMP6:%.*]] = insertelement <8 x i32> [[TMP5]], i32 [[TMP31]], i32 6 ; GATHER-NEXT: [[TMP7:%.*]] = insertelement <8 x i32> [[TMP6]], i32 [[TMP33]], i32 7 -; GATHER-NEXT: [[Rdx:%.*]] = call i32 @llvm.experimental.vector.reduce.add.i32.v8i32(<8 x i32> [[TMP7]]) -; GATHER-NEXT: [[BIN_EXTRA]] = add i32 [[Rdx]], -5 +; GATHER-NEXT: [[TMP8:%.*]] = call i32 @llvm.experimental.vector.reduce.add.i32.v8i32(<8 x i32> [[TMP7]]) +; GATHER-NEXT: [[BIN_EXTRA]] = add i32 [[TMP8]], -5 ; GATHER-NEXT: [[TMP34:%.*]] = add i32 [[TMP32]], [[TMP33]] ; GATHER-NEXT: br label [[FOR_BODY]] ; ; MAX-COST-LABEL: @PR32038( +; MAX-COST-NEXT: entry: +; MAX-COST-NEXT: [[TMP0:%.*]] = load i8, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @a, i64 0, i64 1), align 1 +; MAX-COST-NEXT: [[TMP1:%.*]] = icmp eq i8 [[TMP0]], 0 +; MAX-COST-NEXT: [[TMP2:%.*]] = load i8, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @a, i64 0, i64 2), align 2 +; MAX-COST-NEXT: [[TMP3:%.*]] = icmp eq i8 [[TMP2]], 0 +; MAX-COST-NEXT: [[TMP4:%.*]] = load i8, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @a, i64 0, i64 3), align 1 +; MAX-COST-NEXT: [[TMP5:%.*]] = icmp eq i8 [[TMP4]], 0 +; MAX-COST-NEXT: [[TMP6:%.*]] = load i8, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @a, i64 0, i64 4), align 4 +; MAX-COST-NEXT: [[TMP7:%.*]] = icmp eq i8 [[TMP6]], 0 +; MAX-COST-NEXT: [[TMP8:%.*]] = load i8, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @a, i64 0, i64 5), align 1 +; MAX-COST-NEXT: [[TMP9:%.*]] = icmp eq i8 [[TMP8]], 0 +; MAX-COST-NEXT: [[TMP10:%.*]] = load i8, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @a, i64 0, i64 6), align 2 +; MAX-COST-NEXT: [[TMP11:%.*]] = icmp eq i8 [[TMP10]], 0 +; MAX-COST-NEXT: [[TMP12:%.*]] = load i8, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @a, i64 0, i64 7), align 1 +; MAX-COST-NEXT: [[TMP13:%.*]] = icmp eq i8 [[TMP12]], 0 +; MAX-COST-NEXT: [[TMP14:%.*]] = load i8, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @a, i64 0, i64 8), align 8 +; MAX-COST-NEXT: [[TMP15:%.*]] = icmp eq i8 [[TMP14]], 0 +; MAX-COST-NEXT: [[TMP0:%.*]] = insertelement <4 x i1> undef, i1 [[TMP1]], i32 0 +; MAX-COST-NEXT: [[TMP1:%.*]] = insertelement <4 x i1> [[TMP0]], i1 [[TMP3]], i32 1 +; MAX-COST-NEXT: [[TMP2:%.*]] = insertelement <4 x i1> [[TMP1]], i1 [[TMP5]], i32 2 +; MAX-COST-NEXT: [[TMP3:%.*]] = insertelement <4 x i1> [[TMP2]], i1 [[TMP7]], i32 3 +; MAX-COST-NEXT: br label [[FOR_BODY:%.*]] +; MAX-COST: for.body: +; MAX-COST-NEXT: [[TMP17:%.*]] = phi i32 [ [[TMP34:%.*]], [[FOR_BODY]] ], [ 0, [[ENTRY:%.*]] ] +; MAX-COST-NEXT: [[TMP4:%.*]] = select <4 x i1> [[TMP3]], <4 x i32> , <4 x i32> +; MAX-COST-NEXT: [[TMP20:%.*]] = add i32 -5, undef +; MAX-COST-NEXT: [[TMP22:%.*]] = add i32 [[TMP20]], undef +; MAX-COST-NEXT: [[TMP24:%.*]] = add i32 [[TMP22]], undef +; MAX-COST-NEXT: [[TMP26:%.*]] = add i32 [[TMP24]], undef +; MAX-COST-NEXT: [[TMP27:%.*]] = select i1 [[TMP9]], i32 -720, i32 -80 +; MAX-COST-NEXT: [[TMP28:%.*]] = add i32 [[TMP26]], [[TMP27]] +; MAX-COST-NEXT: [[TMP29:%.*]] = select i1 [[TMP11]], i32 -720, i32 -80 +; MAX-COST-NEXT: [[TMP5:%.*]] = call i32 @llvm.experimental.vector.reduce.add.i32.v4i32(<4 x i32> [[TMP4]]) +; MAX-COST-NEXT: [[TMP6:%.*]] = add i32 [[TMP5]], [[TMP27]] +; MAX-COST-NEXT: [[TMP7:%.*]] = add i32 [[TMP6]], [[TMP29]] +; MAX-COST-NEXT: [[BIN_EXTRA:%.*]] = add i32 [[TMP7]], -5 +; MAX-COST-NEXT: [[TMP30:%.*]] = add i32 [[TMP28]], [[TMP29]] +; MAX-COST-NEXT: [[TMP31:%.*]] = select i1 [[TMP13]], i32 -720, i32 -80 +; MAX-COST-NEXT: [[TMP32:%.*]] = add i32 [[BIN_EXTRA]], [[TMP31]] +; MAX-COST-NEXT: [[TMP33:%.*]] = select i1 [[TMP15]], i32 -720, i32 -80 +; MAX-COST-NEXT: [[TMP34]] = add i32 [[TMP32]], [[TMP33]] +; MAX-COST-NEXT: br label [[FOR_BODY]] +; entry: %tmp0 = load i8, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @a, i64 0, i64 1), align 1 %tmp1 = icmp eq i8 %tmp0, 0 -- 2.11.0