• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt -verify-loop-info -irce-print-changed-loops -irce < %s 2>&1 | FileCheck %s
2
3; CHECK-NOT: constrained Loop
4
5define void @multiple_access_no_preloop(
6    i32* %arr_a, i32* %a_len_ptr, i32* %arr_b, i32* %b_len_ptr, i32 %n) {
7
8 entry:
9  %len.a = load i32, i32* %a_len_ptr, !range !0
10  %len.b = load i32, i32* %b_len_ptr, !range !0
11  %first.itr.check = icmp sgt i32 %n, 0
12  br i1 %first.itr.check, label %loop, label %exit
13
14 loop:
15  %idx = phi i32 [ 0, %entry ] , [ %idx.next, %in.bounds.b ]
16  %idx.next = add i32 %idx, 1
17  %abc.a = icmp slt i32 %idx, %len.a
18  br i1 %abc.a, label %in.bounds.a, label %out.of.bounds, !prof !1
19
20 in.bounds.a:
21  %addr.a = getelementptr i32, i32* %arr_a, i32 %idx
22  store i32 0, i32* %addr.a
23  %abc.b = icmp slt i32 %idx, %len.b
24  br i1 %abc.b, label %in.bounds.b, label %out.of.bounds, !prof !1
25
26 in.bounds.b:
27  %addr.b = getelementptr i32, i32* %arr_b, i32 %idx
28  store i32 -1, i32* %addr.b
29  %next = icmp slt i32 %idx.next, %n
30  br i1 %next, label %loop, label %exit
31
32 out.of.bounds:
33  ret void
34
35 exit:
36  ret void
37}
38
39!0 = !{i32 0, i32 2147483647}
40!1 = !{!"branch_weights", i32 1, i32 1}