• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2; RUN: opt < %s -loop-sink -break-crit-edges -branch-prob -S -enable-new-pm=0 | FileCheck %s
3; RUN: opt < %s -loop-sink -break-crit-edges -lazy-block-freq -S -enable-new-pm=0 | FileCheck %s
4; RUN: opt < %s -loop-sink -break-crit-edges -lazy-branch-prob -S -enable-new-pm=0 | FileCheck %s
5
6; BreakCriticalEdges tries to update LI and DT if they are present. However,
7; updating LI actually needs a DT, so we now require DT in
8; BranchProbabilityInfo/LazyBlockFrequencyInfo/LazyBranchProbabilityInfo so it
9; is indeed available when LI is.
10
11target triple = "x86_64-unknown-linux-gnu"
12
13define void @f1() {
14; CHECK-LABEL: @f1(
15; CHECK-NEXT:  entry:
16; CHECK-NEXT:    br label [[FOR_COND:%.*]]
17; CHECK:       for.cond:
18; CHECK-NEXT:    br i1 false, label [[FOR_BODY:%.*]], label [[FOR_COND_FOR_END_CRIT_EDGE:%.*]]
19; CHECK:       for.cond.for.end_crit_edge:
20; CHECK-NEXT:    br label [[FOR_END:%.*]]
21; CHECK:       for.body:
22; CHECK-NEXT:    br i1 true, label [[FOR_ENDSPLIT:%.*]], label [[FOR_INC:%.*]]
23; CHECK:       for.inc:
24; CHECK-NEXT:    br label [[FOR_COND]]
25; CHECK:       for.endsplit:
26; CHECK-NEXT:    br label [[FOR_END]]
27; CHECK:       for.end:
28; CHECK-NEXT:    ret void
29;
30entry:
31  br label %for.cond
32
33for.cond:                                         ; preds = %for.inc, %entry
34  br i1 undef, label %for.body, label %for.end
35
36for.body:                                         ; preds = %for.cond
37  br i1 undef, label %for.end, label %for.inc
38
39for.inc:                                          ; preds = %for.body
40  br label %for.cond
41
42for.end:                                          ; preds = %for.body, %for.cond
43  ret void
44}
45