[llvm] [Backend] Add clearSubtargetMap API for TargetMachine. (PR #112383)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 21 16:47:10 PDT 2024


arsenm wrote:

> > I mean the lazy construction of subtargets is an issue.
> 
> I don't think lazy construction itself is an issue here: regardless if it's lazy or not, multiple instance of a target machine is going to keep subtargets alive, thus memory footprint is going to stay high for longer than needed.

It would be for parallelization. What I am advocating for is making so you can do parallel compilations with a single TargetMachine instance, not one per thread. 

Is the memory footprint of subtargets really so large? I thought they were pretty tiny 

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


More information about the llvm-commits mailing list