mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-26 04:32:44 +01:00
d69254e263
Pretty straightforward use of existing infrastructure and port of the attributor inference rules for nosync. A couple points of interest: * I deliberately switched from "monotonic or better" to "unordered or better". This is simply me being conservative and is better in line with the rest of the optimizer. We treat monotonic conservatively pretty much everywhere. * The operand bundle test change is suspicious. It looks like we might have missed something here, but if so, it's an issue with the existing nofree inference as well. I'm going to take a closer look at that separately. * I needed to keep the previous inference from readnone. This surprised me, but made sense once I realized readonly inference goes to lengths to reason about local vs non-local memory and that writes to local memory are okay. This is fine for the purpose of nosync, but would e.g. prevent us from inferring nofree from readnone - which is slightly surprising. Differential Revision: https://reviews.llvm.org/D99769
21 lines
413 B
LLVM
21 lines
413 B
LLVM
; RUN: opt -S -function-attrs < %s | FileCheck %s
|
|
; RUN: opt -S -passes=function-attrs < %s | FileCheck %s
|
|
|
|
@i = global i32 0
|
|
|
|
define void @foo() {
|
|
; CHECK-LABEL: define void @foo() #0 {
|
|
store i32 1, i32* @i
|
|
call void @bar()
|
|
ret void
|
|
}
|
|
|
|
define void @bar() {
|
|
; CHECK-LABEL: define void @bar() #0 {
|
|
%i = load i32, i32* @i
|
|
call void @foo()
|
|
ret void
|
|
}
|
|
|
|
; CHECK: attributes #0 = { nofree nosync nounwind }
|