-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[EarlyCSE] Compare GEP instructions based on offset #65875
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
Please check the compile-time impact of this change. The impact was high when I tried something like this before, but maybe I made a mistake. |
Could you add https://github.com/DianQK/llvm-project to https://llvm-compile-time-tracker.com/? Thanks. |
I'll do this on Thursday. I'm currently on vacation and don't have the SSH key with me. |
Done, results are here: http://llvm-compile-time-tracker.com/compare.php?from=ac1daad9bb4eb083df6b215c029816d3149e00d8&to=e079f3f9107f55e1595a47aafec5fe4e03277665&stat=instructions:u |
Sad result. My initial guess was that in |
This will provide more opportunities for constant propagation for subsequent optimizations.
78ed2a0
to
31e2ec9
Compare
It's not ready for review yet. It may contain many nits. Progress update: |
Add comments and some minor changes
Using references works well! I've also tried some approaches. |
Okay, those results look reasonable. It's somewhat unfortunate that this requires duplicating a bunch of code for the separate GEP handling. I'm wondering, would we be able to achieve similar results if we add a |
I feel like I misunderstood. Do you mean putting the GEP back into |
Yes (EarlyCSE only cache). This is just a suggestion for something to check, but I suspect the performance of that approach will not be good enough and we have to go with this version. |
I did not try this approach. My understanding is that this only adds extra lookups if applied to a single EarlyCSE. Since each result needs to be calculated once. The current patch is the no-hash approach as I understand it. I made a new attempt to save uint64_t instead of APInt. |
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.
LGTM
Closes #65763.
This will provide more opportunities for constant propagation for subsequent optimizations.