[PATCH] D144685: [LangRef] Correct value ranges for address space, vector, and float bit sizes.

Michael Liao via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 23 18:54:59 PST 2023


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGfe6ca5468253: [LangRef] Correct value ranges for address space, vector, and float bit sizes. (authored by hliao).

Changed prior to commit:
  https://reviews.llvm.org/D144685?vs=500013&id=500039#toc

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D144685

Files:
  llvm/docs/LangRef.rst
  llvm/lib/IR/DataLayout.cpp
  llvm/test/Assembler/invalid-datalayout17.ll
  llvm/test/Assembler/invalid-datalayout4.ll


Index: llvm/test/Assembler/invalid-datalayout4.ll
===================================================================
--- llvm/test/Assembler/invalid-datalayout4.ll
+++ llvm/test/Assembler/invalid-datalayout4.ll
@@ -1,3 +1,3 @@
 ; RUN: not llvm-as < %s 2>&1 | FileCheck %s
 target datalayout = "p16777216:64:64:64"
-; CHECK: Invalid address space, must be a 24bit integer
+; CHECK: Invalid address space, must be a 24-bit integer
Index: llvm/test/Assembler/invalid-datalayout17.ll
===================================================================
--- llvm/test/Assembler/invalid-datalayout17.ll
+++ llvm/test/Assembler/invalid-datalayout17.ll
@@ -1,3 +1,3 @@
 ; RUN: not llvm-as < %s 2>&1 | FileCheck %s
 target datalayout = "i16777216:16:16"
-; CHECK: Invalid bit width, must be a 24bit integer
+; CHECK: Invalid bit width, must be a 24-bit integer
Index: llvm/lib/IR/DataLayout.cpp
===================================================================
--- llvm/lib/IR/DataLayout.cpp
+++ llvm/lib/IR/DataLayout.cpp
@@ -305,7 +305,7 @@
         if (Error Err = getInt(Tok, AddrSpace))
           return Err;
       if (!isUInt<24>(AddrSpace))
-        return reportError("Invalid address space, must be a 24bit integer");
+        return reportError("Invalid address space, must be a 24-bit integer");
 
       // Size.
       if (Rest.empty())
@@ -571,7 +571,7 @@
   // an assert. See D67400 for context.
   assert(Log2(ABIAlign) < 16 && Log2(PrefAlign) < 16 && "Alignment too big");
   if (!isUInt<24>(BitWidth))
-    return reportError("Invalid bit width, must be a 24bit integer");
+    return reportError("Invalid bit width, must be a 24-bit integer");
   if (PrefAlign < ABIAlign)
     return reportError(
         "Preferred alignment cannot be less than the ABI alignment");
Index: llvm/docs/LangRef.rst
===================================================================
--- llvm/docs/LangRef.rst
+++ llvm/docs/LangRef.rst
@@ -2770,23 +2770,23 @@
     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,
     denotes the default address space 0. The value of ``n`` must be
-    in the range [1,2^23).
+    in the range [1,2^24).
 ``i<size>:<abi>[:<pref>]``
     This specifies the alignment for an integer type of a given bit
-    ``<size>``. The value of ``<size>`` must be in the range [1,2^23).
+    ``<size>``. The value of ``<size>`` must be in the range [1,2^24).
     ``<pref>`` is optional and defaults to ``<abi>``.
     For ``i8``, the ``<abi>`` value must equal 8,
     that is, ``i8`` must be naturally aligned.
 ``v<size>:<abi>[:<pref>]``
     This specifies the alignment for a vector type of a given bit
-    ``<size>``. The value of ``<size>`` must be in the range [1,2^23).
+    ``<size>``. The value of ``<size>`` must be in the range [1,2^24).
     ``<pref>`` is optional and defaults to ``<abi>``.
 ``f<size>:<abi>[:<pref>]``
     This specifies the alignment for a floating-point type of a given bit
     ``<size>``. Only values of ``<size>`` that are supported by the target
     will work. 32 (float) and 64 (double) are supported on all targets; 80
     or 128 (different flavors of long double) are also supported on some
-    targets. The value of ``<size>`` must be in the range [1,2^23).
+    targets. The value of ``<size>`` must be in the range [1,2^24).
     ``<pref>`` is optional and defaults to ``<abi>``.
 ``a:<abi>[:<pref>]``
     This specifies the alignment for an object of aggregate type.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D144685.500039.patch
Type: text/x-patch
Size: 3539 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230224/bf8e4b69/attachment.bin>


More information about the llvm-commits mailing list