-
Notifications
You must be signed in to change notification settings - Fork 397
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
Add Platform Agnostic TM Query #3846
Conversation
@0xdaryl @Leonardo2718 could you guys please review? |
compiler/z/env/OMRCPU.hpp
Outdated
* Determines whether the Transactional Memory (TM) facility is available on the current processor. | ||
* Alias of getSupportsTransactionalMemoryFacility() as a platform agnostic query. | ||
*/ | ||
bool supportsTM(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a fan of the duplication here, but until all the codegens have migrated to using the CPU
class for CPU related queries we don't have a choice.
I'm not really sure why the compile is failing; it's failing with
Why isn't the type of |
Another question, if the job was
Why is the linter build also building p and z? |
If you're adding a new CPU query, why not give it a more descriptive name while you're at it? e.g., |
Rabbit holes are what refactoring in this project are all about. However, the more refactoring we all do the fewer of them there are. Some aren't as deep as you think they might be. The project appreciates any effort you (or anyone else) makes toward improving the code. If you're not willing to take the plunge, could you open an issue in the OMR repo to track the proper refactoring effort that the eventual "someone" will need to take? |
I believe the failure is because
The linter is capable of running in a "cross-linting" mode so that errors can be detected on non-x86 platforms without having to build clang on those platforms. |
in z/env/OMRCPU.cpp, compiler/z/env/OMRCPU.hpp was being included. This resulted in linter issues, because self() did not produce a complete type. This commit replaces the absolute include path with a relative include path, to allow the I-Path magic to do its thing. Signed-off-by: Irwin D'Souza <[email protected]>
Thanks @Leonardo2718, that seemed to do the trick. |
@fjeremic could you re-review, considering the change to the include path. |
@0xdaryl could you please re-review and kick off tests if everything looks good to you? |
@genie-omr build all |
@@ -131,6 +131,8 @@ class CPU | |||
bool isI386() { return _minorArch == TR::m_arch_i386; } | |||
bool isAMD64() { return _minorArch == TR::m_arch_amd64; } | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This API should have the same Doxygen comment as the platform-specific ones. It is the API used by architectures that don't have TM support yet (e.g., ARM32, AArch64).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, missed that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This commit adds a wrapper API around existing Transactional Memory (TM) queries in order to have a single query that is common across all platforms. Signed-off-by: Irwin D'Souza <[email protected]>
@genie-omr build all |
In Eclipse OpenJ9, I need to add an AOT feature flag for Transactional Memory (TM) in order to ensure consistency with regard to TM across the compile and load runs. However, as it turns out, the processor query for determining whether TM is enabled is different for each platform. If it was as simple as different names, I would've just
#ifdef
'd the different queries and moved on. However, on x86, the query isn't even in theTR::CPU
class; it's initialized as a static member of the x86 codegen class, and theinitialize
method is private that can only be accessed by the x86 codegen class.This PR only contains changes that provide (for the most part) a wrapper around existing TM queries. The right thing to do would be to refactor all the code into the
TR::CPU
class, but that's a rabbit hole unto itself. I figure this change should suffice for now, until someone re-architects the code.