mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 03:02:36 +01:00
c7e075736a
I noticed that rs4gc is not stripping a number of memory aliasing related attributes. We do strip some from call sites, but don't strip the same ones from declarations or parameters. Why do we need to strip these? Two answers: Safepoints conceptually read and write to the entire garbage collected heap in the physical model. We need this to preserve ordering of all loads and stores with respect to possible relocation. We can infer other attributes from these. For instance, readnone can imply both nofree and nosync. Both of which don't hold after physical rewriting. Note: This exposed a latent issue which was fixed a couple weeks back in 01801d5274. Differential Revision: https://reviews.llvm.org/D99802
94 lines
3.5 KiB
LLVM
94 lines
3.5 KiB
LLVM
; RUN: opt -S -rewrite-statepoints-for-gc < %s | FileCheck %s
|
|
; RUN: opt -S -passes=rewrite-statepoints-for-gc < %s | FileCheck %s
|
|
|
|
|
|
; Ensure we're stipping attributes from the function signatures which are invalid
|
|
; after inserting safepoints with explicit memory semantics
|
|
|
|
declare void @f()
|
|
|
|
define i8 addrspace(1)* @deref_arg(i8 addrspace(1)* dereferenceable(16) %arg) gc "statepoint-example" {
|
|
; CHECK: define i8 addrspace(1)* @deref_arg(i8 addrspace(1)* %arg)
|
|
call void @f()
|
|
ret i8 addrspace(1)* %arg
|
|
}
|
|
|
|
define dereferenceable(16) i8 addrspace(1)* @deref_ret(i8 addrspace(1)* %arg) gc "statepoint-example" {
|
|
; CHECK: define i8 addrspace(1)* @deref_ret(i8 addrspace(1)* %arg)
|
|
call void @f()
|
|
ret i8 addrspace(1)* %arg
|
|
}
|
|
|
|
define i8 addrspace(1)* @deref_or_null_arg(i8 addrspace(1)* dereferenceable_or_null(16) %arg) gc "statepoint-example" {
|
|
; CHECK: define i8 addrspace(1)* @deref_or_null_arg(i8 addrspace(1)* %arg)
|
|
call void @f()
|
|
ret i8 addrspace(1)* %arg
|
|
}
|
|
|
|
define dereferenceable_or_null(16) i8 addrspace(1)* @deref_or_null_ret(i8 addrspace(1)* %arg) gc "statepoint-example" {
|
|
; CHECK: define i8 addrspace(1)* @deref_or_null_ret(i8 addrspace(1)* %arg)
|
|
call void @f()
|
|
ret i8 addrspace(1)* %arg
|
|
}
|
|
|
|
define i8 addrspace(1)* @noalias_arg(i8 addrspace(1)* noalias %arg) gc "statepoint-example" {
|
|
; CHECK: define i8 addrspace(1)* @noalias_arg(i8 addrspace(1)* %arg)
|
|
call void @f()
|
|
ret i8 addrspace(1)* %arg
|
|
}
|
|
|
|
define noalias i8 addrspace(1)* @noalias_ret(i8 addrspace(1)* %arg) gc "statepoint-example" {
|
|
; CHECK: define i8 addrspace(1)* @noalias_ret(i8 addrspace(1)* %arg)
|
|
call void @f()
|
|
ret i8 addrspace(1)* %arg
|
|
}
|
|
|
|
define i8 addrspace(1)* @nofree(i8 addrspace(1)* nofree %arg) nofree gc "statepoint-example" {
|
|
; CHECK: define i8 addrspace(1)* @nofree(i8 addrspace(1)* %arg) gc "statepoint-example" {
|
|
call void @f()
|
|
ret i8 addrspace(1)* %arg
|
|
}
|
|
|
|
define i8 addrspace(1)* @nosync(i8 addrspace(1)* %arg) nosync gc "statepoint-example" {
|
|
; CHECK: define i8 addrspace(1)* @nosync(i8 addrspace(1)* %arg) gc "statepoint-example" {
|
|
call void @f()
|
|
ret i8 addrspace(1)* %arg
|
|
}
|
|
|
|
define i8 addrspace(1)* @readnone(i8 addrspace(1)* readnone %arg) readnone gc "statepoint-example" {
|
|
; CHECK: define i8 addrspace(1)* @readnone(i8 addrspace(1)* %arg) gc "statepoint-example" {
|
|
call void @f()
|
|
ret i8 addrspace(1)* %arg
|
|
}
|
|
|
|
define i8 addrspace(1)* @readonly(i8 addrspace(1)* readonly %arg) readonly gc "statepoint-example" {
|
|
; CHECK: define i8 addrspace(1)* @readonly(i8 addrspace(1)* %arg) gc "statepoint-example" {
|
|
call void @f()
|
|
ret i8 addrspace(1)* %arg
|
|
}
|
|
|
|
define i8 addrspace(1)* @writeonly(i8 addrspace(1)* writeonly %arg) writeonly gc "statepoint-example" {
|
|
; CHECK: define i8 addrspace(1)* @writeonly(i8 addrspace(1)* %arg) gc "statepoint-example" {
|
|
call void @f()
|
|
ret i8 addrspace(1)* %arg
|
|
}
|
|
|
|
define i8 addrspace(1)* @argmemonly(i8 addrspace(1)* %arg) argmemonly gc "statepoint-example" {
|
|
; CHECK: define i8 addrspace(1)* @argmemonly(i8 addrspace(1)* %arg) gc "statepoint-example" {
|
|
call void @f()
|
|
ret i8 addrspace(1)* %arg
|
|
}
|
|
|
|
define i8 addrspace(1)* @inaccessiblememonly(i8 addrspace(1)* %arg) inaccessiblememonly gc "statepoint-example" {
|
|
; CHECK: define i8 addrspace(1)* @inaccessiblememonly(i8 addrspace(1)* %arg) gc "statepoint-example" {
|
|
call void @f()
|
|
ret i8 addrspace(1)* %arg
|
|
}
|
|
|
|
define i8 addrspace(1)* @inaccessiblemem_or_argmemonly(i8 addrspace(1)* %arg) inaccessiblemem_or_argmemonly gc "statepoint-example" {
|
|
; CHECK: define i8 addrspace(1)* @inaccessiblemem_or_argmemonly(i8 addrspace(1)* %arg) gc "statepoint-example" {
|
|
call void @f()
|
|
ret i8 addrspace(1)* %arg
|
|
}
|
|
|