[PATCH] D105321: [Bitcode][OpaquePtr] Remove usages of PointerType's getElementType()

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 21 13:07:14 PDT 2021


dblaikie added a comment.

In D105321#2892080 <https://reviews.llvm.org/D105321#2892080>, @aeubanks wrote:

> A non-opaque pointer already has its pointee type available, there's no reason to have a separate map.
>
> I was thinking, maybe we should temporarily put aside the goal of removing the pointee type from `PointerType` so that the bitcode upgrade is easier to implement. So we'd keep things mostly as they are in BitcodeReader with calls to `getElementType()`, but we'd have a pass immediately after reading the entire bitcode file that makes all pointer types opaque. This seems very doable and hopefully not complicated.
>
> Then in the future, after the opaque pointer transition, we can consider removing the pointee type and having the Value -> pointee type map in BitcodeReader if we really want to remove the pointee type field in `PointerType`.

Adding a transformation pipeline (or is there already a pipeline in use there, that you're proposing adding a pass to?) after bitcode reading seems like non-trivial complexity/technical debt to incur if we can write the code we would like to have in the future (the one that doesn't involve keeping a pointee type field on PointerType) now.

What's the advantage to not writing the code we'd want in the future, today?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D105321



More information about the llvm-commits mailing list