[flang-commits] [flang] [flang][Driver] Add support for -mllvm -print-pipeline-passes (PR #106141)
Tom Eccles via flang-commits
flang-commits at lists.llvm.org
Wed Aug 28 02:32:28 PDT 2024
tblah wrote:
> > Is it very different and is the former the preferred format?
>
> In the second case, the output can be passed as is to the `-passes` option of `opt`. This is potentially useful to folks who want to experiment with a sequence of passes that is very similar to the compiler's defaults with potential additions/deletions. The former is "friendlier" and provides insights into analysis invalidations which is interesting in its own right. I don't think one is "more correct" or "better" than the other. I think having both is valuable.
For me at least, these two different use cases justify two different flags. It would be useful to have something to pass straight to `opt`.
> > Is "stopping" the compilation the desired behaviour here?
>
> My only concern with changing the behavior that is that we would have two frontends that are part of the same project with different behavior. It looks like they stopped compilation in `clang` to be consistent with the behavior of `opt`.
I agree that whatever we do should match clang (or clang should be adapted to match us).
> If tangling this with an "internal" LLVM command line option is objectionable (and I agree that it feels messy) we could make this a separate, first class option in `flang`. Would the `clang` folks be open to a similar change?
In my opinion, support for `-mllvm` and `-mmlir` options is long established and comes in useful for people working on both frontends. All this PR is doing is enabling another of these developer options that already exists inside of clang. We are not careful about what `-mllvm` options are added when new patches add new `llvm::cl::opt` instances - I always considered things hidden behind `-mllvm` as outside of the user interface.
This LGTM, but don't merge without agreement from Andrzej
https://github.com/llvm/llvm-project/pull/106141
More information about the flang-commits
mailing list