On Wed, 2 Oct 2024, Jakub Jelinek wrote:
> Hi! > > In the Cauldron IPA/LTO BoF we've discussed toplevel asms and it was > discussed it would be nice to tell the compiler something about what > the toplevel asm does. Sure, I'm aware the kernel people said they > aren't willing to use something like that, but perhaps other projects > do. And for kernel perhaps we should add some new option which allows > some dumb parsing of the toplevel asms and gather something from that > parsing. I wonder if we should offer people a way to discover toplevel asms that participated in the compilation. I tried implementing that the obvious way for C (emit a warning from c_parser_asm_definition) and collected stats on x86_64-defconfig kernel build. There are not too many unique toplevel asms: linux/arch/x86/include/asm/alternative.h:284:9 linux/arch/x86/include/asm/static_call.h:35:9 linux/arch/x86/include/asm/static_call.h:61:9 linux/arch/x86/kernel/alternative.c:1572:1 linux/arch/x86/kernel/callthunks.c:67:1 linux/arch/x86/kernel/kprobes/opt.c:104:1 linux/arch/x86/kernel/rethook.c:22:1 linux/arch/x86/kernel/static_call.c:44:1 linux/arch/x86/kernel/uprobes.c:313:1 linux/include/linux/export-internal.h:41:9 linux/include/linux/export.h:58:9 linux/include/linux/init.h:262:9 linux/include/linux/pci.h:2185:9 linux/include/linux/tracepoint.h:119:9 Alexander