[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 15:52:15 PDT 2020


aeubanks created this revision.
Herald added a reviewer: bollu.
Herald added subscribers: llvm-commits, cfe-commits, jfb, dexonsmith, steven_wu, hiraditya.
Herald added projects: clang, LLVM.

This uses pass instrumentation callbacks to skip optional passes.
PassInfoMixin now declares that passes inheriting from it are by default
optional. Using RequiredPassInfoMixin overrides the pass to be required.
The new OptNoneInstrumentation is part of StandardInstrumentations.

The feature of skipping optional passes for optnone functions under NPM
is gated on a -enable-npm-optnone flag. Currently it is by default
false. That is because we still need to mark all required passes to be
required. Otherwise optnone functions will start behaving incorrectly.
After that is done in following changes, we can remove the flag and
always enable this.

All adaptors/managers must be required, since the pass(es) they are
wrapping may be required.

In the future, opt-bisect will use this same mechanmism of determining
which passes are required/optional.

Depends on D83498 <https://reviews.llvm.org/D83498>.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D83519

Files:
  clang/lib/CodeGen/BackendUtil.cpp
  llvm/include/llvm/Analysis/CGSCCPassManager.h
  llvm/include/llvm/IR/PassInstrumentation.h
  llvm/include/llvm/IR/PassManager.h
  llvm/include/llvm/IR/PassManagerInternal.h
  llvm/include/llvm/Passes/StandardInstrumentations.h
  llvm/include/llvm/Transforms/Scalar/LoopPassManager.h
  llvm/lib/IR/PassTimingInfo.cpp
  llvm/lib/LTO/LTOBackend.cpp
  llvm/lib/Passes/StandardInstrumentations.cpp
  llvm/test/Feature/optnone-opt.ll
  llvm/tools/opt/NewPMDriver.cpp
  llvm/unittests/IR/PassBuilderCallbacksTest.cpp
  polly/include/polly/ScopPass.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D83519.276860.patch
Type: text/x-patch
Size: 23684 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200709/ac42227b/attachment-0001.bin>


More information about the cfe-commits mailing list