File: preserve-loop-simplify.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 (65 lines) | stat: -rw-r--r-- 1,896 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
63
64
65
; RUN: opt -S -passes=loop-rotate < %s -verify-loop-info | FileCheck %s
;
; Verify that LoopRotate preserves LoopSimplify form even in very peculiar loop
; structures. We manually validate the CFG with FileCheck because currently we
; can't cause a failure when LoopSimplify fails to be preserved.

define void @PR18643(i1 %arg) {
; CHECK-LABEL: @PR18643(
entry:
  br label %outer.header
; CHECK: br label %outer.header

outer.header:
; CHECK: outer.header:
  br i1 %arg, label %inner.header, label %outer.body
; CHECK-NEXT: br i1 {{[^,]*}}, label %[[INNER_PREROTATE_PREHEADER:[^,]*]], label %outer.body

; CHECK: [[INNER_PREROTATE_PREHEADER]]:
; CHECK-NEXT: br i1 {{[^,]*}}, label %[[INNER_PREROTATE_PREHEADER_SPLIT_RETURN:[^,]*]], label %[[INNER_ROTATED_PREHEADER:[^,]*]]

; CHECK: [[INNER_ROTATED_PREHEADER]]:
; CHECK-NEXT: br label %inner.body

inner.header:
; Now the latch!
; CHECK: inner.header:
  br i1 %arg, label %return, label %inner.body
; CHECK-NEXT: br i1 {{[^,]*}}, label %[[INNER_SPLIT_RETURN:[^,]*]], label %inner.body

inner.body:
; Now the header!
; CHECK: inner.body:
  br i1 %arg, label %outer.latch, label %inner.latch
; CHECK-NEXT: br i1 {{[^,]*}}, label %[[INNER_SPLIT_OUTER_LATCH:[^,]*]], label %inner.header

inner.latch:
; Dead!
  br label %inner.header

outer.body:
; CHECK: outer.body:
  br label %outer.latch
; CHECK-NEXT: br label %outer.latch

; L2 -> L1 exit edge needs a simplified exit block.
; CHECK: [[INNER_SPLIT_OUTER_LATCH]]:
; CHECK-NEXT: br label %outer.latch

outer.latch:
; CHECK: outer.latch:
  br label %outer.header
; CHECK-NEXT: br label %outer.header

; L1 -> L0 exit edge need sa simplified exit block.
; CHECK: [[INNER_PREROTATE_PREHEADER_SPLIT_RETURN]]:
; CHECK-NEXT: br label %return

; L2 -> L0 exit edge needs a simplified exit block.
; CHECK: [[INNER_SPLIT_RETURN]]:
; CHECK-NEXT: br label %return

return:
; CHECK: return:
  unreachable
}