I’ve recently started adding code-gen support in Flang’s new compiler driver. As Flang leverages some of MLIR’s standard passes for code-generation, this involves a bit of integration. One item that we are currently discussing are command line options .
More specifically, MLIR provides PassPipelineCLParser to register various standard pass options. IIUC,
PassPipelineCLParser uses CommandLine, but in Flang we use
clangDriver to manage command-line options for us. That library builds on top of OptTable. We probably should avoid mixing different APIs for command-line options (
PassPipelineCLParse is not really an option in Flang.
What would be the recommended approach to make MLIR pass options available in the Flang driver? Are there any other tools that don’t use
llvm::cl but still get access to MLIR pass options? I’m completely new to MLIR, so might be missing something obvious here.
EDIT: After posting this I realised that this is somewhat similar to Clang and LLVM passes. I’m guessing that we should basically be adding