[PATCH] D120781: [IRLinker] materialize Functions before moving any

Nick Desaulniers via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 1 16:58:15 PST 2022


nickdesaulniers added a comment.

In D120781#3353144 <https://reviews.llvm.org/D120781#3353144>, @dexonsmith wrote:

> Thanks for working on this; it's pretty hairy.
>
>> This confuses BitcodeReader, which cannot disambiguate whether a
>> blockaddress is referring to a function which has not yet been parsed
>> ("materialized") or is simply empty because its body was spliced out.
>
> Another way to solve this would be to mark the function somehow (either intrusively, somehow, or by adding it to a set / map). Can you contrast with that approach?

BitcodeReader could maintain a set of all functions it's imported, so that it could do the right thing here (rather than assume a function being empty means not yet parsed);
https://github.com/llvm/llvm-project/blob/1e16272ba793e5a6e7308898ecf6ef0dc99e2ad3/llvm/lib/Bitcode/Reader/BitcodeReader.cpp#L3037-L3066


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D120781



More information about the llvm-commits mailing list