Some targets may add required passes via
TargetMachine::registerPipelineStartEPCallback(). We need to run those even
under -O0. As an example, BPFTargetMachine adds
BPFAbstractMemberAccessPass, a required pass.
The legacy PM adds EP_EarlyAsPossible and EP_EnabledOnOptLevel0 for -O0.
We match EP_EarlyAsPossible here. Currently EP_EnabledOnOptLevel0 is
only used for coroutine and sanitizer passes, which can be manually
added (as is currently done). (This can be revised in the future if
deemed necessary)
Tests are a continuation of those added in
https://reviews.llvm.org/D89083.