This change tries to handle multiple dominating users of the pointer operand
by choosing the most immediately dominating one, if possible.
While making this change I also found that the previous implementation
had a missing break statement, making all loads with an odd number of
dominating users emit an OtherAccess value, so that has also been fixed.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Thanks for improving this. Can you please add a small test highlighting where your change improve the diagnostics? TIA!
[GVN] Update analysis for optimization remark and add tests
We now cover even more cases for finding OtherAccess.
This is my first time using both Phabricator and Arcanist, so I'm not entirely familiar with the UI and workflow, but I can't seem to find one of the test cases I added in my update. It's supposed to be in llvm/test/Transforms/GVN/opt-remarks-multiple-users.ll, but I can't see it added in the revision. Did I miss something? It's an earlier commit than the new diff I pushed, so I would've thought it would be included as well.
Updating D79097: [GVN] Improve analysis for missed optimization remark
Now all patches should be included... I think.
Sorry about the delay, just a few small nits on the tests, this is pretty close. Thanks for pushing this!
llvm/test/Transforms/GVN/opt-remarks-multiple-users.ll | ||
---|---|---|
4 | Please add a comment with the intention for test. In this particular case I imagine that before your change we would have given up on determining OtherAccess. | |
45 | I know this is a minimized testcase but don’t have unreachable here to make it more realistic. | |
llvm/test/Transforms/GVN/opt-remarks-non-dominating.ll | ||
62 | Please add a comment before each functions what it’s testing. | |
64 | I would change these undefs to actual values to make these tests more realistic. |
Yes, sorry about the delay!
Currently finishing the last bits of the thesis that this work is part of has taken priority, which doesn't leave too much time since I'm now also working full time.
After that's done though I intend to come back and do the cleanup necessary to upstream as much of the work as possible. It's all related to improving optimisation remarks in one way or another. :)
Yup, it will be published in LUP Student Papers afaict! I can send you a rough draft if you're interested. Most of the final content is in place already, but it's a bit rough around the edges.
No hurry, the final version is fine. You may also want to consider sending it to llvm-dev if you think it could be interesting to other people in the community.
After a long wait I'm now finally able to work on this again! Please excuse the delay.
llvm/test/Transforms/GVN/opt-remarks-non-dominating.ll | ||
---|---|---|
64 | Missed this comment, will update again! |
Glad, you were able to get back to this.
llvm/test/Transforms/GVN/opt-remarks-multiple-users.ll | ||
---|---|---|
16 | It seems that we want to be able to distinguish between the two calls here? If you add source debug info to test along the lines of GVN/opt-remarks.ll you should be able to check that the right call is returned here. Also a nit, you may want to chop up the CHECK section so that each checking section is right before the function it corresponds too. |
Split CHECKs to keep them closer to their relevant functions, and added debug information to disambiguate instructions where relevant.
Cool :) This is my first submission, so I don't have commit access. If I understand correctly that means I need someone else to commit it on my behalf, yes?
Congrats ;). Yes, I will commit it for you. Can you please rebase and retest, looks like the patch is not applying cleanly.
clang-format: please reformat the code