[PATCH] D26831: [LangRef] Update the TBAA section

Manman Ren via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 20 11:27:29 PST 2016


manmanren added a comment.

Thanks for working on this, Sanjoy!

Manman



================
Comment at: docs/LangRef.rst:4440
+*Scalar type descriptors* are a subset of struct type descriptors that
+contain only one type at offset 0, which is either itself a scalar type
+descriptor or the TBAA root.  The latter case denotes a scalar type
----------------
I think we should not call scalar type descriptors as a subset of struct type descriptors. The 2nd field for scalar type descriptors means the parent node. Internally we have an offset field to make alias analysis easy.


================
Comment at: docs/LangRef.rst:4453
+instruction can be used to compute the set of aliasing access tags by this
+algorithm:
+
----------------
Do we actually calculate this set in the source code? It is probably easier to understand if you provide a high-level description instead of the pseudo code. There are descriptions in the comments of TypeBasedAliasAnalysis.cpp. 


================
Comment at: docs/LangRef.rst:4561
+like for scalar type descriptors, is for ergonomics -- LLVM only cares that
+it finds an ``MDString`` there.  After this the name, the struct type
+descriptors have a sequence of alternating ``MDNode`` and ``ConstantInt``
----------------
After this the name --> After the name


================
Comment at: docs/LangRef.rst:4563
+descriptors have a sequence of alternating ``MDNode`` and ``ConstantInt``
+operands.  The 2N + 1 th operand, an ``MDNode`` denotes a contained field,
+and the 2N + 1 th operand, a ``ConstantInt`` is the offset of the said
----------------
The 2N th operand


================
Comment at: docs/LangRef.rst:4565
+and the 2N + 1 th operand, a ``ConstantInt`` is the offset of the said
+constant field.  The offsets must be in non-decreasing order.  We can
+determine the TBAA root a struct type descriptor belongs to by recursing
----------------
constant field --> contained field


================
Comment at: docs/LangRef.rst:4577
+being an ``MDString`` and the second operand being another ``MDNode`` is
+treated as having a constant integer 0 as an implicit third operand.  We
+can determine the TBAA root a scalar type descriptor belongs to by
----------------
I actually prefer the descriptions for scalar type descriptors before this patch.
The first field is an identity field. It is a metadata string, which uniquely identifies the type. The second field identifies the type's parent node in the tree. The third field is optional...

Can we talk about scalar type descriptors first, so when talking about struct type descriptors, we can refer to scalar type descriptors?
Such as here ------
The first operand is an ``MDString`` which, like for scalar type descriptors


https://reviews.llvm.org/D26831





More information about the llvm-commits mailing list