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

Pierre van Houtryve via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 12 12:24:16 PST 2022


Pierre-vh added a comment.

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

> Can you indicate what is your motivation for such change? From the original change, the flag is to indicate whether the post link optimization is done or not, and overwriting it is just hiding the actual problem of post link is run twice (so perhaps one of the run is done without the full information, thus the result is not correct).

I'm not sure if running the post-link optimization twice is an issue in itself. I assumed it wasn't (I don't see why running the passes multiple times would be an issue?) and that's why I proposed this change, but if we determine that running post-link optimizations twice is an issue/something undesirable, then it's fine for me to put a diagnostic or something else (e.g. skip the pipeline if the flag is present) instead.
For instance, a case where this came up involved re-running IR obtained from -save-temps through LLD, which crashed due to the verification error (duplicate flag).

The motivation is just to prevent an avoidable verifier error. Whether we do it by adding the flag more carefully, or by checking for its presence earlier and exiting more elegantly, I don't mind

(cc @arsenm)


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