brintos

brintos / llvm-project-archived public Read only

0
0
Text · 4.0 KiB · e4143a7 Raw
81 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py2; RUN: opt < %s -passes=slp-vectorizer,dce -S -mtriple=x86_64-apple-macosx10.8.0 -mcpu=corei7-avx | FileCheck %s3 4target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"5target triple = "x86_64-apple-macosx10.7.0"6 7@.str = private unnamed_addr constant [6 x i8] c"bingo\00", align 18 9; Uses inside the tree must be scheduled after the corresponding tree bundle.10define void @in_tree_user(ptr nocapture %A, i32 %n) {11; CHECK-LABEL: @in_tree_user(12; CHECK-NEXT:  entry:13; CHECK-NEXT:    [[CONV:%.*]] = sitofp i32 [[N:%.*]] to double14; CHECK-NEXT:    [[TMP0:%.*]] = insertelement <2 x double> poison, double [[CONV]], i32 015; CHECK-NEXT:    [[TMP1:%.*]] = shufflevector <2 x double> [[TMP0]], <2 x double> poison, <2 x i32> zeroinitializer16; CHECK-NEXT:    br label [[FOR_BODY:%.*]]17; CHECK:       for.body:18; CHECK-NEXT:    [[INDVARS_IV:%.*]] = phi i64 [ 0, [[ENTRY:%.*]] ], [ [[INDVARS_IV_NEXT:%.*]], [[FOR_INC:%.*]] ]19; CHECK-NEXT:    [[TMP2:%.*]] = shl nsw i64 [[INDVARS_IV]], 120; CHECK-NEXT:    [[ARRAYIDX:%.*]] = getelementptr inbounds double, ptr [[A:%.*]], i64 [[TMP2]]21; CHECK-NEXT:    [[TMP3:%.*]] = load <2 x double>, ptr [[ARRAYIDX]], align 822; CHECK-NEXT:    [[TMP4:%.*]] = fmul <2 x double> [[TMP1]], [[TMP3]]23; CHECK-NEXT:    [[TMP5:%.*]] = fmul <2 x double> [[TMP4]], <double 7.000000e+00, double 4.000000e+00>24; CHECK-NEXT:    [[TMP6:%.*]] = fadd <2 x double> [[TMP5]], <double 5.000000e+00, double 9.000000e+00>25; CHECK-NEXT:    [[TMP7:%.*]] = extractelement <2 x double> [[TMP6]], i32 026; CHECK-NEXT:    [[INTREEUSER:%.*]] = fadd double [[TMP7]], [[TMP7]]27; CHECK-NEXT:    [[TMP8:%.*]] = extractelement <2 x double> [[TMP6]], i32 128; CHECK-NEXT:    [[CMP11:%.*]] = fcmp ogt double [[TMP7]], [[TMP8]]29; CHECK-NEXT:    br i1 [[CMP11]], label [[IF_THEN:%.*]], label [[FOR_INC]]30; CHECK:       if.then:31; CHECK-NEXT:    [[CALL:%.*]] = tail call i32 (ptr, ...) @printf(ptr @.str)32; CHECK-NEXT:    br label [[FOR_INC]]33; CHECK:       for.inc:34; CHECK-NEXT:    [[INDVARS_IV_NEXT]] = add i64 [[INDVARS_IV]], 135; CHECK-NEXT:    [[LFTR_WIDEIV:%.*]] = trunc i64 [[INDVARS_IV_NEXT]] to i3236; CHECK-NEXT:    [[EXITCOND:%.*]] = icmp eq i32 [[LFTR_WIDEIV]], 10037; CHECK-NEXT:    br i1 [[EXITCOND]], label [[FOR_END:%.*]], label [[FOR_BODY]]38; CHECK:       for.end:39; CHECK-NEXT:    store double [[INTREEUSER]], ptr [[A]], align 840; CHECK-NEXT:    ret void41;42entry:43  %conv = sitofp i32 %n to double44  br label %for.body45 46for.body:                                         ; preds = %for.inc, %entry47  %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.inc ]48  %0 = shl nsw i64 %indvars.iv, 149  %arrayidx = getelementptr inbounds double, ptr %A, i64 %050  %1 = load double, ptr %arrayidx, align 851  %mul1 = fmul double %conv, %152  %mul2 = fmul double %mul1, 7.000000e+0053  %add = fadd double %mul2, 5.000000e+0054  %InTreeUser = fadd double %add, %add    ; <------------------ In tree user.55  %2 = or disjoint i64 %0, 156  %arrayidx6 = getelementptr inbounds double, ptr %A, i64 %257  %3 = load double, ptr %arrayidx6, align 858  %mul8 = fmul double %conv, %359  %mul9 = fmul double %mul8, 4.000000e+0060  %add10 = fadd double %mul9, 9.000000e+0061  %cmp11 = fcmp ogt double %add, %add1062  br i1 %cmp11, label %if.then, label %for.inc63 64if.then:                                          ; preds = %for.body65  %call = tail call i32 (ptr, ...) @printf(ptr @.str)66  br label %for.inc67 68for.inc:                                          ; preds = %for.body, %if.then69  %indvars.iv.next = add i64 %indvars.iv, 170  %lftr.wideiv = trunc i64 %indvars.iv.next to i3271  %exitcond = icmp eq i32 %lftr.wideiv, 10072  br i1 %exitcond, label %for.end, label %for.body73 74for.end:                                          ; preds = %for.inc75  store double %InTreeUser, ptr %A, align 8   ; Avoid dead code elimination of the InTreeUser.76  ret void77}78 79declare i32 @printf(ptr nocapture, ...)80 81