[PATCH] D47858: [New PM] Introducing PassInstrumentation framework

Fedor Sergeev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 3 14:07:32 PDT 2018


fedor.sergeev added inline comments.


================
Comment at: include/llvm/IR/PassManager.h:709
+  PassInstrumentation<IRUnitT>
+  getPassInstrumentation(IRUnitT &IR, std::tuple<ArgTs...> Args,
+                         llvm::index_sequence<Ns...>) {
----------------
philip.pfaffe wrote:
> fedor.sergeev wrote:
> > philip.pfaffe wrote:
> > > Are you ever actually calling this, except through the indirection above?
> > Any suggestions on how to simplify it?
> > This unpacker thing is the only way I figured to get Ns == sizeof(ExtraArgTs) and not sizeof(ArgTs).
> You can do Ns == sizeof...(ExtraArgTs), but you're not actually using that here?
This is exactly a purpose of these two getPassInstrumentation methods that take tuple.
See in PassManager::run() :
    PassInstrumentation<IRUnitT> PI =
        AM.getPassInstrumentation(IR, std::tuple<ExtraArgTs...>(ExtraArgs...));

Here ExtraArgTs are PassManager's ExtraArgTs and they do not match AnalysisManager's ExtraArgTs.
I need to take PassManager's ExtraArgs, deduce AnalysisManager's ExtraArgTs (different ones) from AM parameter.
This deduction is what first helper is for.
And then it calls a second helper that takes first N arguments from tuple.


Repository:
  rL LLVM

https://reviews.llvm.org/D47858





More information about the llvm-commits mailing list