From: Richard Henderson <richard.henderson@linaro.org>
To: Michael Clark <michael@anarch128.org>,
qemu-devel@nongnu.org, Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [PATCH] tcg: refactor pool data for simplicity and comprehension
Date: Sat, 15 Feb 2025 15:41:42 -0800 [thread overview]
Message-ID: <0ec10457-0461-46e7-95df-a5d1552ab722@linaro.org> (raw)
In-Reply-To: <6b9d6600-d430-4bcc-9f37-8d8d96d31e06@anarch128.org>
On 2/15/25 14:40, Michael Clark wrote:
> On 2/16/25 10:50, Richard Henderson wrote:
>> On 2/15/25 12:24, Michael Clark wrote:
>>>> Why? varargs generally produces horrible code.
>>>> The split between alloc and insert was intentional to avoid this.
>>>
>>> it's pretty good code on SysV because it goes via registers except for perhaps
>>> new_pool_l8 which will spill to stack and get copied unless the inliner can eliminate
>>> the copies. maybe windows has bad varargs. but I like the style better than deeper
>>> layers of wrapper functions. they should fix the compiler so that it produces better code.
>>
>> varargs will generally prevent inlining.
>>
>> Indeed, just a quick look at aarch64 tcg_out_movi shows that without your change,
>> new_pool_label, new_pool_data and new_pool_insert are all inlined. With your change,
>> new_pool_data is not inlined, all the argument regs are dumped to the stack, etc.
>>
>> I don't think this is a good change to make.
>
> fixing varargs codegen in GCC/Clang would be a good change. count based varargs can be
> reasoned about statically relatively easily. what is it like with an explicit inline as
> opposed to just static?
Inline will still be rejected.
r~
next prev parent reply other threads:[~2025-02-15 23:42 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-15 2:11 [PATCH] tcg: refactor pool data for simplicity and comprehension Michael Clark
2025-02-15 17:58 ` Richard Henderson
2025-02-15 20:24 ` Michael Clark
2025-02-15 21:50 ` Richard Henderson
2025-02-15 22:40 ` Michael Clark
2025-02-15 23:41 ` Richard Henderson [this message]
2025-02-16 0:48 ` Michael Clark
2025-02-15 22:58 ` Michael Clark
2025-02-16 8:00 ` Michael Clark
2025-02-16 18:01 ` Richard Henderson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0ec10457-0461-46e7-95df-a5d1552ab722@linaro.org \
--to=richard.henderson@linaro.org \
--cc=michael@anarch128.org \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).