• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; LoopInfo is incorrectly calculating loop nesting!  In this case it doesn't
2; figure out that loop "Inner" should be nested inside of leep "LoopHeader",
3; and instead nests it just inside loop "Top"
4;
5; RUN: opt < %s -analyze -loops -enable-new-pm=0 | FileCheck %s
6; RUN: opt < %s -passes='print<loops>' -disable-output 2>&1 | FileCheck %s
7
8; CHECK:  Loop at depth 3 containing: %Inner<header><latch><exiting>
9define void @test() {
10        br label %Top
11
12Top:            ; preds = %Out, %0
13        br label %LoopHeader
14
15Next:           ; preds = %LoopHeader
16        br i1 false, label %Inner, label %Out
17
18Inner:          ; preds = %Inner, %Next
19        br i1 false, label %Inner, label %LoopHeader
20
21LoopHeader:             ; preds = %Inner, %Top
22        br label %Next
23
24Out:            ; preds = %Next
25        br i1 false, label %Top, label %Done
26
27Done:           ; preds = %Out
28        ret void
29}
30
31