[PATCH] D120471: [Bitcode] Fully support opaque pointer auto upgrade

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 24 04:02:06 PST 2022


nikic created this revision.
nikic added a reviewer: opaque-pointers.
Herald added subscribers: dexonsmith, hiraditya.
nikic requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This completes the propagation of type IDs through bitcode reading, and switches remaining uses of `getPointerElementType()` to use contained type IDs.

The main new thing here is that sometimes we need to create a type ID for a type that was not explicitly encoded in bitcode (or we don't know its ID). For such types we create a "virtual" type ID, which is cached based on the type and the contained type IDs. Luckily, we generally only need zero or one contained type IDs, and in the one case where we need two, we can get away with not including it in the cache key.

With this change, we pass the entirety of llvm-test-suite at `O3` with opaque pointers.


https://reviews.llvm.org/D120471

Files:
  llvm/lib/Bitcode/Reader/BitcodeReader.cpp
  llvm/test/Bitcode/case-ranges-3.3.ll
  llvm/test/Bitcode/function-local-metadata.3.5.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D120471.411067.patch
Type: text/x-patch
Size: 33562 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220224/ad91e3be/attachment.bin>


More information about the llvm-commits mailing list