[PATCH] D139816: [LTO] Don't generate invalid modules if "LTOPostLink" MD already exists
Steven Wu via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 26 11:40:29 PST 2023
steven_wu added a comment.
> 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.
There are two parts of the changes in this commit. First is to add an API to allow overwriting module flag, which is generally fine. The second part is that `LTOPostLink` should be overwritten with new value. I think that is against the reason why it is set the way it is now. I am against it because:
- You didn't provide reason why it should not be a fix on the toolchain setup, like how legacy LTO API did. Any insights into the actual problem you run into will be helpful to evaluate the situation.
- I think overwrite it basically kills it function. In that case, it should just be removed.
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