brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.5 KiB · 15533b2 Raw
40 lines · plain
1; RUN: opt < %s -mcpu=core-avx2 -passes=loop-vectorize -S | FileCheck %s2 3target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"4target triple = "x86_64-apple-macosx"5 6@float_array = common global [10000 x float] zeroinitializer, align 167@unsigned_array = common global [10000 x i32] zeroinitializer, align 168 9; If we need to scalarize the fptoui and then use inserts to build up the10; vector again, then there is certainly no value in going 256-bit wide.11; CHECK-NOT: fptoui <4 x float>12 13define void @convert(i32 %N) {14entry:15  %0 = icmp eq i32 %N, 016  br i1 %0, label %for.end, label %for.body.preheader17 18for.body.preheader:                               ; preds = %entry19  br label %for.body20 21for.body:                                         ; preds = %for.body.preheader, %for.body22  %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.body.preheader ]23  %arrayidx = getelementptr inbounds [10000 x float], ptr @float_array, i64 0, i64 %indvars.iv24  %1 = load float, ptr %arrayidx, align 425  %conv = fptoui float %1 to i3226  %arrayidx2 = getelementptr inbounds [10000 x i32], ptr @unsigned_array, i64 0, i64 %indvars.iv27  store i32 %conv, ptr %arrayidx2, align 428  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 129  %lftr.wideiv = trunc i64 %indvars.iv.next to i3230  %exitcond = icmp eq i32 %lftr.wideiv, %N31  br i1 %exitcond, label %for.end.loopexit, label %for.body32 33for.end.loopexit:                                 ; preds = %for.body34  br label %for.end35 36for.end:                                          ; preds = %for.end.loopexit, %entry37  ret void38}39 40