1*cee313d2SEric Christopher; Legacy pass manager
2*cee313d2SEric Christopher; RUN: opt -transform-warning -disable-output -pass-remarks-missed=transform-warning -pass-remarks-analysis=transform-warning < %s 2>&1 | FileCheck -allow-empty %s
3*cee313d2SEric Christopher;
4*cee313d2SEric Christopher; New pass manager
5*cee313d2SEric Christopher; RUN: opt -passes=transform-warning -disable-output -pass-remarks-missed=transform-warning -pass-remarks-analysis=transform-warning < %s 2>&1 | FileCheck -allow-empty %s
6*cee313d2SEric Christopher;
7*cee313d2SEric Christopher; Verify that no transformation warnings are emitted for functions with
8*cee313d2SEric Christopher; 'optnone' attribute.
9*cee313d2SEric Christopher;
10*cee313d2SEric Christophertarget datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
11*cee313d2SEric Christopher
12*cee313d2SEric Christopherdefine void @func(i32* nocapture %A, i32* nocapture readonly %B, i32 %Length) #0 {
13*cee313d2SEric Christopherentry:
14*cee313d2SEric Christopher  %cmp9 = icmp sgt i32 %Length, 0
15*cee313d2SEric Christopher  br i1 %cmp9, label %for.body.preheader, label %for.end
16*cee313d2SEric Christopher
17*cee313d2SEric Christopherfor.body.preheader:
18*cee313d2SEric Christopher  br label %for.body
19*cee313d2SEric Christopher
20*cee313d2SEric Christopherfor.body:
21*cee313d2SEric Christopher  %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.body.preheader ]
22*cee313d2SEric Christopher  %arrayidx = getelementptr inbounds i32, i32* %B, i64 %indvars.iv
23*cee313d2SEric Christopher  %0 = load i32, i32* %arrayidx, align 4
24*cee313d2SEric Christopher  %idxprom1 = sext i32 %0 to i64
25*cee313d2SEric Christopher  %arrayidx2 = getelementptr inbounds i32, i32* %A, i64 %idxprom1
26*cee313d2SEric Christopher  %1 = load i32, i32* %arrayidx2, align 4
27*cee313d2SEric Christopher  %arrayidx4 = getelementptr inbounds i32, i32* %A, i64 %indvars.iv
28*cee313d2SEric Christopher  store i32 %1, i32* %arrayidx4, align 4
29*cee313d2SEric Christopher  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
30*cee313d2SEric Christopher  %lftr.wideiv = trunc i64 %indvars.iv.next to i32
31*cee313d2SEric Christopher  %exitcond = icmp eq i32 %lftr.wideiv, %Length
32*cee313d2SEric Christopher  br i1 %exitcond, label %for.end.loopexit, label %for.body, !llvm.loop !0
33*cee313d2SEric Christopher
34*cee313d2SEric Christopherfor.end.loopexit:
35*cee313d2SEric Christopher  br label %for.end
36*cee313d2SEric Christopher
37*cee313d2SEric Christopherfor.end:
38*cee313d2SEric Christopher  ret void
39*cee313d2SEric Christopher}
40*cee313d2SEric Christopher
41*cee313d2SEric Christopherattributes #0 = { noinline optnone }
42*cee313d2SEric Christopher
43*cee313d2SEric Christopher!0 = distinct !{!0, !1, !2, !3}
44*cee313d2SEric Christopher!1 = !{!"llvm.loop.unroll.enable"}
45*cee313d2SEric Christopher!2 = !{!"llvm.loop.distribute.enable"}
46*cee313d2SEric Christopher!3 = !{!"llvm.loop.unroll_and_jam.enable"}
47*cee313d2SEric Christopher!4 = !{!"llvm.loop.vectorize.enable", i1 true}
48*cee313d2SEric Christopher
49*cee313d2SEric Christopher
50*cee313d2SEric Christopher; CHECK-NOT: warning
51