aboutsummaryrefslogtreecommitdiff
path: root/src/llvm_abi.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2022-11-25 23:57:55 +0000
committergingerBill <bill@gingerbill.org>2022-11-25 23:57:55 +0000
commitd88b052d2d9aa8fa012be314bd29d7ae311fc941 (patch)
tree09869f936f3c08d7731006d2c7e28b0be48b556d /src/llvm_abi.cpp
parent615eccb6d193e9eb2575cfb28b1366c648296c31 (diff)
Naïve optimization of named _split_ multiple return valued when `defer` is never used
This is a naïve optimization but it helps a lot in the general case where callee temporary stack variables are not allocated to represent the named return values by using that specific memory. In the future, try to check if a specific named return value is ever used a `defer` within a procedure or not, or is ever passed to a nested procedure call (e.g. possibly escapes).
Diffstat (limited to 'src/llvm_abi.cpp')
-rw-r--r--src/llvm_abi.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/llvm_abi.cpp b/src/llvm_abi.cpp
index c35affad5..166fcb3ee 100644
--- a/src/llvm_abi.cpp
+++ b/src/llvm_abi.cpp
@@ -1426,7 +1426,9 @@ LB_ABI_INFO(lb_get_abi_info_internal) {
switch (build_context.metrics.arch) {
case TargetArch_amd64:
- if (build_context.metrics.os == TargetOs_windows || build_context.metrics.abi == TargetABI_Win64) {
+ if (build_context.metrics.os == TargetOs_windows) {
+ return lbAbiAmd64Win64::abi_info(c, arg_types, arg_count, return_type, return_is_defined, return_is_tuple, calling_convention);
+ } else if (build_context.metrics.abi == TargetABI_Win64) {
return lbAbiAmd64Win64::abi_info(c, arg_types, arg_count, return_type, return_is_defined, return_is_tuple, calling_convention);
} else if (build_context.metrics.abi == TargetABI_SysV) {
return lbAbiAmd64SysV::abi_info(c, arg_types, arg_count, return_type, return_is_defined, return_is_tuple, calling_convention);