[sil] Add basic SIL support for alloc_stack [non_nested].

This means I just added the flag and added support for
cloning/printing/serializing the bit on alloc_stack.
This commit is contained in:
Michael Gottesman
2025-11-18 14:27:43 -08:00
parent a1b41acf8d
commit 29229a9410
13 changed files with 120 additions and 10 deletions

View File

@@ -494,3 +494,14 @@ bb0(%0 : @guaranteed $Klass):
%9999 = tuple ()
return %9999 : $()
}
// CHECK-LABEL: sil [ossa] @alloc_stack_nonnested : $@convention(thin) () -> () {
// CHECK: alloc_stack [non_nested] $Klass
// CHECK: } // end sil function 'alloc_stack_nonnested'
sil [ossa] @alloc_stack_nonnested : $@convention(thin) () -> () {
bb0:
%0 = alloc_stack [non_nested] $Klass
dealloc_stack %0
%9999 = tuple ()
return %9999 : $()
}

View File

@@ -13,6 +13,17 @@ class Klass {}
sil @getC : $@convention(thin) () -> (@owned C)
sil @getKlass : $@convention(thin) () -> (@owned Klass)
// CHECK-LABEL: sil [ossa] @alloc_stack_nonnested : $@convention(thin) () -> () {
// CHECK: alloc_stack [non_nested] $Klass
// CHECK: } // end sil function 'alloc_stack_nonnested'
sil [ossa] @alloc_stack_nonnested : $@convention(thin) () -> () {
bb0:
%0 = alloc_stack [non_nested] $Klass
dealloc_stack %0
%9999 = tuple ()
return %9999 : $()
}
// CHECK-LABEL: sil [ossa] @ignored_use_test : $@convention(thin) (@guaranteed Klass) -> () {
// CHECK: ignored_use %0 : $Klass
// CHECK: } // end sil function 'ignored_use_test'