Some targets may add required passes via
TargetMachine::registerPassBuilderCallbacks(). We need to run those even
under -O0. As an example, BPFTargetMachine adds
BPFAbstractMemberAccessPass, a required pass.
This also allows us to clean up BackendUtil.cpp (and out-of-tree Rust
usage of the NPM) by allowing us to share added passes like coroutines
and sanitizers between -O0 and other optimization levels.
Tests are a continuation of those added inSince callbacks may end up not adding passes, we need to check if the
https://reviews.llvm.org/D89083.pass managers are empty before adding them, so PassManager now has an
isEmpty() function. For example, polly adds callbacks but doesn't always
In order to prevent TargetMachines from adding unadd passes in those callbacks, so this is necessary optimizationto keep
passes at -O0, TargetMachine::registerPassBuilderCallbacks() will be-debug-pass-manager tests' output from changing depending on if polly is
changed to take an Optimizenabled or not.
Tests are a continuationLevel, but that will be done separately of those added in
https://reviews.llvm.org/D89083.