88 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 62; RUN: opt < %s -passes=slp-vectorizer -S -mtriple=x86_64-apple-macosx10.8.0 -mcpu=corei7 | FileCheck %s3 4target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"5target triple = "x86_64-apple-darwin13.3.0"6 7define void @_foo(double %p1, double %p2, double %p3) #0 {8; CHECK-LABEL: define void @_foo(9; CHECK-SAME: double [[P1:%.*]], double [[P2:%.*]], double [[P3:%.*]]) #[[ATTR0:[0-9]+]] {10; CHECK-NEXT: [[ENTRY:.*:]]11; CHECK-NEXT: [[TAB1:%.*]] = alloca [256 x i32], align 1612; CHECK-NEXT: [[TAB2:%.*]] = alloca [256 x i32], align 1613; CHECK-NEXT: br label %[[BB1:.*]]14; CHECK: [[BB1]]:15; CHECK-NEXT: [[MUL20:%.*]] = fmul double [[P3]], 1.638400e+0416; CHECK-NEXT: [[ADD:%.*]] = fadd double [[MUL20]], 8.192000e+0317; CHECK-NEXT: [[TMP0:%.*]] = insertelement <2 x double> poison, double [[P2]], i32 018; CHECK-NEXT: [[TMP1:%.*]] = insertelement <2 x double> [[TMP0]], double [[P1]], i32 119; CHECK-NEXT: [[TMP2:%.*]] = fmul <2 x double> [[TMP1]], splat (double 1.638400e+04)20; CHECK-NEXT: [[TMP3:%.*]] = insertelement <2 x double> <double poison, double 0.000000e+00>, double [[ADD]], i32 021; CHECK-NEXT: br label %[[FOR_BODY:.*]]22; CHECK: [[FOR_BODY]]:23; CHECK-NEXT: [[INDVARS_IV266:%.*]] = phi i64 [ 0, %[[BB1]] ], [ [[INDVARS_IV_NEXT267:%.*]], %[[FOR_BODY]] ]24; CHECK-NEXT: [[TMP4:%.*]] = phi <2 x double> [ [[TMP3]], %[[BB1]] ], [ [[TMP6:%.*]], %[[FOR_BODY]] ]25; CHECK-NEXT: [[TMP5:%.*]] = shufflevector <2 x double> [[TMP4]], <2 x double> poison, <2 x i32> <i32 1, i32 poison>26; CHECK-NEXT: [[X13:%.*]] = tail call i32 @_xfn(<2 x double> [[TMP5]])27; CHECK-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [256 x i32], ptr [[TAB1]], i64 0, i64 [[INDVARS_IV266]]28; CHECK-NEXT: store i32 [[X13]], ptr [[ARRAYIDX]], align 4, !tbaa [[INT_TBAA0:![0-9]+]]29; CHECK-NEXT: [[X14:%.*]] = tail call i32 @_xfn(<2 x double> [[TMP4]])30; CHECK-NEXT: [[ARRAYIDX26:%.*]] = getelementptr inbounds [256 x i32], ptr [[TAB2]], i64 0, i64 [[INDVARS_IV266]]31; CHECK-NEXT: store i32 [[X14]], ptr [[ARRAYIDX26]], align 4, !tbaa [[INT_TBAA0]]32; CHECK-NEXT: [[TMP6]] = fadd <2 x double> [[TMP2]], [[TMP4]]33; CHECK-NEXT: [[INDVARS_IV_NEXT267]] = add nuw nsw i64 [[INDVARS_IV266]], 134; CHECK-NEXT: [[EXITCOND:%.*]] = icmp eq i64 [[INDVARS_IV_NEXT267]], 25635; CHECK-NEXT: br i1 [[EXITCOND]], label %[[RETURN:.*]], label %[[FOR_BODY]]36; CHECK: [[RETURN]]:37; CHECK-NEXT: ret void38;39entry:40 %tab1 = alloca [256 x i32], align 1641 %tab2 = alloca [256 x i32], align 1642 br label %bb143 44 45bb1:46 %mul19 = fmul double %p1, 1.638400e+0447 %mul20 = fmul double %p3, 1.638400e+0448 %add = fadd double %mul20, 8.192000e+0349 %mul21 = fmul double %p2, 1.638400e+0450 ; The SLPVectorizer crashed when scheduling this block after it inserted an51 ; insertelement instruction (during vectorizing the for.body block) at this position.52 br label %for.body53 54for.body:55 %indvars.iv266 = phi i64 [ 0, %bb1 ], [ %indvars.iv.next267, %for.body ]56 %t.0259 = phi double [ 0.000000e+00, %bb1 ], [ %add27, %for.body ]57 %p3.addr.0258 = phi double [ %add, %bb1 ], [ %add28, %for.body ]58 %vecinit.i.i237 = insertelement <2 x double> undef, double %t.0259, i32 059 %x13 = tail call i32 @_xfn(<2 x double> %vecinit.i.i237) #260 %arrayidx = getelementptr inbounds [256 x i32], ptr %tab1, i64 0, i64 %indvars.iv26661 store i32 %x13, ptr %arrayidx, align 4, !tbaa !462 %vecinit.i.i = insertelement <2 x double> undef, double %p3.addr.0258, i32 063 %x14 = tail call i32 @_xfn(<2 x double> %vecinit.i.i) #264 %arrayidx26 = getelementptr inbounds [256 x i32], ptr %tab2, i64 0, i64 %indvars.iv26665 store i32 %x14, ptr %arrayidx26, align 4, !tbaa !466 %add27 = fadd double %mul19, %t.025967 %add28 = fadd double %mul21, %p3.addr.025868 %indvars.iv.next267 = add nuw nsw i64 %indvars.iv266, 169 %exitcond = icmp eq i64 %indvars.iv.next267, 25670 br i1 %exitcond, label %return, label %for.body71 72return:73 ret void74}75 76declare i32 @_xfn(<2 x double>) #477 78!3 = !{!"int", !5, i64 0}79!4 = !{!3, !3, i64 0}80!5 = !{!"omnipotent char", !6, i64 0}81!6 = !{!"Simple C/C++ TBAA"}82;.83; CHECK: [[INT_TBAA0]] = !{[[META1:![0-9]+]], [[META1]], i64 0}84; CHECK: [[META1]] = !{!"int", [[META2:![0-9]+]], i64 0}85; CHECK: [[META2]] = !{!"omnipotent char", [[META3:![0-9]+]], i64 0}86; CHECK: [[META3]] = !{!"Simple C/C++ TBAA"}87;.88