Skip to content

Commit 0e31e22

Browse files
committed
[docs][OpaquePtr] Shuffle around the transition plan section
Emphasize that this is basically an attempt to remove ``PointerType::getElementType`` and ``Type::getPointerElementType()``. Add a couple more subtasks. Differential Revision: https://reviews.llvm.org/D104151
1 parent d650ccf commit 0e31e22

File tree

1 file changed

+28
-8
lines changed

1 file changed

+28
-8
lines changed

llvm/docs/OpaquePointers.rst

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,25 +91,39 @@ Transition Plan
9191
===============
9292

9393
LLVM currently has many places that depend on pointee types. Each dependency on
94-
pointee types needs to be resolved in some way or another.
94+
pointee types needs to be resolved in some way or another. This essentially
95+
translates to figuring out how to remove all calls to
96+
``PointerType::getElementType`` and ``Type::getPointerElementType()``.
9597

9698
Making everything use opaque pointers in one huge commit is infeasible. This
9799
needs to be done incrementally. The following steps need to be done, in no
98100
particular order:
99101

100102
* Introduce the opaque pointer type
101103

102-
* Various ABI attributes and instructions that need a type can be changed one at
103-
a time
104+
* Already done
104105

105-
* This has already happened for many instructions like loads, stores, GEPs,
106+
* Remove remaining in-tree users of pointee types
107+
108+
* There are many miscellaneous uses that should be cleaned up individually
109+
110+
* Some of the larger use cases are mentioned below
111+
112+
* Various ABI attributes and instructions that rely on pointee types need to be
113+
modified to specify the type separately
114+
115+
* This has already happened for all instructions like loads, stores, GEPs,
106116
and various attributes like ``byval``
107117

108-
* Fix up existing in-tree users of pointee types to not rely on LLVM pointer
109-
pointee types
118+
* More cases may be found as work continues
110119

111-
* Specifically ``PointerType::getElementType`` and
112-
``Type::getPointerElementType()``
120+
* Remove calls to and deprecate ``IRBuilder`` methods that rely on pointee types
121+
122+
* For example, some of the ``IRBuilder::CreateGEP()`` methods use the pointer
123+
operand's pointee type to determine the GEP operand type
124+
125+
* Some methods are already deprecated with ``LLVM_ATTRIBUTE_DEPRECATED``, such
126+
as some overloads of ``IRBuilder::CreateLoad()``
113127

114128
* Allow bitcode auto-upgrade of legacy pointer type to the new opaque pointer
115129
type (not to be turned on until ready)
@@ -123,9 +137,15 @@ particular order:
123137

124138
* This is mostly Clang, see ``clang::CodeGen::Address::getElementType()``
125139

140+
* Figure out how to name overloaded intrinsics with pointer parameters
141+
142+
* See ``getMangledTypeStr()``
143+
126144
* Add option to internally treat all pointer types opaque pointers and see what
127145
breaks, starting with LLVM tests, then run Clang over large codebases
128146

147+
* We don't want to start mass-updating tests until we're fairly confident that opaque pointers won't cause major issues
148+
129149
* Replace legacy pointer types in LLVM tests with opaque pointer types
130150

131151
Frontend Migration Steps

0 commit comments

Comments
 (0)