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

Arthur Eubanks via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 25 14:15:22 PDT 2024


aeubanks wrote:

I'm saying that your use case makes sense, but I'd move away specifically from `LLVMContext::yield` and just directly use your own custom pass instrumentation (which you can register when creating a `PassBuilder`, e.g. [like this](https://github.com/llvm/llvm-project/blob/36713a47c8fea0732bcb798ffba4e7c5d22d19f3/llvm/tools/opt/NewPMDriver.cpp#L425)).

Basically instead of this PR, have your downstream add a pass instrumentation that does the JIT'y thing you want (aka call the same thing your current yield callback calls). That way you get more guarantees on when it's called (after every pass), rather than `LLVMContext::yield`'s "we might never call this" [note](https://github.com/llvm/llvm-project/blob/36713a47c8fea0732bcb798ffba4e7c5d22d19f3/llvm/include/llvm/IR/LLVMContext.h#L274).

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


More information about the llvm-commits mailing list