brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.6 KiB · 0eb87d0 Raw
41 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@n = global i32 10000, align 47@double_array = common global [10000 x double] zeroinitializer, align 168@unsigned_array = common global [10000 x i32] zeroinitializer, align 169 10; If we need to scalarize the fptoui and then use inserts to build up the11; vector again, then there is certainly no value in going 256-bit wide.12; CHECK-NOT: fptoui <2 x double>13 14define void @convert() {15entry:16  %0 = load i32, ptr @n, align 417  %cmp4 = icmp eq i32 %0, 018  br i1 %cmp4, label %for.end, label %for.body.preheader19 20for.body.preheader:                               ; preds = %entry21  br label %for.body22 23for.body:                                         ; preds = %for.body.preheader, %for.body24  %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.body.preheader ]25  %arrayidx = getelementptr inbounds [10000 x double], ptr @double_array, i64 0, i64 %indvars.iv26  %1 = load double, ptr %arrayidx, align 827  %conv = fptoui double %1 to i3228  %arrayidx2 = getelementptr inbounds [10000 x i32], ptr @unsigned_array, i64 0, i64 %indvars.iv29  store i32 %conv, ptr %arrayidx2, align 430  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 131  %2 = trunc i64 %indvars.iv.next to i3232  %cmp = icmp ult i32 %2, %033  br i1 %cmp, label %for.body, label %for.end.loopexit34 35for.end.loopexit:                                 ; preds = %for.body36  br label %for.end37 38for.end:                                          ; preds = %for.end.loopexit, %entry39  ret void40}41