Adds some bookkeeping for collecting the number of specialised functions, and a test.
Details
Diff Detail
Event Timeline
llvm/lib/Transforms/IPO/FunctionSpecialization.cpp | ||
---|---|---|
468 |
Will look into that. |
The wrong location didn't sit right, so I have precommitted that in rG9907746f5db7 before I continue with the rest and this is a little rebase on top of that.
Thanks for the update! Could you update the description/title, as they seem a bit out-of-sync after the recent changes.
llvm/lib/Transforms/IPO/FunctionSpecialization.cpp | ||
---|---|---|
124 | might be good to also have a test to check the stats work as expected? | |
146 | Would be good to add a comment. Should the type be unsigned? |
It looks like this patch is tried to refactor the counter? What's the difference after applying this patch? Or is it a NFC patch?
Thanks for your comments. I quickly put this patch together to collect post-commit comments. I will pick this is up today.
Oh, so it is a WIP patch which containing changes in different aspects? I am not sure if it is better to separate them. I guess it would be better to review and revert (if needed).
This is now only about statistics: commented/renamed the counter, and added a test case.
llvm/test/Transforms/FunctionSpecialization/function-specialization-stats.ll | ||
---|---|---|
3 | do we need to run those unrelated passes? |
llvm/test/Transforms/FunctionSpecialization/function-specialization-stats.ll | ||
---|---|---|
3 | Not necessarily, but it kind of nicely illustrates the possibilities with those "clean up" passes, the things function specialisation enables. Let me know what you prefer as I am of course happy to remove them. |
llvm/test/Transforms/FunctionSpecialization/function-specialization-stats.ll | ||
---|---|---|
3 |
Usually we try to avoid having tests depend on different passes, to reduce churn when making changes to unrelated passes. While it is nice other stats improve, it’s independent of checking the function specialisation stats. |
llvm/lib/Transforms/IPO/FunctionSpecialization.cpp | ||
---|---|---|
468 | Added a test for that in rG29843cbc88f6. | |
llvm/test/Transforms/FunctionSpecialization/function-specialization-stats.ll | ||
3 | Ok, sure, understood. This is indeed almost an end-to-end test for function specialisation, and it would be good to have that, but it does not necessarily fit here. Will modify this test. |
I did change something here; partly addressed this, but need to remind myself what that was. Will look into this.