Repository navigation
x86: Add disableAVX2/512 options and check XCR0 for OS support - #7602
Conversation
|
FYI, @0xdaryl |
| OMR::X86::CPU::is_feature_disabled(uint32_t feature) | ||
| { | ||
| TR_CompilationOptions option = (TR_CompilationOptions) 0; | ||
| TR::Compilation *comp = TR::comp(); |
There was a problem hiding this comment.
I need to be convinced this is the best way to do this because pulling the compilation object from TLS has never proven to be cheaper than retrieving it from elsewhere or passing it in as a parameter. It is really useful for debugging, in places where compile-time performance is not a concern (e.g., the ASSERT macro), or in code that is difficult to modify to introduce a compilation object. supports_feature (which immediately calls this function) is called from a number of places, so some compile-time benchmarking is required.
Did you consider passing in the compilation object to supports_feature or caching the compilation object in the CPU object itself? If so, please comment why forgoing those alternatives justifies the compile-time cost of using TR::comp().
There was a problem hiding this comment.
Passing the compilation object to supports_feature would require changes in both OpenJ9 and OMR, including at every call to to this function. That would introduce a large number of changes that would need to introduced with a coordinated merge between OpenJ9 and OMR.
I don't think I makes sense for TR::CPU to cache the compilation object either. It would need to change with compilation and my understanding is that environment information is shared across all compilations.
The only other thing I can thing of is use TR::comp(), cache the result to comp->getOption() in a static field and hope that gcc can optimize it. But doing this would have other drawbacks, in that you cant disable features for specific methods only and the CLI would probably need to verify that these options are only applied globally.
86e7af6 to
a9091a8
Compare
|
@0xdaryl Any thoughts on this change? |
|
Jenkins build xlinux,osx,win,x32linux |
Signed-off-by: Bradley Wood <bradley.wood@ibm.com>
Signed-off-by: Bradley Wood <bradley.wood@ibm.com>
a9091a8 to
a42c2cd
Compare
|
@0xdaryl See the force-push |
|
Jenkins build xlinux |
No description provided.