[flang-commits] [PATCH] D129156: Add -fpass-plugin option to Flang

Tarun Prabhu via Phabricator via flang-commits flang-commits at lists.llvm.org
Fri Jul 8 15:26:54 PDT 2022


tarunprabhu added a comment.

It looks like LLVM's HelloWorld pass with the new pass manager is not built as a separate shared object. LLVMHello.so uses the old pass manager and cannot be loaded using -fpass-plugin.

A quick search for "-fpass-plugin" in `clang/test` didn't seem to yield anything so I don't know if this is actually tested there.

I would like to make a case for keeping the PrintFunctionNamesLLVMPass example for the following reasons:

- It can be used to explicitly test -fpass-plugin.

- It is a full working example of how to write an out-of-tree pass that can be loaded with -fpass-plugin (on further consideration, I disagree with your claim that it is an in-tree pass. It can be built independently of Flang/LLVM. Shouldn't that make it out-of-tree by definition? If not, even the PrintFunctionNames plugin would then become "in-tree").

The counter-arguments to this would be that the pass is not strictly related to flang, and probably ought to belong elsewhere in the LLVM tree. We could add it to flang now and move it after consultation with the broader community. As far as I have been able to tell, there is no full example of building a complete out-of-tree LLVM pass in the official documentation.

The other consideration is that there needs to be a way to ensure that the -fpass-plugin test is marked as "expected-to-fail" on Windows. I don't know how to do that but hopefully someone else knows.


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

https://reviews.llvm.org/D129156



More information about the flang-commits mailing list