brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · 94e7549 Raw
38 lines · plain
1; This test makes sure that loop will not be unrolled in vectorization if VF computed2; equals to 1.3; RUN: opt < %s -passes=loop-vectorize -S | FileCheck %s4 5; Make sure there are no geps being merged.6; CHECK-LABEL: @foo(7; CHECK: getelementptr8; CHECK-NOT: getelementptr9 10@N = common global i32 0, align 411@a = common global [1000 x i32] zeroinitializer, align 1612 13define void @foo() #0 {14entry:15  %0 = load i32, ptr @N, align 416  %cmp5 = icmp sgt i32 %0, 017  br i1 %cmp5, label %for.body.lr.ph, label %for.end18 19for.body.lr.ph:                                   ; preds = %entry20  %conv = sext i32 %0 to i6421  br label %for.body22 23for.body:                                         ; preds = %for.body.lr.ph, %for.body24  %i.06 = phi i64 [ 0, %for.body.lr.ph ], [ %inc, %for.body ]25  %mul = mul nuw nsw i64 %i.06, 726  %arrayidx = getelementptr inbounds [1000 x i32], ptr @a, i64 0, i64 %mul27  store i32 3, ptr %arrayidx, align 428  %inc = add nuw nsw i64 %i.06, 129  %cmp = icmp slt i64 %inc, %conv30  br i1 %cmp, label %for.body, label %for.end.loopexit31 32for.end.loopexit:                                 ; preds = %for.body33  br label %for.end34 35for.end:                                          ; preds = %for.end.loopexit, %entry36  ret void37}38