File: pr114879.ll

package info (click to toggle)
llvm-toolchain-20 1%3A20.1.6-1~exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,111,304 kB
  • sloc: cpp: 7,438,677; ansic: 1,393,822; asm: 1,012,926; python: 241,650; f90: 86,635; objc: 75,479; lisp: 42,144; pascal: 17,286; sh: 10,027; ml: 5,082; perl: 4,730; awk: 3,523; makefile: 3,349; javascript: 2,251; xml: 892; fortran: 672
file content (62 lines) | stat: -rw-r--r-- 2,548 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt -S -passes=loop-unroll-full -unroll-full-max-count=1 %s | FileCheck %s

@GlobIntONE = global i32 0, align 4

; Make sure we don't reuse the phi (undef, X) for X.

define ptr @test() {
; CHECK-LABEL: define ptr @test() {
; CHECK-NEXT:  [[ENTRY:.*:]]
; CHECK-NEXT:    br label %[[FOR_BODY_PEEL_BEGIN:.*]]
; CHECK:       [[FOR_BODY_PEEL_BEGIN]]:
; CHECK-NEXT:    br label %[[FOR_BODY_PEEL:.*]]
; CHECK:       [[FOR_BODY_PEEL]]:
; CHECK-NEXT:    br i1 true, label %[[CLEANUP_PEEL:.*]], label %[[CLEANUP_LOOPEXIT_PEEL:.*]]
; CHECK:       [[CLEANUP_LOOPEXIT_PEEL]]:
; CHECK-NEXT:    br label %[[CLEANUP_PEEL]]
; CHECK:       [[CLEANUP_PEEL]]:
; CHECK-NEXT:    [[RETVAL_2_PEEL:%.*]] = phi ptr [ undef, %[[FOR_BODY_PEEL]] ], [ @GlobIntONE, %[[CLEANUP_LOOPEXIT_PEEL]] ]
; CHECK-NEXT:    br i1 true, label %[[FOR_BODY_PEEL_NEXT:.*]], label %[[CLEANUP2:.*]]
; CHECK:       [[FOR_BODY_PEEL_NEXT]]:
; CHECK-NEXT:    br label %[[FOR_BODY_PEEL_NEXT1:.*]]
; CHECK:       [[FOR_BODY_PEEL_NEXT1]]:
; CHECK-NEXT:    br label %[[ENTRY_PEEL_NEWPH:.*]]
; CHECK:       [[ENTRY_PEEL_NEWPH]]:
; CHECK-NEXT:    br label %[[FOR_BODY:.*]]
; CHECK:       [[FOR_BODY]]:
; CHECK-NEXT:    br i1 false, label %[[CLEANUP:.*]], label %[[CLEANUP_LOOPEXIT:.*]]
; CHECK:       [[CLEANUP_LOOPEXIT]]:
; CHECK-NEXT:    br label %[[CLEANUP]]
; CHECK:       [[CLEANUP]]:
; CHECK-NEXT:    br i1 false, label %[[FOR_BODY]], label %[[CLEANUP2_LOOPEXIT:.*]], !llvm.loop [[LOOP0:![0-9]+]]
; CHECK:       [[CLEANUP2_LOOPEXIT]]:
; CHECK-NEXT:    [[RETVAL_2_LCSSA_PH:%.*]] = phi ptr [ @GlobIntONE, %[[CLEANUP]] ]
; CHECK-NEXT:    br label %[[CLEANUP2]]
; CHECK:       [[CLEANUP2]]:
; CHECK-NEXT:    [[RETVAL_2_LCSSA:%.*]] = phi ptr [ [[RETVAL_2_PEEL]], %[[CLEANUP_PEEL]] ], [ [[RETVAL_2_LCSSA_PH]], %[[CLEANUP2_LOOPEXIT]] ]
; CHECK-NEXT:    ret ptr [[RETVAL_2_LCSSA]]
;
entry:
  br label %for.body

for.body:
  %retval.0 = phi ptr [ undef, %entry ], [ %retval.2, %cleanup ]
  %cmp1.not = phi i1 [ true, %entry ], [ false, %cleanup ]
  br i1 %cmp1.not, label %cleanup, label %cleanup.loopexit

cleanup.loopexit:
  br label %cleanup

cleanup:
  %retval.2 = phi ptr [ %retval.0, %for.body ], [ @GlobIntONE, %cleanup.loopexit ]
  br i1 %cmp1.not, label %for.body, label %cleanup2

cleanup2:
  %retval.2.lcssa = phi ptr [ %retval.2, %cleanup ]
  ret ptr %retval.2.lcssa
}
;.
; CHECK: [[LOOP0]] = distinct !{[[LOOP0]], [[META1:![0-9]+]]}
; CHECK: [[META1]] = !{!"llvm.loop.peeled.count", i32 1}
;.