Performance annotations: add attributes @_noLocks and @_noAllocation

This commit is contained in:
Erik Eckstein
2021-10-21 22:04:27 +02:00
parent 60f3d61031
commit 8229b374b1
16 changed files with 113 additions and 11 deletions

View File

@@ -6,6 +6,20 @@ bb0:
return undef : $()
}
// CHECK-LABEL: sil [no_allocation] [ossa] @test_no_allocation : $@convention(thin) () -> () {
sil [no_allocation] [ossa] @test_no_allocation : $@convention(thin) () -> () {
bb0:
%1 = tuple ()
return %1 : $()
}
// CHECK-LABEL: sil [no_locks] [ossa] @test_no_locks : $@convention(thin) () -> () {
sil [no_locks] [ossa] @test_no_locks : $@convention(thin) () -> () {
bb0:
%1 = tuple ()
return %1 : $()
}
// Make sure we don't try to parse the Swift decl as '@owned() func baz()'.
sil @bar : $@convention(thin) () -> @owned ()
func baz()