[PATCH] D127729: [Bitcode] Support expanding constant expressions into instructions

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 20 06:06:41 PDT 2022


nikic updated this revision to Diff 438364.
nikic edited the summary of this revision.
nikic added a comment.

Fix uselistorder preservation. In the end, this largely amounted to removing a lot of the special handling around global values we previously had. In orderModule(), we now visit globals in the same order they get initialized (which is reverse order) and also visit the initializers while doing so. Additionally, we now go through BitcodeConstant for all non-leaf constants, even those that wouldn't strictly require it (no_cfi, dso_local and blockaddress). This makes sure that we don't get a different uselistorder for just these special cases, which would get really awkward to handle.

There is still a remaining issue in this patch, because there are some getValueFwdRef() calls from MetadataLoader, which also need to materialize constant expressions.


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

https://reviews.llvm.org/D127729

Files:
  llvm/lib/Bitcode/Reader/BitcodeReader.cpp
  llvm/lib/Bitcode/Reader/ValueList.cpp
  llvm/lib/Bitcode/Reader/ValueList.h
  llvm/lib/Bitcode/Writer/ValueEnumerator.cpp
  llvm/test/Bitcode/constexpr-to-instr.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D127729.438364.patch
Type: text/x-patch
Size: 85666 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220620/393803d2/attachment-0001.bin>


More information about the llvm-commits mailing list