[Polly] Add support for -polly-dump-before/after with NPM.

The new pass manager does not allow adding module passes at the
-polly-position=before-vectorizer extension point. Introduce a
DumpFunctionPass that dumps only current function. In contrast to the
legacy pass manager's -polly-dump-before, each function will be dumped
into its own file. -polly-dump-before-file is still not supported.

The DumpFunctionPass uses llvm::CloneModule to copy the current function
into a new module and then write it into a file.

GitOrigin-RevId: 9cfab5e2491ec1fbf8a3055453b3da08ecacc6a6
6 files changed