File: cgscc_bugs.ll

package info (click to toggle)
llvm-toolchain-14 1%3A14.0.6-12
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,496,180 kB
  • sloc: cpp: 5,593,972; ansic: 986,872; asm: 585,869; python: 184,223; objc: 72,530; lisp: 31,119; f90: 27,793; javascript: 9,780; pascal: 9,762; sh: 9,482; perl: 7,468; ml: 5,432; awk: 3,523; makefile: 2,538; xml: 953; cs: 573; fortran: 567
file content (106 lines) | stat: -rw-r--r-- 4,167 bytes parent folder | download | duplicates (4)
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
103
104
105
106
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals
; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal  -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=2 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM
; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal  -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=2 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM
; RUN: opt -attributor-cgscc -enable-new-pm=0 -attributor-manifest-internal  -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_NPM,IS__CGSCC____,IS________OPM,IS__CGSCC_OPM
; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal  -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_OPM,IS__CGSCC____,IS________NPM,IS__CGSCC_NPM

target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"

%0 = type { i32, %1, %2* }
%1 = type { i32 }
%2 = type opaque

define hidden %0* @f1(i64 %0, i64 %1) {
; CHECK-LABEL: define {{[^@]+}}@f1
; CHECK-SAME: (i64 [[TMP0:%.*]], i64 [[TMP1:%.*]]) {
; CHECK-NEXT:    [[TMP3:%.*]] = call { %0*, i64 } @f3(i64 [[TMP0]])
; CHECK-NEXT:    ret %0* undef
;
  %3 = call { %0*, i64 } @f3(i64 %0)
  ret %0* undef
}

define linkonce_odr hidden { %0*, i64 } @f3(i64 %0) align 2 {
; CHECK-LABEL: define {{[^@]+}}@f3
; CHECK-SAME: (i64 [[TMP0:%.*]]) align 2 {
; CHECK-NEXT:    [[TMP2:%.*]] = call i32 @f4()
; CHECK-NEXT:    [[TMP3:%.*]] = zext i32 [[TMP2]] to i64
; CHECK-NEXT:    call void @f5(i64 [[TMP3]], i64 [[TMP0]]) #[[ATTR0:[0-9]+]]
; CHECK-NEXT:    ret { %0*, i64 } undef
;
  %2 = call i32 @f4()
  %3 = zext i32 %2 to i64
  call void @f5(i64 %3, i64 %0)
  ret { %0*, i64 } undef
}

define linkonce_odr hidden i32 @f4() align 2 {
; CHECK-LABEL: define {{[^@]+}}@f4() align 2 {
; CHECK-NEXT:    ret i32 16
;
  ret i32 16
}

define internal void @f5(i64 %0, i64 %1) {
; CHECK: Function Attrs: nounwind
; CHECK-LABEL: define {{[^@]+}}@f5
; CHECK-SAME: (i64 [[TMP0:%.*]], i64 [[TMP1:%.*]]) #[[ATTR0]] {
; CHECK-NEXT:    br label [[TMP3:%.*]]
; CHECK:       3:
; CHECK-NEXT:    call void @f6(i64 [[TMP0]]) #[[ATTR0]]
; CHECK-NEXT:    [[TMP4:%.*]] = icmp sgt i64 [[TMP1]], [[TMP0]]
; CHECK-NEXT:    br i1 [[TMP4]], label [[TMP5:%.*]], label [[TMP6:%.*]]
; CHECK:       5:
; CHECK-NEXT:    ret void
; CHECK:       6:
; CHECK-NEXT:    call void @f5(i64 [[TMP0]], i64 [[TMP1]]) #[[ATTR0]]
; CHECK-NEXT:    br label [[TMP3]]
;
  br label %3

3:                                                ; preds = %6, %2
  call void @f6(i64 %0)
  %4 = icmp sgt i64 %1, %0
  br i1 %4, label %5, label %6

5:                                                ; preds = %3
  ret void

6:                                                ; preds = %3
  call void @f5(i64 %0, i64 %1)
  br label %3
}

define internal void @f6(i64 %0) {
; CHECK: Function Attrs: nounwind
; CHECK-LABEL: define {{[^@]+}}@f6
; CHECK-SAME: (i64 [[TMP0:%.*]]) #[[ATTR0]] {
; CHECK-NEXT:    [[TMP2:%.*]] = icmp sgt i64 [[TMP0]], 0
; CHECK-NEXT:    br i1 [[TMP2]], label [[TMP3:%.*]], label [[TMP4:%.*]]
; CHECK:       3:
; CHECK-NEXT:    call void @llvm.trap() #[[ATTR2:[0-9]+]]
; CHECK-NEXT:    unreachable
; CHECK:       4:
; CHECK-NEXT:    ret void
;
  %2 = icmp sgt i64 %0, 0
  br i1 %2, label %3, label %4

3:                                                ; preds = %1
  call void @llvm.trap()
  ret void

4:                                                ; preds = %1
  ret void
}

; Function Attrs: cold noreturn nounwind
declare void @llvm.trap() #0

attributes #0 = { cold noreturn nounwind }

;.
; CHECK: attributes #[[ATTR0]] = { nounwind }
; CHECK: attributes #[[ATTR1:[0-9]+]] = { cold noreturn nounwind }
; CHECK: attributes #[[ATTR2]] = { noreturn }
;.