[llvm] [StandardInstrumentation] Add YieldCallback to NewPM (PR #86561)

via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 25 13:20:06 PDT 2024


annamthomas wrote:

@aeubanks I'm not sure I understand.  If end users of LLVM have a yield callback implemented, this something can be like "interrupt a compilation that is going on since it consumes too much memory" or "interrupt a compilation if it takes too much compile time and figure out why". We can add as many "pathological checks" as needed to decide what to do with a compile. 

For example, in our case, we have some checks to do memory consumption  instead of relying on mallinfo/mallinfo2 (which is buggy in older versions) to decide if a compilation is consuming too much memory. 

When you tie LLVM to something like a JIT (our use case), having a yield callback gives more functionality to drop compilations which have pathological behaviour and even figure out what these pathological behaviour is, so that we crash with artifacts we need. Is the problem with "yield" that it is open ended? My hope was that once codegen moves to NewPM, we will also have these yield callback after every pass (rather than after function/module pass as it is now). 




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


More information about the llvm-commits mailing list