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

Philip Pfaffe via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 3 14:25:52 PDT 2018


philip.pfaffe added inline comments.


================
Comment at: include/llvm/IR/PassManager.h:709
+  PassInstrumentation<IRUnitT>
+  getPassInstrumentation(IRUnitT &IR, std::tuple<ArgTs...> Args,
+                         llvm::index_sequence<Ns...>) {
----------------
fedor.sergeev wrote:
> 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.
Right! Looks like i missed the difference between ArgTs and ExtraArgTs.


Repository:
  rL LLVM

https://reviews.llvm.org/D47858





More information about the llvm-commits mailing list