-
Notifications
You must be signed in to change notification settings - Fork 778
Add metadata to allow client to log vectorization #23065
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
base: master
Are you sure you want to change the base?
Add metadata to allow client to log vectorization #23065
Conversation
runtime/oti/j9nonbuilder.h
Outdated
| struct J9JITInvokeBasicCallInfo* invokeBasicCallInfo; | ||
| #if defined(J9VM_OPT_JITSERVER) | ||
| // corresponds to J9::Compilation::_vectorApiTransformationPerformed | ||
| bool _vectorApiTransformationPerformed; |
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.
I wonder whether we could use UDATA flags; for this purpose
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.
We could also use the type BOOLEAN as used in other places within this file
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.
No need to add a new field since one is already provided (flags) and it's very appropriate for the job.
| // this list will be copied into the metadata | ||
| if (metaData->_vectorApiTransformationPerformed) | ||
| { | ||
| TR_VerboseLog::writeLineLocked(TR_Vlog_VECTOR_API, "Jit server processed vector ops"); |
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.
Please correct alignment. Also your code separated the comment from the code it was referring to.
Also, we typically write JITServer (instead of Jit server)
| { | ||
| data->flags |= JIT_METADATA_IS_DESERIALIZED_COMP; | ||
| } | ||
| data->_vectorApiTransformationPerformed = comp->setVectorApiTransformationPerformed(); |
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.
It's better to define a flag write to data->flags as you see above.
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.
Also, we need to do this only for outOfProcessCompilation()
mpirvu
left a comment
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.
There are some places in VectorAPIExpansion.hpp that also issue vlog messages. Those need to be covered as well.
| { | ||
| data->flags |= JIT_METADATA_IS_DESERIALIZED_COMP; | ||
| } | ||
| data->_vectorApiTransformationPerformed = comp->setVectorApiTransformationPerformed(); |
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.
Also, we need to do this only for outOfProcessCompilation()
9998400 to
c14a580
Compare
| { | ||
| data->flags |= JIT_METADATA_IS_DESERIALIZED_COMP; | ||
| } | ||
| data->flags |= comp->setVectorApiTransformationPerformed() * JIT_METADATA_HAS_BEEN_VECTORIZED; |
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.
Sorry, but this code makes no sense to me.
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.
What threw me off is the usage of a setter (based on the name). The name should indicate a getter.
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.
I would prefer the code to look this:
if (comp->getVectorApiTransformationPerformed())
data->flags |= JIT_METADATA_HAS_BEEN_VECTORIZED;
Also, JIT_METADATA_HAS_BEEN_VECTORIZED is a bit misleading because it can be read that the metadata has been vectorized. Maybe replace it with JIT_METADATA_VECTORIZED_CODE
| */ | ||
| struct J9JITInvokeBasicCallInfo* invokeBasicCallInfo; | ||
| #if defined(J9VM_OPT_JITSERVER) | ||
| // corresponds to J9::Compilation::_vectorApiTransformationPerformed |
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 comment needs to be removed
|
Could you please describe the whole design in the commit message? Is it exactly as described here: #23038 (comment) ? |
Fixes #23038
This is the complete design of the fix as described in the issue linked above.