[NewPM] Support optnone under new pass manager
authorArthur Eubanks <aeubanks@google.com>
Tue, 21 Jul 2020 16:48:22 +0000 (09:48 -0700)
committerArthur Eubanks <aeubanks@google.com>
Tue, 21 Jul 2020 16:53:43 +0000 (09:53 -0700)
commitb13b85818218aa17cee4c987cbf835208c06cf10
tree2bce9c98cf614ea5585d4351b1c3b4c726008f13
parent98efa3d57f0a38c9cd5433640a9abe6e7d9b7513
[NewPM] Support optnone under new pass manager

OptNoneInstrumentation is part of StandardInstrumentations. It skips
functions (or loops) that are marked optnone.

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 having incorrect
semantics.  After that is done in following changes, we can remove the
flag and always enable this.

Reviewed By: ychen

Differential Revision: https://reviews.llvm.org/D83519
clang/lib/CodeGen/BackendUtil.cpp
llvm/include/llvm/Passes/StandardInstrumentations.h
llvm/lib/LTO/LTOBackend.cpp
llvm/lib/Passes/StandardInstrumentations.cpp
llvm/test/Feature/optnone-opt.ll
llvm/tools/opt/NewPMDriver.cpp