
With this patch we track aligned barriers in AAExecutionDomain and also delete unnecessary barriers there. This allows us to eliminate barriers across blocks, across functions, and in the presence of complex accesses that do not force a barrier. Further, we can use the collected information to enable store-load forwarding in a threaded environment (follow up patch). Differential Revision: https://reviews.llvm.org/D140463
49 lines
1.0 KiB
LLVM
49 lines
1.0 KiB
LLVM
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
|
|
; RUN: opt -S -passes=openmp-opt-cgscc < %s | FileCheck %s
|
|
|
|
; Verify we remove the trivially dead store in a function that is not dead
|
|
; (foo) but not in a dead function (dead) when running in cgscc mode.
|
|
|
|
define internal void @dead() {
|
|
; CHECK-LABEL: @dead(
|
|
; CHECK-NEXT: [[A:%.*]] = alloca i32, align 4
|
|
; CHECK-NEXT: store i32 0, ptr [[A]], align 4
|
|
; CHECK-NEXT: ret void
|
|
;
|
|
%a = alloca i32
|
|
store i32 0, ptr %a
|
|
ret void
|
|
}
|
|
|
|
define internal void @foo() {
|
|
; CHECK-LABEL: @foo(
|
|
; CHECK-NEXT: [[A:%.*]] = alloca i32, align 4
|
|
; CHECK-NEXT: ret void
|
|
;
|
|
%a = alloca i32
|
|
store i32 0, ptr %a
|
|
ret void
|
|
}
|
|
|
|
define internal void @bar() {
|
|
; CHECK-LABEL: @bar(
|
|
; CHECK-NEXT: ret void
|
|
;
|
|
call void @foo()
|
|
ret void
|
|
}
|
|
|
|
define void @baz() {
|
|
; CHECK-LABEL: @baz(
|
|
; CHECK-NEXT: call void @bar()
|
|
; CHECK-NEXT: ret void
|
|
;
|
|
call void @bar()
|
|
ret void
|
|
}
|
|
|
|
!llvm.module.flags = !{!0, !1}
|
|
|
|
!0 = !{i32 7, !"openmp", i32 50}
|
|
!1 = !{i32 7, !"openmp-device", i32 50}
|