|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH] x86emul: Cache the amd_like() output on x86_emulate() entry
On Tue Sep 22, 2026 at 3:34 PM CEST, Jan Beulich wrote: > On 21.09.2026 11:25, Alejandro Vallejo wrote: > > The current code instantiates amd_like() way too many times, leading to > > codegen explosion. Unconditionally call it early on, and use that > > variable everywhere. This shrinks the emulator by ~3KiB. > > > > No a functional change. > > > > Signed-off-by: Alejandro Vallejo <alejandro.garciavallejo@xxxxxxx> > > --- > > pipeline: > > https://gitlab.com/xen-project/people/agvallejo/xen/-/pipelines/2860748404 > > (it's red because of an caching issue and personal branch name > > conventions it's just arm. x86 passes in full) > > > > bloat-o-meter before-after patch. > > > > add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-3366 (-3366) > > Function old new delta > > x86_emulate 209351 205985 -3366 > > Total: Before=3617694, After=3614328, chg -0.09% > > That's surprisingly big a difference, considering how simple amd_like() is. > I'm counting 24 instances, so the savings would be well over 100 bytes per > instance. I have some more interesting results. I can very much repro at that commit with GCC 13 with debug=y, but ALSO the variable must be set at the tail of all other locals. I never noticed the gain was gone after moving where it is in this patch. Clearly I misattributed the origin of the shrinkage. In retrospect, it turns out to be an unrelated matter. I _THINK_ register pressure is somehow precluding the inlining of a helper. The problem is gone in debug=n where CSE ensures all is good. If I find a way of shrinking debug builds in a way that's more resilient to compiler specifics I'll push that as a separate patch, but for now I'll just drop this. Clearly it doesn't matter here for a realistic build. Apologies for the noise. Codegen is hard :) Alejandro
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |