File: pr23608.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 (102 lines) | stat: -rw-r--r-- 5,136 bytes parent folder | download | duplicates (2)
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -S -passes=licm %s | FileCheck %s --check-prefix=NO_ASSUME
; RUN: opt -S -passes=licm --enable-knowledge-retention %s | FileCheck %s --check-prefix=USE_ASSUME
; ModuleID = '../pr23608.ll'
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.PyFrameObject = type { i32 }

@a = common global ptr null, align 8
@__msan_origin_tls = external thread_local(initialexec) global i32

define void @fn1() {
; NO_ASSUME-LABEL: @fn1(
; NO_ASSUME-NEXT:  entry:
; NO_ASSUME-NEXT:    br label [[INDIRECTGOTO:%.*]]
; NO_ASSUME:       while.cond:
; NO_ASSUME-NEXT:    [[TMP:%.*]] = load ptr, ptr @a, align 8
; NO_ASSUME-NEXT:    br label [[BB2:%.*]]
; NO_ASSUME:       bb:
; NO_ASSUME-NEXT:    call void @__msan_warning_noreturn()
; NO_ASSUME-NEXT:    unreachable
; NO_ASSUME:       bb2:
; NO_ASSUME-NEXT:    [[TMP4:%.*]] = ptrtoint ptr [[TMP]] to i64
; NO_ASSUME-NEXT:    [[TOBOOL:%.*]] = icmp eq i64 [[TMP4]], 0
; NO_ASSUME-NEXT:    br i1 [[TOBOOL]], label [[BB13:%.*]], label [[BB15:%.*]]
; NO_ASSUME:       bb13:
; NO_ASSUME-NEXT:    [[TMP4_LCSSA:%.*]] = phi i64 [ [[TMP4]], [[BB2]] ]
; NO_ASSUME-NEXT:    [[TMP8_LE:%.*]] = inttoptr i64 [[TMP4_LCSSA]] to ptr
; NO_ASSUME-NEXT:    call void @__msan_warning_noreturn()
; NO_ASSUME-NEXT:    unreachable
; NO_ASSUME:       bb15:
; NO_ASSUME-NEXT:    br i1 [[TOBOOL]], label [[WHILE_END:%.*]], label [[WHILE_COND:%.*]]
; NO_ASSUME:       while.end:
; NO_ASSUME-NEXT:    ret void
; NO_ASSUME:       indirectgoto:
; NO_ASSUME-NEXT:    indirectbr ptr null, [label [[INDIRECTGOTO]], label %while.cond]
;
; USE_ASSUME-LABEL: @fn1(
; USE_ASSUME-NEXT:  entry:
; USE_ASSUME-NEXT:    br label [[INDIRECTGOTO:%.*]]
; USE_ASSUME:       while.cond:
; USE_ASSUME-NEXT:    [[TMP:%.*]] = load ptr, ptr @a, align 8
; USE_ASSUME-NEXT:    call void @llvm.assume(i1 true) [ "dereferenceable"(ptr inttoptr (i64 and (i64 ptrtoint (ptr @a to i64), i64 -70368744177665) to ptr), i64 8), "nonnull"(ptr inttoptr (i64 and (i64 ptrtoint (ptr @a to i64), i64 -70368744177665) to ptr)), "align"(ptr inttoptr (i64 and (i64 ptrtoint (ptr @a to i64), i64 -70368744177665) to ptr), i64 8) ]
; USE_ASSUME-NEXT:    call void @llvm.assume(i1 true) [ "dereferenceable"(ptr inttoptr (i64 add (i64 and (i64 ptrtoint (ptr @a to i64), i64 -70368744177665), i64 35184372088832) to ptr), i64 4), "nonnull"(ptr inttoptr (i64 add (i64 and (i64 ptrtoint (ptr @a to i64), i64 -70368744177665), i64 35184372088832) to ptr)), "align"(ptr inttoptr (i64 add (i64 and (i64 ptrtoint (ptr @a to i64), i64 -70368744177665), i64 35184372088832) to ptr), i64 8) ]
; USE_ASSUME-NEXT:    br label [[BB2:%.*]]
; USE_ASSUME:       bb:
; USE_ASSUME-NEXT:    call void @__msan_warning_noreturn()
; USE_ASSUME-NEXT:    unreachable
; USE_ASSUME:       bb2:
; USE_ASSUME-NEXT:    call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[TMP]], i64 4), "nonnull"(ptr [[TMP]]), "align"(ptr [[TMP]], i64 4) ]
; USE_ASSUME-NEXT:    [[TMP4:%.*]] = ptrtoint ptr [[TMP]] to i64
; USE_ASSUME-NEXT:    [[TOBOOL:%.*]] = icmp eq i64 [[TMP4]], 0
; USE_ASSUME-NEXT:    br i1 [[TOBOOL]], label [[BB13:%.*]], label [[BB15:%.*]]
; USE_ASSUME:       bb13:
; USE_ASSUME-NEXT:    [[TMP4_LCSSA:%.*]] = phi i64 [ [[TMP4]], [[BB2]] ]
; USE_ASSUME-NEXT:    [[TMP8_LE:%.*]] = inttoptr i64 [[TMP4_LCSSA]] to ptr
; USE_ASSUME-NEXT:    call void @__msan_warning_noreturn()
; USE_ASSUME-NEXT:    unreachable
; USE_ASSUME:       bb15:
; USE_ASSUME-NEXT:    br i1 [[TOBOOL]], label [[WHILE_END:%.*]], label [[WHILE_COND:%.*]]
; USE_ASSUME:       while.end:
; USE_ASSUME-NEXT:    ret void
; USE_ASSUME:       indirectgoto:
; USE_ASSUME-NEXT:    indirectbr ptr null, [label [[INDIRECTGOTO]], label %while.cond]
;
entry:
  br label %indirectgoto

while.cond:                                       ; preds = %indirectgoto, %bb15
  %tmp = load ptr, ptr @a, align 8
  %_msld = load i64, ptr inttoptr (i64 and (i64 ptrtoint (ptr @a to i64), i64 -70368744177665) to ptr), align 8
  %tmp1 = load i32, ptr inttoptr (i64 add (i64 and (i64 ptrtoint (ptr @a to i64), i64 -70368744177665), i64 35184372088832) to ptr), align 8
  br label %bb2

bb:                                               ; preds = %while.cond
  call void @__msan_warning_noreturn()
  unreachable

bb2:                                              ; preds = %while.cond
  %tmp3 = load i32, ptr %tmp, align 4
  %tmp4 = ptrtoint ptr %tmp to i64
  %tmp8 = inttoptr i64 %tmp4 to ptr
  %tobool = icmp eq i64 %tmp4, 0
  br i1 %tobool, label %bb13, label %bb15

bb13:                                             ; preds = %bb2
  %.lcssa7 = phi ptr [ %tmp8, %bb2 ]
  call void @__msan_warning_noreturn()
  unreachable

bb15:                                             ; preds = %bb2
  br i1 %tobool, label %while.end, label %while.cond

while.end:                                        ; preds = %bb15
  ret void

indirectgoto:                                     ; preds = %indirectgoto, %entry
  indirectbr ptr null, [label %indirectgoto, label %while.cond]
}

declare void @__msan_warning_noreturn()