[PATCH] D121566: Load pass plugins during option processing, so that plugin options are registered and live.

Michael Kruse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 16 10:10:59 PDT 2022


Meinersbur added a comment.

> Seems it uses both -load and -load-pass-plugin with legacy PM passes?

It was written with the assumption that `-load` and `load-pass-plugin` means "make the passes from the .so register in the PM". As such, they (should have) no effect until actually used (`-load` can do other things than register pass plugins). Only allowing the option corresponding to the PM actually used may help reduce user confusion, but if consequent it should also give an error if no pass from the loaded plugin was used.

Moving Polly completely to the NPM will take a while (some aspects of the NPM are still not compatible with pass plugins, or work differently needing to redesign a lot of regression tests). D45493 <https://reviews.llvm.org/D45493> only takes account for the few Polly that had equivalent NPM passes by then.

If you really want that error, I suggest to introduce a new `%loadPolly_NPM` (or similar name) that loads the NPM plugin, and `%loadPolly` to only load the legacy PM plugin.



================
Comment at: llvm/test/Feature/load_extension.ll:21-23
+; Specifying a new PM pass plugin with the old PM is an error.
+; RUN: ! opt %s %loadnewpmbye -goodbye -wave-goodbye -disable-output -enable-new-pm=0 2>&1 | FileCheck %s --check-prefix=ERROR
+; ERROR: load-pass-plugin specified with legacy PM.
----------------
Can you move all the RUN lines together at the beginning of the file? It is surprising to find another RUN line after e.g. having adapted the others.


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

https://reviews.llvm.org/D121566



More information about the llvm-commits mailing list