[NPM] Move more O0 pass building into PassBuilder
authorArthur Eubanks <aeubanks@google.com>
Mon, 16 Nov 2020 20:48:42 +0000 (12:48 -0800)
committerArthur Eubanks <aeubanks@google.com>
Thu, 19 Nov 2020 19:22:23 +0000 (11:22 -0800)
commit72badbcdccd11c12555147d48dee4a776f5da87d
treece721b9c887f6292d908068f352babaeeeb7c3d4
parent314a0d73a8444e3b0c1a0d0de7d615d9448af1c9
[NPM] Move more O0 pass building into PassBuilder

This moves handling of alwaysinline, coroutines, matrix lowering, PGO,
and LTO-required passes into PassBuilder. Much of this is replicated
between Clang and opt. Other out-of-tree users also replicate some of
this, such as Rust [1] replicating the alwaysinline, LTO, and PGO
passes.

The LTO passes are also now run in
build(Thin)LTOPreLinkDefaultPipeline() since they are semantically
required for (Thin)LTO.

[1]: https://github.com/rust-lang/rust/blob/f5230fbf76bafd86ee4376a0e26e551df8d17fec/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp#L896

Reviewed By: tejohnson

Differential Revision: https://reviews.llvm.org/D91585
12 files changed:
clang/lib/CodeGen/BackendUtil.cpp
llvm/include/llvm/Passes/PassBuilder.h
llvm/lib/Passes/PassBuilder.cpp
llvm/test/Other/new-pass-manager.ll
llvm/test/Other/new-pm-O0-defaults.ll [new file with mode: 0644]
llvm/test/Other/new-pm-defaults.ll
llvm/test/Other/new-pm-pgo-O0.ll
llvm/test/Other/new-pm-thinlto-defaults.ll
llvm/test/Other/new-pm-thinlto-prelink-pgo-defaults.ll
llvm/test/Other/new-pm-thinlto-prelink-samplepgo-defaults.ll
llvm/test/Transforms/CanonicalizeAliases/canonicalize.ll
llvm/test/Transforms/NameAnonGlobals/rename.ll