forked from swiftlang/swift
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request swiftlang#30298 from gottesmm/pr-4e1212f1e4e3640e5…
…037f11164d07e20fcea7324 [inliner] Add a new Inliner that only inlines AlwaysInline functions (but do not put it in the pass pipeline).
- Loading branch information
Showing
5 changed files
with
82 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// RUN: %target-sil-opt -enable-sil-verify-all %s -always-inline | %FileCheck %s | ||
|
||
sil @doSomething1 : $@convention(thin) () -> () | ||
sil @doSomething2 : $@convention(thin) () -> () | ||
sil @doSomething3 : $@convention(thin) () -> () | ||
|
||
sil [ossa] [always_inline] @do_inline_this : $@convention(thin) () -> () { | ||
bb0: | ||
%d1 = function_ref @doSomething1 : $@convention(thin) () -> () | ||
apply %d1() : $@convention(thin) () -> () | ||
%9999 = tuple() | ||
return %9999 : $() | ||
} | ||
|
||
sil [ossa] @donot_inline_this : $@convention(thin) () -> () { | ||
bb0: | ||
%d1 = function_ref @doSomething2 : $@convention(thin) () -> () | ||
apply %d1() : $@convention(thin) () -> () | ||
%9999 = tuple() | ||
return %9999 : $() | ||
} | ||
|
||
sil [ossa] @empty_function : $@convention(thin) () -> () { | ||
bb0: | ||
%9999 = tuple() | ||
return %9999 : $() | ||
} | ||
|
||
// CHECK-LABEL: sil [ossa] @caller : $@convention(thin) () -> () { | ||
// CHECK-NOT: function_ref @do_inline_this : $@convention(thin) () -> () | ||
// CHECK: function_ref @donot_inline_this : $@convention(thin) () -> () | ||
// CHECK: function_ref @empty_function : $@convention(thin) () -> () | ||
// CHECK: } // end sil function 'caller' | ||
sil [ossa] @caller : $@convention(thin) () -> () { | ||
bb0: | ||
%c1 = function_ref @do_inline_this : $@convention(thin) () -> () | ||
apply %c1() : $@convention(thin) () -> () | ||
%c2 = function_ref @donot_inline_this : $@convention(thin) () -> () | ||
apply %c2() : $@convention(thin) () -> () | ||
%c3 = function_ref @empty_function : $@convention(thin) () -> () | ||
apply %c3() : $@convention(thin) () -> () | ||
%9999 = tuple() | ||
return %9999 : $() | ||
} |