[PATCH] D71903: [Coroutines][6/6] Clang schedules new passes

Brian Gesiak via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 3 19:54:11 PST 2020


modocache added a comment.

I'm currently working on ensuring that CGSCC optimizations are rerun to optimize coroutine funclets -- the primary feedback I received on this and on D71899 <https://reviews.llvm.org/D71899> -- but I just realized I didn't respond to one comment on this set of reviews, from @junparser:

> There is another issue we should consider: clang is crashed when compile coroutine with -disable-llvm-passes and output an object file.

It's always been the case, since the coroutine intrinsics and passes were first added to LLVM, that attempting to codegen without first running coroutine passes would cause a crash during instruction selection. So `clang -Xclang -disable-llvm-passes -c` has always crashed Clang during LLVM ISel, as it does in this example that uses Clang 9.0.0 and the legacy pass manager: https://godbolt.org/z/Mj2R5G

Personally I'm of the opinion that this is less than ideal... I may be wrong, but I don't think there are very many other C++ features that *require* Clang to run LLVM passes (perhaps the `always_inline` attribute requires LLVM passes to be run for correctness? I'm not sure). So I would like to see this eventually addressed somehow.

> Is it reasonable to run coroutine passes even -disable-llvm-passes is enabled?

My personal opinion is that this would not be reasonable. The option `-disable-llvm-passes` should, from my point of view, prevent any and all LLVM passes from being run. I also frequently make use of this option when debugging the LLVM IR being output for C++ coroutines code, so if `-disable-llvm-passes` didn't disable coroutines passes, I'd need another option that did (`-disable-llvm-passes-no-really-even-coroutine-passes-them-too` 😅).

All this being said, considering this behavior has existed in the legacy PM since day one, I think we should start a separate discussion on if/how to change that behavior. I'm working on an update for these patches to address funclet optimization, but the update will not change the fact that coroutine passes are not run when `-disable-llvm-passes` is specified. I think that's an orthogonal issue.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D71903/new/

https://reviews.llvm.org/D71903





More information about the cfe-commits mailing list