xref: /llvm-project/llvm/test/Transforms/OpenMP/dead_use.ll (revision aa8e9fac2a14bc7f0eb9aac20994d0c310d1ae92)
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature
2; RUN: opt -S -passes=openmp-opt-cgscc < %s | FileCheck %s
3%struct.ident_t = type { i32, i32, i32, i32, ptr }
4
5@.str = private unnamed_addr constant [23 x i8] c";unknown;unknown;0;0;;\00", align 1
6@0 = private unnamed_addr global %struct.ident_t { i32 0, i32 2, i32 0, i32 0, ptr @.str }, align 8
7
8; Function Attrs: nounwind uwtable
9define dso_local i32 @b() #0 {
10; CHECK-LABEL: define {{[^@]+}}@b
11; CHECK-SAME: () #[[ATTR0:[0-9]+]] {
12; CHECK-NEXT:    [[TMP1:%.*]] = alloca i32, align 4
13; CHECK-NEXT:    [[TMP2:%.*]] = call i32 @a()
14; CHECK-NEXT:    [[TMP3:%.*]] = load i32, ptr [[TMP1]], align 4
15; CHECK-NEXT:    ret i32 [[TMP3]]
16;
17  %1 = alloca i32, align 4
18  %2 = call i32 @a()
19  %3 = load i32, ptr %1, align 4
20  ret i32 %3
21}
22
23; Function Attrs: nounwind uwtable
24define internal i32 @a() #0 {
25; CHECK-LABEL: define {{[^@]+}}@a
26; CHECK-SAME: () #[[ATTR0]] {
27; CHECK-NEXT:    [[TMP1:%.*]] = alloca i32, align 4
28; CHECK-NEXT:    [[TMP2:%.*]] = call i32 @b()
29; CHECK-NEXT:    call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB0:[0-9]+]], i32 0, ptr @.omp_outlined.)
30; CHECK-NEXT:    [[TMP3:%.*]] = load i32, ptr [[TMP1]], align 4
31; CHECK-NEXT:    ret i32 [[TMP3]]
32;
33  %1 = alloca i32, align 4
34  %2 = call i32 @b()
35  call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @0, i32 0, ptr @.omp_outlined.)
36  %3 = load i32, ptr %1, align 4
37  ret i32 %3
38}
39
40; Function Attrs: norecurse nounwind uwtable
41define internal void @.omp_outlined.(ptr noalias %0, ptr noalias %1) #1 {
42; CHECK-LABEL: define {{[^@]+}}@.omp_outlined.
43; CHECK-SAME: (ptr noalias [[TMP0:%.*]], ptr noalias [[TMP1:%.*]]) #[[ATTR1:[0-9]+]] {
44; CHECK-NEXT:    [[TMP3:%.*]] = alloca ptr, align 8
45; CHECK-NEXT:    [[TMP4:%.*]] = alloca ptr, align 8
46; CHECK-NEXT:    store ptr [[TMP0]], ptr [[TMP3]], align 8, !tbaa [[TBAA2:![0-9]+]]
47; CHECK-NEXT:    store ptr [[TMP1]], ptr [[TMP4]], align 8, !tbaa [[TBAA2]]
48; CHECK-NEXT:    ret void
49;
50  %3 = alloca ptr, align 8
51  %4 = alloca ptr, align 8
52  store ptr %0, ptr %3, align 8, !tbaa !2
53  store ptr %1, ptr %4, align 8, !tbaa !2
54  ret void
55}
56
57; Function Attrs: nounwind
58declare !callback !6 void @__kmpc_fork_call(ptr, i32, ptr, ...) #2
59
60attributes #0 = { nounwind uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="none" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
61attributes #1 = { norecurse nounwind uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="none" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
62attributes #2 = { nounwind }
63
64!llvm.module.flags = !{!0}
65!llvm.ident = !{!1}
66
67!0 = !{i32 1, !"wchar_size", i32 4}
68!1 = !{!"Debian clang version 11.0.0-++20200709100646+c92a8c0a0f6-1~exp1~20200709201313.3348"}
69!2 = !{!3, !3, i64 0}
70!3 = !{!"any pointer", !4, i64 0}
71!4 = !{!"omnipotent char", !5, i64 0}
72!5 = !{!"Simple C/C++ TBAA"}
73!6 = !{!7}
74!7 = !{i64 2, i64 -1, i64 -1, i1 true}
75