File: invariant.group.ll

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (69 lines) | stat: -rw-r--r-- 2,723 bytes parent folder | download | duplicates (12)
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
66
67
68
69
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -passes=licm < %s -S | FileCheck %s

define void @test(ptr %arg, ptr %arg1) {
; CHECK-LABEL: @test(
; CHECK-NEXT:  bb2:
; CHECK-NEXT:    [[TMP3:%.*]] = load i32, ptr [[ARG1:%.*]], align 4, !invariant.group !0
; CHECK-NEXT:    br label [[BB5:%.*]]
; CHECK:       bb5:
; CHECK-NEXT:    [[TMP6:%.*]] = phi i64 [ 0, [[BB2:%.*]] ], [ [[TMP10:%.*]], [[BB5]] ]
; CHECK-NEXT:    [[TMP7:%.*]] = getelementptr inbounds i32, ptr [[ARG:%.*]], i64 [[TMP6]]
; CHECK-NEXT:    store i32 [[TMP3]], ptr [[TMP7]], align 8
; CHECK-NEXT:    [[TMP10]] = add nuw nsw i64 [[TMP6]], 1
; CHECK-NEXT:    [[TMP11:%.*]] = icmp eq i64 [[TMP10]], 200
; CHECK-NEXT:    br i1 [[TMP11]], label [[BB12:%.*]], label [[BB5]]
; CHECK:       bb12:
; CHECK-NEXT:    ret void
;
bb2:                                              ; preds = %bb
  br label %bb5

bb5:                                              ; preds = %bb5, %bb2
  %tmp6 = phi i64 [ 0, %bb2 ], [ %tmp10, %bb5 ]
  %tmp3 = load i32, ptr %arg1, align 4, !invariant.group !0
  %tmp7 = getelementptr inbounds i32, ptr %arg, i64 %tmp6
  store i32 %tmp3, ptr %tmp7, align 8
  %tmp10 = add nuw nsw i64 %tmp6, 1
  %tmp11 = icmp eq i64 %tmp10, 200
  br i1 %tmp11, label %bb12, label %bb5

bb12:                                             ; preds = %bb5, %bb
  ret void
}


define void @test_fail(ptr %arg, ptr %arg1) {
; CHECK-LABEL: @test_fail(
; CHECK-NEXT:  bb2:
; CHECK-NEXT:    br label [[BB5:%.*]]
; CHECK:       bb5:
; CHECK-NEXT:    [[TMP6:%.*]] = phi i64 [ 0, [[BB2:%.*]] ], [ [[TMP10:%.*]], [[BB5]] ]
; CHECK-NEXT:    store i32 3, ptr [[ARG1:%.*]], align 4
; CHECK-NEXT:    [[TMP3:%.*]] = load i32, ptr [[ARG1]], align 4, !invariant.group !0
; CHECK-NEXT:    [[TMP7:%.*]] = getelementptr inbounds i32, ptr [[ARG:%.*]], i64 [[TMP6]]
; CHECK-NEXT:    store i32 [[TMP3]], ptr [[TMP7]], align 8
; CHECK-NEXT:    [[TMP10]] = add nuw nsw i64 [[TMP6]], 1
; CHECK-NEXT:    [[TMP11:%.*]] = icmp eq i64 [[TMP10]], 200
; CHECK-NEXT:    br i1 [[TMP11]], label [[BB12:%.*]], label [[BB5]]
; CHECK:       bb12:
; CHECK-NEXT:    ret void
;
bb2:                                              ; preds = %bb
  br label %bb5

bb5:                                              ; preds = %bb5, %bb2
  %tmp6 = phi i64 [ 0, %bb2 ], [ %tmp10, %bb5 ]
  store i32 3, ptr %arg1
  %tmp3 = load i32, ptr %arg1, align 4, !invariant.group !0
  %tmp7 = getelementptr inbounds i32, ptr %arg, i64 %tmp6
  store i32 %tmp3, ptr %tmp7, align 8
  %tmp10 = add nuw nsw i64 %tmp6, 1
  %tmp11 = icmp eq i64 %tmp10, 200
  br i1 %tmp11, label %bb12, label %bb5

bb12:                                             ; preds = %bb5, %bb
  ret void
}

!0 = !{}