[PATCH] D83519: [NewPM] Support optnone under new pass manager

Arthur Eubanks via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 9 18:43:36 PDT 2020


aeubanks marked an inline comment as done.
aeubanks added inline comments.


================
Comment at: llvm/include/llvm/IR/PassInstrumentation.h:150
     for (auto &C : Callbacks->BeforePassCallbacks)
-      ShouldRun &= C(Pass.name(), llvm::Any(&IR));
+      ShouldRun &= C(Pass.name(), Pass.isRequired(), llvm::Any(&IR));
     return ShouldRun;
----------------
aeubanks wrote:
> ychen wrote:
> > Could we do this to not changing the callback API?
> > `ShouldRun &= C(Pass.name(), llvm::Any(&IR)) || Pass.isRequired();`
> Each pass instrumentation should decide whether or not to run the pass based on whether or not the pass is required or optional. An optional pass may still be run, (which should be the case for the vast majority of instances).
> 
> For example, the optnone would only care if a pass is required or not if it sees that a function is marked optnone.
> Similarly, opt-bisect would only care if a pass is required if it's hit the bisect limit.
Sorry, now I understand what you mean, the ands and ors confused me.

I don't want to rule out the possibility of some future pass instrumentation wanting to skip even a required pass. But I am open to discussion on this point.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D83519





More information about the cfe-commits mailing list