-
Notifications
You must be signed in to change notification settings - Fork 1
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 (port) performance sensitive randomization #17
Conversation
Co-authored-by: James Foster <jafosterja@gmail.com>
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.
Need to pull in branch and give it a run. Besides that the code is easy to read and understand. Great job @connorkuehl @Jafosterja .
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.
Found a vestigial randomize()
return true; | ||
} | ||
|
||
SmallVector<Decl *, 64> randomize(SmallVector<Decl *, 64> fields) { |
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.
Do we need randomize() as well as Bucket::randomize() ? randomize() looks unused
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 think the requirements document specifies having a basic randomize (this one) and a cache line sensitive one (perfrandomize).
If we keep both, I'd imagine we will need to introduce a switch or something so that users can specify which one they want. In that case, this code will not be unused.
If we opt to only have the performance-sensitive randomization, then we will delete this routine, yes.
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.
Just for my own curiosity, this is just a stylistic question, why not pass Bucket.fields to randomize(), instead of duplicating randomize() inside the Bucket class? Is that just in case we need to tweak Bucket.randomize() in the future?
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.
Is that just in case we need to tweak Bucket.randomize() in the future?
Yeah, but there's a big chance we won't have to. What you described is probably better at the moment.
|
||
bool BitfieldRun::isBitfieldRun() const { | ||
// Yes. | ||
return true; |
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.
Is this the commenting that we want? While literal and correct, it's not helpful.
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.
Rebuilt after visual inspection. Ran scan build, and it returned no errors. Ran clang-format and it looked good too.
This is a port of our Clang plugin code for the reorganization of fields.
Closes #10
Please review this so that we can ultimately diminish how hacky it feels.