brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · a788306 Raw
40 lines · plain
1; RUN: opt -S -passes=loop-vectorize -force-vector-width=2 -force-vector-interleave=1 -mcpu=prescott < %s | FileCheck %s2 3target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32-S128"4target triple = "i386-unknown-freebsd11.0"5 6@big = external global [0 x i32]7 8; PR180499; We need to truncate the exit count to i32. This is legal because the10; arithmetic is signed (%inc is nsw).11 12; CHECK-LABEL: tripcount13; CHECK: trunc i64 %count to i3214 15define void @tripcount(i64 %count) {16entry:17  %cmp6 = icmp sgt i64 %count, 018  br i1 %cmp6, label %for.body.preheader, label %for.end19 20for.body.preheader:21  br label %for.body22 23for.body:24  %i.07 = phi i32 [ %inc, %for.body ], [ 0, %for.body.preheader ]25  %arrayidx = getelementptr inbounds [0 x i32], ptr @big, i32 0, i32 %i.0726  %0 = load i32, ptr %arrayidx, align 427  %neg = xor i32 %0, -128  store i32 %neg, ptr %arrayidx, align 429  %inc = add nsw i32 %i.07, 130  %conv = sext i32 %inc to i6431  %cmp = icmp slt i64 %conv, %count32  br i1 %cmp, label %for.body, label %for.end.loopexit33 34for.end.loopexit:35  br label %for.end36 37for.end:38  ret void39}40