[compiler-rt] [compiler-rt] Add baremetal version of profile library. (PR #167998)

Peter Smith via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 17 09:35:48 PST 2025


smithp35 wrote:

Aside from a rewrite along the lines of what Petr Hosek mentions, I think that this is a good step forward. From what I understand it would permit us to shrink our baremetal profiling implementation down to just our implementation of `__llvm_profile_dump()` which would guard against most, but not all profile format changes.

I agree that it would be useful to change the name of the file as I would instinctively look for `InstrProfilingPlatformOther` rather than `InstrProfilingPlatform`.

If I've understood the scope of the change. The user/toolchain would still have to arrange for a mechanism to construct a means to output the counters in a format that `llvm-profdata`  understands. In our sample runtime we used semi-hosting to write to a file. While I don't think it would be possible to cover all possible methods of output in the library, it could be possible to write a function that covered some common cases (user may have to supply some low-level callbacks). Alternatively it would be useful to write some documentation, possibly as a comment on what a toolchain provider/user has to provide to make this work. Could be a follow on change.

https://github.com/llvm/llvm-project/pull/167998


More information about the llvm-commits mailing list