xref: /aosp_15_r20/external/llvm/test/Transforms/LoopVectorize/hints-trans.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1; RUN: opt -S -loop-vectorize -force-vector-interleave=1 -force-vector-width=4 -instsimplify -simplifycfg < %s | FileCheck %s
2; Note: -instsimplify -simplifycfg remove the (now dead) original loop, making
3; it easy to test that the llvm.loop.unroll.disable hint is still present.
4target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
5target triple = "x86_64-unknown-linux-gnu"
6
7; Function Attrs: norecurse nounwind uwtable
8define void @foo(i32* nocapture %b) #0 {
9entry:
10  br label %for.body
11
12for.cond.cleanup:                                 ; preds = %for.body
13  ret void
14
15for.body:                                         ; preds = %for.body, %entry
16  %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
17  %arrayidx = getelementptr inbounds i32, i32* %b, i64 %indvars.iv
18  store i32 1, i32* %arrayidx, align 4
19  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
20  %exitcond = icmp eq i64 %indvars.iv.next, 16
21  br i1 %exitcond, label %for.cond.cleanup, label %for.body, !llvm.loop !0
22}
23
24; CHECK-LABEL: @foo
25; CHECK: = !{!"llvm.loop.unroll.disable"}
26
27attributes #0 = { norecurse nounwind uwtable }
28
29!0 = distinct !{!0, !1}
30!1 = !{!"llvm.loop.unroll.disable"}
31