[llvm] [DataLayout] Introduce DataLayout::getPointerAddressSize(AS) (PR #137412)

Owen Anderson via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 30 01:40:14 PDT 2025


================
@@ -3147,14 +3147,20 @@ as follows:
 ``A<address space>``
     Specifies the address space of objects created by '``alloca``'.
     Defaults to the default address space of 0.
-``p[n]:<size>:<abi>[:<pref>][:<idx>]``
+``p[n]:<size>:<abi>[:<pref>[:<idx>[:<addr>]]]``
     This specifies the *size* of a pointer and its ``<abi>`` and
     ``<pref>``\erred alignments for address space ``n``.
-    The fourth parameter ``<idx>`` is the size of the
-    index that used for address calculation, which must be less than or equal
-    to the pointer size. If not
-    specified, the default index size is equal to the pointer size. All sizes
-    are in bits. The address space, ``n``, is optional, and if not specified,
+    The fourth parameter ``<idx>`` is the size of the index that used for
+    address calculations such as :ref:`getelementptr <i_getelementptr>`.
+    It must be less than or equal to the pointer size. If not specified, the
+    default index size is equal to the pointer size.
+    The fifth parameter ``<addr>`` specifies the width of addresses in this
----------------
resistor wrote:

I don't want to get too bikeshed-y on this, but I find the pointer size vs address size terminology confusing at a glance, and I worry that we'll end up with a lot of pieces in the code base inadvertently using the wrong one.

If you feel strongly that this is the best terminology, I won't hold it up.

https://github.com/llvm/llvm-project/pull/137412


More information about the llvm-commits mailing list