1 ; RUN: opt -S -mtriple=amdgcn-unknown-amdhsa -mcpu=fiji -loop-vectorize < %s | FileCheck %s
4 ; For AMDGPU, loop unroll in loop vectorizer is disabled when VF==1.
6 ; CHECK-LABEL: @small_loop(
10 define amdgpu_kernel void @small_loop(i32* nocapture %inArray, i32 %size) nounwind {
12 %0 = icmp sgt i32 %size, 0
13 br i1 %0, label %loop, label %exit
15 loop: ; preds = %entry, %loop
16 %iv = phi i32 [ %iv1, %loop ], [ 0, %entry ]
17 %1 = getelementptr inbounds i32, i32* %inArray, i32 %iv
18 %2 = load i32, i32* %1, align 4
19 %3 = add nsw i32 %2, 6
20 store i32 %3, i32* %1, align 4
22 ; %lftr.wideiv = trunc i64 %indvars.iv.next to i32
23 %cond = icmp eq i32 %iv1, %size
24 br i1 %cond, label %exit, label %loop
26 exit: ; preds = %loop, %entry