Tool to reduce a module to just (one/more) function

Apologies if I’m missing something obvious - the TL;DR; is: do we have / would folks find useful a tool that took a module and a function name and produced a valid module with just that function in, the rest being deleted - i.e. outright deleted if no internal calls, converted to a declaration otherwise; their metadata, too.

My scenario is: large (think: thinlto backend) modules, and I want to focus on comparing regalloc policies for just one. Both in the debugger, as well as dbgs() debugging, would benefit from not having to care about anything else than this one function - especially when considering looking over a few subsequent function passes.

Thanks!

llvm-extract?

Oh. duh. thanks :slight_smile: