[PATCH] D137149: Use PassGate from LLVMContext if any otherwise global one

Arthur Eubanks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 4 12:07:19 PDT 2022


aeubanks added a comment.

In D137149#3907610 <https://reviews.llvm.org/D137149#3907610>, @ebrevnov wrote:

> In D137149#3906302 <https://reviews.llvm.org/D137149#3906302>, @aeubanks wrote:
>
>> thanks for the context, agreed that using the LLVMContext's pass gate is what's intended
>>
>> the cleanest way IMO is to get the IR's LLVMContext (e.g. via `unwrapModule(IR, /*Force*/ true).getContext()`) and use the pass gate from there, rather than collect the pass gate at the beginning. WDYT of something like https://reviews.llvm.org/D137358?
>
> Totally agree. Just didn't realize we already can access the module. Integrated suggested approach except caching part. I think caching is unnecessary complication in this case.

then you start running into compile time issues: https://llvm-compile-time-tracker.com/compare.php?from=66b830889d9bc4bfc58aa1ea47d1b3a7cbee7c5c&to=b7972184a59c0aa0b634de653be1c1363e980f4c&stat=instructions:u
previously we didn't call `OptPassGateInstrumentation::registerCallbacks` and run these callbacks before every pass if `-opt-bisect-limit` was enabled, with this patch we do. caching mitigates a lot of that. but even better is if you can somehow go back to not calling `OptPassGateInstrumentation::registerCallbacks` when we're not using opt-bisect. With your per-LLVMContext opt-bisect, do you still respect `-opt-bisect-limit`, or are you manually setting pass gates? if you're still using `-opt-bisect-limit`, we can go back to checking if it's set and skipping `OptPassGateInstrumentation::registerCallbacks` and we don't have to worry about caching.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D137149/new/

https://reviews.llvm.org/D137149



More information about the llvm-commits mailing list