Following up on D67687.
Please refer to the RFC here http://lists.llvm.org/pipermail/llvm-dev/2020-July/143309.html
CodeGenPassBuilder is the NPM counterpart of TargetPassConfig with below differences.
- Debugging features (MIR print/verify, disable pass, start/stop-before/after, etc.) living in TargetPassConfig are moved to use PassInstrument as much as possible. (Implementation also lives in TargetPassConfig.cpp)
- TargetPassConfig is a polymorphic base (virtual inheritance) to build the target-dependent pipeline whereas CodeGenPassBuilder is the CRTP base/helper to implement the target-dependent pipeline. The motivation is flexibility for targets to customize the pipeline, inlining opportunity, and fits the overall NPM value semantics design.
- TargetPassConfig is a legacy immutable pass to declare hooks for targets to customize some target-independent codegen layer behavior. This is partially ported to TargetMachine::options. The rest, such as createMachineScheduler/createPostMachineScheduler, are left out for now. They should be implemented in LLVMTargetMachine in the future.
clang-tidy: warning: header guard does not follow preferred style [llvm-header-guard]
not useful