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

Evgeniy via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 4 02:13:11 PDT 2022


ebrevnov added a comment.

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.


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