RFC: Checking TargetLibraryInfo against actual libraries

I've written a small program that sets up TargetLibraryInfo for a
specified triple, and compares its opinion of which libcalls are
"available" against the functions actually provided by some set
of library files.

This has been helpful in tidying up TLI's opinion about which
calls are available where, and I've committed a couple of patches
(6185ad0, 56e681a) to do some general fixup; I'm working on a
patch to get the PS4 set completely correct. I was originally
intending to use this tool in our downstream testsuite, but...

It occurred to me that the tool might be useful to people who are
interested in tidying up TLI for other targets (which I'm not,
really, it's just that part of my effort happens to help others).
Right now the tool can only handle ELF files, but it should be
straightforward to extend to COFF/MachO if people interested in
those targets think it would be useful.

Is there interest in a tool like this?

Thanks,
--paulr

The tool sounds useful to me, thinking from the RISC-V backend's
perspective. Just ELF is fine for that use case.

If it's not a huge amount of additional work to make it fit for public
consumption I think it would be worth sharing.

Best,

Alex

+1

Thanks Alex and Renato!

If it's not a huge amount of additional work to make it fit for public
consumption I think it would be worth sharing.

Needs some proper tests and a bit of documentation, that's all.
Hope to have something posted by the end of the week.
--paulr

https://reviews.llvm.org/D111358

The llvm-tli-checker tool was committed and working as of Monday,
https://github.com/llvm/llvm-project/commit/26c2afce7896388ed032712ee507830800d90d17

--paulr