RFR: 8319822: Use a linear-time algorithm for assert_different_registers() [v3]
Andrew Haley
aph at openjdk.org
Mon Nov 27 10:46:05 UTC 2023
On Mon, 20 Nov 2023 10:28:49 GMT, Stefan Karlsson <stefank at openjdk.org> wrote:
> > > I started to review the patch and was wondering if this could be simplify to something like this?: [stefank at f38c791](https://github.com/stefank/jdk/commit/f38c791793440b899ce6c4c9723470a5d4b18050)
> >
> > Sure, it could be done. This is a minor efficiency tweak.
>
> It tested the build performance before this PR, with the patch in this PR, and my simplified version. I can't see any performance difference on my MacBook M1. Is there any platform where this makes a bigger difference?
>
> Edit: I realize that since this doesn't always boil down to a constexpr, then the run time might be more interesting than the build time.
I don't think you'll be able to measure such a tiny difference in build performance, especially given all the other thiungs that are going on, and especially on a Great Big Out-Of_Order machine. But at runtime, the three-operand check can be performed with just three comparisons. I'm not fixated on this, though, and I can take the special cases out.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/16617#issuecomment-1827583069
More information about the hotspot-compiler-dev
mailing list