Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x86: Cache supportsAVX() checks in binary encoding #7311

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

BradleyWood
Copy link
Member

@BradleyWood BradleyWood commented Apr 11, 2024

A profile discovered significant compute time spent running these checks. I will add performance numbers shortly.

Signed-off-by: Bradley Wood <bradley.wood@ibm.com>
@BradleyWood
Copy link
Member Author

@dsouzai Can you look at this PR from the perspective of CRIU and JIT-server?

FYI, @0xdaryl @vijaysun-omr

@dsouzai
Copy link
Member

dsouzai commented Apr 11, 2024

These checks were originally added because OpenJ9 moved from using TR::CodeGenerator::getX86ProcessorInfo() to using the port library, and so these were sanity checks to ensure that the two sources of information agreed with each other.

Given that it's been a few years, do we even need these checks? @mpirvu what do you think?

@BradleyWood
Copy link
Member Author

Given that it's been a few years, do we even need these checks?

I am working on removing the old api in favour of the portlibrary.

Comment on lines +89 to +92
#if !defined(J9VM_OPT_JITSERVER) && !defined(J9VM_OPT_CRIU_SUPPORT)
static
#endif
bool avxSupport = comp->target().cpu.supportsAVX();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The main issue here is that these macros are OpenJ9 specific, so it's going to pollute the OMR code unnecessarily. Additionally, even outside of JITServer and CRIU, comp->target() can be different in a normal and relocatable compilation.

I think some of the answers to these queries should be cached in the codegen object, so that it is only initialized once per compilation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants