• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; Ensure we don't run analyses over loops after they've been deleted. We run
2; one version with a no-op loop pass to make sure that the loop doesn't get
3; simplified away.
4;
5; RUN: opt < %s -passes='require<iv-users>,no-op-loop,require<iv-users>' -S \
6; RUN:     | FileCheck %s --check-prefixes=CHECK,BEFORE
7; RUN: opt < %s -passes='require<iv-users>,loop-deletion,require<iv-users>' -S \
8; RUN:     | FileCheck %s --check-prefixes=CHECK,AFTER
9
10
11define void @foo(i64 %n, i64 %m) nounwind {
12; CHECK-LABEL: @foo(
13
14entry:
15  br label %bb
16; CHECK:       entry:
17; BEFORE-NEXT:   br label %bb
18; AFTER-NEXT:    br label %return
19
20bb:
21  %x.0 = phi i64 [ 0, %entry ], [ %t0, %bb2 ]
22  %t0 = add i64 %x.0, 1
23  %t1 = icmp slt i64 %x.0, %n
24  br i1 %t1, label %bb2, label %return
25; BEFORE:      bb:
26; BEFORE:        br i1 {{.*}}, label %bb2, label %return
27; AFTER-NOT:   bb:
28; AFTER-NOT:     br
29
30bb2:
31  %t2 = icmp slt i64 %x.0, %m
32  br i1 %t1, label %bb, label %return
33; BEFORE:      bb2:
34; BEFORE:        br i1 {{.*}}, label %bb, label %return
35; AFTER-NOT:   bb2:
36; AFTER-NOT:     br
37
38return:
39  ret void
40; CHECK:       return:
41; CHECK-NEXT:    ret void
42}
43