mix xref was useful not only for finding unreachable code, it also supported looking for all callers or generating dependency graph of the application. So none of these functionalities was available during compilation.
Do you use dbg module on daily basis? Do you use mix profile.* on daily basis? No, these tools have specific use cases, and when you need them you praise all J’s that decided that it should be part of the default release instead of spending X hours on searching solutions that will work.
I’m currently using mix xref callers MyApp.Schema – a module namespace that contains all my DB (Ecto) code. I’m integrating it in a GIT pre-commit hook that checks which modules use that namespace because I only want certain modules to directly use DB code.
So that’s one valid usage: you can enforce some limitations on your project at GIT pre-commit or CI server level. You can call it homemade linting.
Another very good usage is refactoring. When you move functions around – or rename them, or delete them – you want to minimise compilation or runtime errors so you first search who calls them and rework those as well along the way.