[PATCH] D143229: [FunctionImporter] Add flag to disable upgrading debug info
Adrian Prantl via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 8 13:36:16 PST 2023
aprantl added a comment.
In D143229#4107958 <https://reviews.llvm.org/D143229#4107958>, @mehdi_amini wrote:
> Looking at the implementation:
>
> 1. Contrary to the name of the API, this does not seem to "upgrade" anything: it merely drops outdated debug info. (Am I missing something?)
> 2. This runs the verifier but does not fail verification on debug info related issue, instead it'll drop metadata when something is wrong there.
>
> So are we re-running the IR verifier independently? And if we don't what kind of inconsistency would we be setting up?
The name "upgrade" comes from a time when regularly bumped `DEBUG_METADATA_VERSION`. Back then it "upgraded" older debug info formats by dropping the outdated metadata. In the more recent past we are trying to make debug info upgradeable in the bit code reader. Unfortunately, because debug info metadata is a cyclic graph we keep finding bugs where the metadata produced by older versions of LLVM and/or 3rd party frontends is malformed in a way that causes problems (crashes, infinite loops, ...) with newer version of LLVM. Whenever we find such a problem we improve the IR Verifier to detect the malformed IR.
Because of this, the upgrade function insists on running the Verifier. If it finds malformed debug info it will perform an "upgrade" by dropping the malformed debug info.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D143229/new/
https://reviews.llvm.org/D143229
More information about the llvm-commits
mailing list