[PATCH] D139816: [LTO] Don't generate invalid modules if "LTOPostLink" MD already exists

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 28 05:46:48 PST 2023


arsenm added a comment.

In D139816#4083672 <https://reviews.llvm.org/D139816#4083672>, @steven_wu wrote:

>> I think this violates a core tenet of being a modular, reusable IR. It shouldn't be wrong to run a pass twice. It certainly shouldn't error by way of verifier error
>
> There are plenty of verifiers that will error on wrong usage of IR. And there is a reason why the ModuleFlag has a `Behavior` field and it will just error out when it sees incompatible values. This is conceptually not different.

This is conceptually very different. Verifier errors are for malformed IR by construction. It's for catching API errors and bugs in compiler passes, not tool usage. By running any combination of tools or passes, it should not be possible to hit a verifier error.

I don't really see the reason to have the verified check this at all, can we just drop it? I can see the use of emitting an informative module flag but this doesn't need to be semantically enforced. It is still possible to introduce new code after this point in ways that aren't wrong.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D139816



More information about the llvm-commits mailing list