diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst --- a/llvm/docs/LangRef.rst +++ b/llvm/docs/LangRef.rst @@ -3303,7 +3303,7 @@ The integer type is a very simple type that simply specifies an arbitrary bit width for the integer type desired. Any bit width from 1 -bit to 2\ :sup:`23`\ -1 (about 8 million) can be specified. +bit to 2\ :sup:`23`\ (about 8 million) can be specified. :Syntax: diff --git a/llvm/docs/ReleaseNotes.rst b/llvm/docs/ReleaseNotes.rst --- a/llvm/docs/ReleaseNotes.rst +++ b/llvm/docs/ReleaseNotes.rst @@ -59,6 +59,7 @@ * Using the legacy pass manager for the optimization pipeline is deprecated and will be removed after LLVM 14. In the meantime, only minimal effort will be made to maintain the legacy pass manager for the optimization pipeline. +* Max allowed integer type was reduced from 2^24-1 bits to 2^23 bits. Changes to building LLVM ------------------------ diff --git a/llvm/include/llvm/IR/DerivedTypes.h b/llvm/include/llvm/IR/DerivedTypes.h --- a/llvm/include/llvm/IR/DerivedTypes.h +++ b/llvm/include/llvm/IR/DerivedTypes.h @@ -49,10 +49,11 @@ /// This enum is just used to hold constants we need for IntegerType. enum { MIN_INT_BITS = 1, ///< Minimum number of bits that can be specified - MAX_INT_BITS = (1<<24)-1 ///< Maximum number of bits that can be specified + MAX_INT_BITS = (1<<23) ///< Maximum number of bits that can be specified ///< Note that bit width is stored in the Type classes SubclassData field - ///< which has 24 bits. This yields a maximum bit width of 16,777,215 - ///< bits. + ///< which has 24 bits. SelectionDAG type legalization can require a + ///< power of 2 IntegerType, so limit to the largest representable power + ///< of 2, 8388608. }; /// This static method is the primary way of constructing an IntegerType. diff --git a/llvm/test/Assembler/invalid-inttype.ll b/llvm/test/Assembler/invalid-inttype.ll --- a/llvm/test/Assembler/invalid-inttype.ll +++ b/llvm/test/Assembler/invalid-inttype.ll @@ -1,5 +1,5 @@ ; RUN: not llvm-as < %s 2>&1 | FileCheck %s -; i16777216 is the smallest integer type that can't be represented in LLVM IR -@i2 = common global i16777216 0, align 4 +; i8388609 is the smallest integer type that can't be represented in LLVM IR +@i2 = common global i8388609 0, align 4 ; CHECK: expected type diff --git a/llvm/test/Assembler/max-inttype.ll b/llvm/test/Assembler/max-inttype.ll --- a/llvm/test/Assembler/max-inttype.ll +++ b/llvm/test/Assembler/max-inttype.ll @@ -1,4 +1,4 @@ ; RUN: llvm-as < %s | llvm-dis -; i16777215 is the maximum integer type represented in LLVM IR -@i2 = common global i16777215 0, align 4 +; i838608 is the maximum integer type represented in LLVM IR +@i2 = common global i838608 0, align 4