-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[LVA] Don't invalidate reads/writes that don't alias any tracked values. #31136
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
[LVA] Don't invalidate reads/writes that don't alias any tracked values. #31136
Conversation
In DSE and RLE any unkown read/write often causes most if not all tracked values to be invalidated. This doesn't need to be the case. If the tracked value doesn't alias any of the operands of the unkown instruction, then we can safely keep the tracked value validated.
092f116
to
313c130
Compare
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 don't think you can make this assumption.
Let's assume an instruction (which could e.g. be a function call), which has an address of an object reference as operand and reads that reference and writes some field in the object.
The operand (address of the reference) is not aliased with the object itself, but would overwrite values in the object.
In that case, the operand of the instruction (function call) will alias with the pointer. So, that pointer's not being tracked anymore. I assume you're talking about promoting a load of the pointer so RLE would check if the operand (the pointer) is being tracked, it's not, so we wouldn't promote it. We do introduce the problem #31131 fixes. |
Given my comment on the performance improvements of this patch. I think it would be beneficial to move forward with this change. @eeckstein sorry for all the messages recently. No rush responding. |
@swift-ci please benchmark |
Performance: -O
Code size: -O
Performance: -Osize
Code size: -Osize
Performance: -Onone
Code size: -swiftlibsHow to read the dataThe tables contain differences in performance which are larger than 8% and differences in code size which are larger than 1%.If you see any unexpected regressions, you should consider fixing the Noise: Sometimes the performance results (not code size!) contain false Hardware Overview
|
In DSE and RLE any unknown read/write often causes most if not all tracked values to be invalidated. This doesn't need to be the case. If the tracked value doesn't alias any of the operands of the unknown instruction, then we can safely keep the tracked value validated.
Requires #31131