File tree 2 files changed +50
-1
lines changed 2 files changed +50
-1
lines changed Original file line number Diff line number Diff line change @@ -4861,7 +4861,7 @@ void OpenMPOpt::registerAAs(bool IsModulePass) {
4861
4861
if (llvm::all_of (F->uses (), [this ](const Use &U) {
4862
4862
const auto *CB = dyn_cast<CallBase>(U.getUser ());
4863
4863
return CB && CB->isCallee (&U) &&
4864
- ! A.isRunOn (const_cast <Function *>(CB->getCaller ()));
4864
+ A.isRunOn (const_cast <Function *>(CB->getCaller ()));
4865
4865
}))
4866
4866
continue ;
4867
4867
}
Original file line number Diff line number Diff line change
1
+ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2
+ ; RUN: opt -S -passes=openmp-opt-cgscc < %s | FileCheck %s
3
+
4
+ ; Verify we remove the trivially dead store in a function that is not dead
5
+ ; (foo) but not in a dead function (dead) when running in cgscc mode.
6
+
7
+ define internal void @dead () {
8
+ ; CHECK-LABEL: @dead(
9
+ ; CHECK-NEXT: [[A:%.*]] = alloca i32, align 4
10
+ ; CHECK-NEXT: store i32 0, ptr [[A]], align 4
11
+ ; CHECK-NEXT: ret void
12
+ ;
13
+ %a = alloca i32
14
+ store i32 0 , ptr %a
15
+ ret void
16
+ }
17
+
18
+ define internal void @foo () {
19
+ ; CHECK-LABEL: @foo(
20
+ ; CHECK-NEXT: [[A:%.*]] = alloca i32, align 4
21
+ ; CHECK-NEXT: ret void
22
+ ;
23
+ %a = alloca i32
24
+ store i32 0 , ptr %a
25
+ ret void
26
+ }
27
+
28
+ define internal void @bar () {
29
+ ; CHECK-LABEL: @bar(
30
+ ; CHECK-NEXT: call void @foo()
31
+ ; CHECK-NEXT: ret void
32
+ ;
33
+ call void @foo ()
34
+ ret void
35
+ }
36
+
37
+ define void @baz () {
38
+ ; CHECK-LABEL: @baz(
39
+ ; CHECK-NEXT: call void @bar()
40
+ ; CHECK-NEXT: ret void
41
+ ;
42
+ call void @bar ()
43
+ ret void
44
+ }
45
+
46
+ !llvm.module.flags = !{!0 , !1 }
47
+
48
+ !0 = !{i32 7 , !"openmp" , i32 50 }
49
+ !1 = !{i32 7 , !"openmp-device" , i32 50 }
You can’t perform that action at this time.
0 commit comments