mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-27 16:17:17 +00:00
Add a dereferenceable attribute
This attribute indicates that the parameter or return pointer is dereferenceable. Practically speaking, loads from such a pointer within the associated byte range are safe to speculatively execute. Such pointer parameters are common in source languages (C++ references, for example). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213385 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -229,6 +229,16 @@ define void @f38() unnamed_addr jumptable {
|
||||
unreachable
|
||||
}
|
||||
|
||||
define dereferenceable(2) i8* @f39(i8* dereferenceable(1) %a) {
|
||||
; CHECK: define dereferenceable(2) i8* @f39(i8* dereferenceable(1) %a) {
|
||||
ret i8* %a
|
||||
}
|
||||
|
||||
define dereferenceable(18446744073709551606) i8* @f40(i8* dereferenceable(18446744073709551615) %a) {
|
||||
; CHECK: define dereferenceable(18446744073709551606) i8* @f40(i8* dereferenceable(18446744073709551615) %a) {
|
||||
ret i8* %a
|
||||
}
|
||||
|
||||
; CHECK: attributes #0 = { noreturn }
|
||||
; CHECK: attributes #1 = { nounwind }
|
||||
; CHECK: attributes #2 = { readnone }
|
||||
|
Reference in New Issue
Block a user