[llvm] Revert "[IR] Add initial support for the byte type" (PR #186713)
via llvm-commits
llvm-commits at lists.llvm.org
Sun Mar 15 15:56:30 PDT 2026
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-llvm-selectiondag
@llvm/pr-subscribers-mlgo
@llvm/pr-subscribers-llvm-analysis
@llvm/pr-subscribers-backend-x86
Author: Pedro Lobo (pedroclobo)
<details>
<summary>Changes</summary>
Reverts llvm/llvm-project#<!-- -->178666 to unblock CI.
`CodeGen/X86/byte-constants.ll` is at fault.
Will look into it and hopefully fix it by tomorrow.
---
Patch is 121.12 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/186713.diff
46 Files Affected:
- (modified) llvm/docs/Frontend/PerformanceTips.rst (-13)
- (modified) llvm/docs/LangRef.rst (+9-106)
- (modified) llvm/include/llvm-c/Core.h (-68)
- (modified) llvm/include/llvm/Analysis/IR2Vec.h (+3-5)
- (modified) llvm/include/llvm/Bitcode/LLVMBitCodes.h (-4)
- (modified) llvm/include/llvm/IR/Constants.h (+16-177)
- (modified) llvm/include/llvm/IR/DataLayout.h (-11)
- (modified) llvm/include/llvm/IR/DerivedTypes.h (-44)
- (modified) llvm/include/llvm/IR/IRBuilder.h (-24)
- (modified) llvm/include/llvm/IR/Type.h (+2-39)
- (modified) llvm/include/llvm/IR/Value.def (-1)
- (modified) llvm/lib/AsmParser/LLLexer.cpp (+12-23)
- (modified) llvm/lib/AsmParser/LLParser.cpp (+9-12)
- (modified) llvm/lib/Bitcode/Reader/BitcodeReader.cpp (+2-52)
- (modified) llvm/lib/Bitcode/Writer/BitcodeWriter.cpp (+2-27)
- (modified) llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (+13-51)
- (modified) llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp (-3)
- (modified) llvm/lib/CodeGen/ValueTypes.cpp (-4)
- (modified) llvm/lib/IR/AsmWriter.cpp (+2-24)
- (modified) llvm/lib/IR/Attributes.cpp (-4)
- (modified) llvm/lib/IR/Constants.cpp (+17-290)
- (modified) llvm/lib/IR/Core.cpp (-44)
- (modified) llvm/lib/IR/DataLayout.cpp (-18)
- (modified) llvm/lib/IR/Instructions.cpp (+2-14)
- (modified) llvm/lib/IR/Intrinsics.cpp (-3)
- (modified) llvm/lib/IR/LLVMContextImpl.cpp (+1-6)
- (modified) llvm/lib/IR/LLVMContextImpl.h (-11)
- (modified) llvm/lib/IR/Type.cpp (+1-72)
- (modified) llvm/lib/IR/Verifier.cpp (+4-6)
- (modified) llvm/lib/Target/Hexagon/HexagonTargetObjectFile.cpp (-1)
- (modified) llvm/test/Analysis/IR2Vec/Inputs/reference_default_vocab_print.txt (-1)
- (modified) llvm/test/Analysis/IR2Vec/Inputs/reference_wtd1_vocab_print.txt (-1)
- (modified) llvm/test/Analysis/IR2Vec/Inputs/reference_wtd2_vocab_print.txt (-1)
- (modified) llvm/test/Assembler/2008-02-18-IntPointerCrash.ll (+1-1)
- (removed) llvm/test/Assembler/byte-invalid.ll (-73)
- (removed) llvm/test/Assembler/byte.ll (-101)
- (modified) llvm/test/Assembler/invalid-inttype.ll (+1-1)
- (removed) llvm/test/Bindings/llvm-c/byte.ll (-11)
- (modified) llvm/test/Bindings/llvm-c/echo.ll (-1)
- (modified) llvm/test/Bitcode/compatibility.ll (-2)
- (removed) llvm/test/CodeGen/X86/byte-constants.ll (-63)
- (modified) llvm/test/Verifier/atomics.ll (+2-2)
- (modified) llvm/test/tools/llvm-ir2vec/entities.ll (+36-37)
- (modified) llvm/test/tools/llvm-ir2vec/triplets.ll (+19-19)
- (modified) llvm/tools/llvm-c-test/echo.cpp (-2)
- (modified) llvm/unittests/Analysis/IR2VecTest.cpp (+14-15)
``````````diff
diff --git a/llvm/docs/Frontend/PerformanceTips.rst b/llvm/docs/Frontend/PerformanceTips.rst
index a11c8e3a16857..b81df707a31a6 100644
--- a/llvm/docs/Frontend/PerformanceTips.rst
+++ b/llvm/docs/Frontend/PerformanceTips.rst
@@ -95,19 +95,6 @@ For example, when working with boolean values, store them by zero-extending
If you do use loads/stores on non-byte-sized types, make sure that you *always*
use those types. For example, do not first store ``i8`` and then load ``i1``.
-Use byte types when manipulating raw memory
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-The byte type represents raw memory values in SSA registers. Loads and stores of
-byte types should be used when performing raw memory copies (such as ``memmove``
-and ``memcpy``). Using integer types to represent raw memory introduces type
-punning, which discards the provenance of pointers being copied.
-
-Use a byte type if a value may hold either a pointer or any other type at run
-time (and you don't know which one), or if the value may contain uninitialized
-data. For instance, if a union may hold a pointer or another type, use byte
-types to load and store the value. Otherwise, use the specific type.
-
Prefer zext over sext when legal
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst
index b0d541061d2eb..8bf66c56f82fc 100644
--- a/llvm/docs/LangRef.rst
+++ b/llvm/docs/LangRef.rst
@@ -787,8 +787,8 @@ be performed as loads and stores of the correct type since stores of other
types may not propagate the external data.
Therefore it is not legal to convert an existing load/store (or a
``llvm.memcpy`` / ``llvm.memmove`` intrinsic) of pointer types with external
-state to a load/store of an integer or byte type with the same bitwidth, as that
-may drop the external state.
+state to a load/store of an integer type with the same bitwidth, as that may drop
+the external state.
.. _globalvars:
@@ -4471,53 +4471,6 @@ Examples:
| ``i1942652`` | a really big integer of over 1 million bits. |
+----------------+------------------------------------------------+
-.. _t_byte:
-
-Byte Type
-"""""""""
-
-:Overview:
-
-The byte type represents raw memory data in SSA registers. It should be used
-when it cannot be determined whether a value holds a pointer or another type at
-run time, or if the value contains uninitialized or poison data. Frontends are
-expected to use a byte type when:
-
-#. Lowering memory operations like `memcpy` and `memmove` to load/store pairs
- without knowing the underlying type being copied.
-
-#. Working with union types that can hold a pointer alongside a non-pointer
- type.
-
-#. Working with possibly uninitialized data.
-
-Otherwise, when known, the specific type should be used. Each bit can be:
-
-* An integer bit (0 or 1)
-* Part of a pointer value
-* ``poison``
-
-Any bit width from 1 bit to 2\ :sup:`23`\ (about 8 million) can be specified.
-
-:Syntax:
-
-::
-
- bN
-
-The number of bits the byte occupies is specified by the ``N`` value.
-
-Examples:
-*********
-
-+----------------+------------------------------------------------+
-| ``b1`` | a single-bit byte value. |
-+----------------+------------------------------------------------+
-| ``b32`` | a 32-bit byte value. |
-+----------------+------------------------------------------------+
-| ``b128`` | a 128-bit byte value. |
-+----------------+------------------------------------------------+
-
.. _t_floating:
Floating-Point Types
@@ -4951,10 +4904,6 @@ Simple Constants
Note that hexadecimal integers are sign extended from the number
of active bits, i.e., the bit width minus the number of leading
zeros. So '``s0x0001``' of type '``i16``' will be -1, not 1.
-**Byte constants**
- Byte constants are used to initialize global variables of the :ref:`byte
- <t_byte>` type. These are strictly equivalent to integer constants:
- ``store b8 42, ptr %p`` is equivalent to ``store i8 42, ptr %p``.
**Floating-point constants**
Floating-point constants use standard decimal notation (e.g.
123.421), exponential notation (e.g., 1.23421e+2), or a more precise
@@ -11825,8 +11774,6 @@ If the value being loaded is of aggregate type, the bytes that correspond to
padding may be accessed but are ignored, because it is impossible to observe
padding from the loaded aggregate value.
If ``<pointer>`` is not a well-defined value, the behavior is undefined.
-The behavior of loading a value of a type that differs from the type used to
-store it is described in the :ref:`bitcast <i_bitcast>` section.
Examples:
"""""""""
@@ -13085,10 +13032,10 @@ The '``bitcast``' instruction takes a value to cast, which must be a
non-aggregate first class value, and a type to cast it to, which must
also be a non-aggregate :ref:`first class <t_firstclass>` type. The
bit sizes of ``value`` and the destination type, ``ty2``, must be
-identical. If the source type is a pointer, the destination type must also be a
-pointer or a byte (vector of bytes) of the same size. This instruction supports
-bitwise conversion of vectors to integers and to vectors of other types (as long
-as they have the same size).
+identical. If the source type is a pointer, the destination type must
+also be a pointer of the same size. This instruction supports bitwise
+conversion of vectors to integers and to vectors of other types (as
+long as they have the same size).
Semantics:
""""""""""
@@ -13098,44 +13045,15 @@ is always a *no-op cast* because no bits change with this
conversion. The conversion is done as if the ``value`` had been stored
to memory and read back as type ``ty2``. Pointer (or vector of
pointers) types may only be converted to other pointer (or vector of
-pointers) types with the same address space or byte (or vector of bytes) types
-through this instruction. To convert pointers to other types, use the
-:ref:`inttoptr <i_inttoptr>` or :ref:`ptrtoint <i_ptrtoint>` instructions first.
+pointers) types with the same address space through this instruction.
+To convert pointers to other types, use the :ref:`inttoptr <i_inttoptr>`
+or :ref:`ptrtoint <i_ptrtoint>` instructions first.
There is a caveat for bitcasts involving vector types in relation to
endianness. For example ``bitcast <2 x i8> <value> to i16`` puts element zero
of the vector in the least significant bits of the i16 for little-endian while
element zero ends up in the most significant bits for big-endian.
-If ``value`` is of the :ref:`byte type <t_byte>`:
-
-* If ``ty2`` is a scalar type:
-
- * If ``ty2`` is a byte type, the original bits are unchanged.
-
- * If ``ty2`` is a pointer type:
-
- * If at least one bit of ``value`` is ``poison``, the result is
- ``poison``.
-
- * If all bits of ``value`` are from the same pointer and are correctly
- ordered (there were no pointer bit swaps), the result is that pointer.
-
- * Otherwise, the result is a pointer with the address given by the
- integer value of the input, and without provenance.
-
- * If ``ty2`` is an integer or floating-point type:
-
- * If at least one bit of ``value`` is ``poison``, the result is
- ``poison``.
-
- * Otherwise, the result is the value encoded by the input bits with
- their provenance stripped without being exposed.
-
-* If ``ty2`` is a vector type, the input bits get sliced into chunks
- corresponding to lanes of the output. Each lane is then converted using the
- rules for scalar types above.
-
Example:
""""""""
@@ -13146,17 +13064,6 @@ Example:
%Z = bitcast <2 x i32> %V to i64; ; yields i64: %V (depends on endianness)
%Z = bitcast <2 x i32*> %V to <2 x i64*> ; yields <2 x i64*>
- ; considering %bi to hold an integer and %bp to hold a pointer,
- %a = bitcast b64 %bi to i64 ; returns an integer, no-op cast
- %b = bitcast b64 %bp to i64 ; reinterprets the pointer as an integer, returning its address without exposing provenance
- %c = bitcast b64 %bp to ptr ; returns a pointer, no-op cast
- %d = bitcast b64 %bi to ptr ; reinterprets the integer as a pointer, returning a pointer with no provenance
-
- %e = bitcast <2 x b32> %v to i64 ; reinterprets the raw bytes as an integer
- %f = bitcast <2 x b32> %v to ptr ; reinterprets the raw bytes as a pointer
-
- %g = bitcast <2 x b32> %v to <4 x i16> ; reinterprets the raw bytes as integers
-
.. _i_addrspacecast:
'``addrspacecast .. to``' Instruction
@@ -13588,7 +13495,6 @@ instructions may yield different values.
While ``undef`` and ``poison`` pointers can be frozen, the result is a
non-dereferenceable pointer. See the
:ref:`Pointer Aliasing Rules <pointeraliasing>` section for more information.
-Values of the :ref:`byte type <t_byte>` are frozen on a per-bit basis.
If an aggregate value or vector is frozen, the operand is frozen element-wise.
The padding of an aggregate isn't considered, since it isn't visible
without storing it into memory and loading it with a different type.
@@ -13617,9 +13523,6 @@ Example:
%d = extractelement <2 x i32> %v.fr, i32 0 ; not undef
%add.f = add i32 %d, %d ; even number
- %l = load b32, ptr %p ; may be uninitialized
- %f = freeze b32 %l ; freezes on a per-bit basis
-
; branching on frozen value
%poison = add nsw i1 %k, undef ; poison
%c = freeze i1 %poison
diff --git a/llvm/include/llvm-c/Core.h b/llvm/include/llvm-c/Core.h
index 9dba8a905753a..869031d9e1c73 100644
--- a/llvm/include/llvm-c/Core.h
+++ b/llvm/include/llvm-c/Core.h
@@ -171,7 +171,6 @@ typedef enum {
LLVMBFloatTypeKind = 18, /**< 16 bit brain floating point type */
LLVMX86_AMXTypeKind = 19, /**< X86 AMX */
LLVMTargetExtTypeKind = 20, /**< Target extension type */
- LLVMByteTypeKind = 21, /**< Arbitrary bit width bytes */
} LLVMTypeKind;
typedef enum {
@@ -281,7 +280,6 @@ typedef enum {
LLVMConstantDataArrayValueKind,
LLVMConstantDataVectorValueKind,
LLVMConstantIntValueKind,
- LLVMConstantByteValueKind,
LLVMConstantFPValueKind,
LLVMConstantPointerNullValueKind,
LLVMConstantTokenNoneValueKind,
@@ -1349,7 +1347,6 @@ LLVM_C_ABI void LLVMSetModuleInlineAsm(LLVMModuleRef M, const char *Asm);
*
* types:
* integer type
- * byte type
* real type
* function type
* sequence types:
@@ -1401,25 +1398,6 @@ LLVM_C_ABI void LLVMDumpType(LLVMTypeRef Val);
*/
LLVM_C_ABI char *LLVMPrintTypeToString(LLVMTypeRef Val);
-/**
- * @}
- */
-
-/**
- * @defgroup LLVMCCoreTypeByte Byte Types
- *
- * Functions in this section operate on byte types.
- *
- * @{
- */
-
-/**
- * Obtain a byte type from a context with specified bit width.
- */
-LLVM_C_ABI LLVMTypeRef LLVMByteTypeInContext(LLVMContextRef C,
- unsigned NumBits);
-LLVM_C_ABI unsigned LLVMGetByteTypeWidth(LLVMTypeRef ByteTy);
-
/**
* @defgroup LLVMCCoreTypeInt Integer Types
*
@@ -2036,7 +2014,6 @@ LLVM_C_ABI unsigned LLVMGetTargetExtTypeIntParam(LLVMTypeRef TargetExtTy,
macro(ConstantExpr) \
macro(ConstantFP) \
macro(ConstantInt) \
- macro(ConstantByte) \
macro(ConstantPointerNull) \
macro(ConstantStruct) \
macro(ConstantTokenNone) \
@@ -2450,36 +2427,6 @@ LLVM_C_ABI LLVMValueRef LLVMConstIntOfStringAndSize(LLVMTypeRef IntTy,
unsigned SLen,
uint8_t Radix);
-/**
- * Obtain a constant value for a byte type.
- *
- * The returned value corresponds to a llvm::ConstantByte.
- *
- * @see llvm::ConstantByte::get()
- *
- * @param ByteTy Byte type to obtain value of.
- * @param N The value the returned instance should refer to.
- */
-LLVM_C_ABI LLVMValueRef LLVMConstByte(LLVMTypeRef ByteTy, unsigned long long N);
-
-/**
- * Obtain a constant value for a byte of arbitrary precision.
- *
- * @see llvm::ConstantByte::get()
- */
-LLVM_C_ABI LLVMValueRef LLVMConstByteOfArbitraryPrecision(
- LLVMTypeRef ByteTy, unsigned NumWords, const uint64_t Words[]);
-
-/**
- * Obtain a constant value for a byte parsed from a string with specified
- * length.
- * @see llvm::ConstantByte::get()
- */
-LLVM_C_ABI LLVMValueRef LLVMConstByteOfStringAndSize(LLVMTypeRef ByteTy,
- const char *Text,
- size_t SLen,
- uint8_t Radix);
-
/**
* Obtain a constant value referring to a double floating point value.
*/
@@ -2524,21 +2471,6 @@ LLVMConstIntGetZExtValue(LLVMValueRef ConstantVal);
*/
LLVM_C_ABI long long LLVMConstIntGetSExtValue(LLVMValueRef ConstantVal);
-/**
- * Obtain the zero extended value for a byte constant value.
- *
- * @see llvm::ConstantByte::getZExtValue()
- */
-LLVM_C_ABI unsigned long long
-LLVMConstByteGetZExtValue(LLVMValueRef ConstantVal);
-
-/**
- * Obtain the sign extended value for a byte constant value.
- *
- * @see llvm::ConstantByte::getSExtValue()
- */
-LLVM_C_ABI long long LLVMConstByteGetSExtValue(LLVMValueRef ConstantVal);
-
/**
* Obtain the double value for an floating point constant value.
* losesInfo indicates if some precision was lost in the conversion.
diff --git a/llvm/include/llvm/Analysis/IR2Vec.h b/llvm/include/llvm/Analysis/IR2Vec.h
index 968873c918393..922c65d5c8340 100644
--- a/llvm/include/llvm/Analysis/IR2Vec.h
+++ b/llvm/include/llvm/Analysis/IR2Vec.h
@@ -292,7 +292,6 @@ class Vocabulary {
VectorTy,
TokenTy,
IntegerTy,
- ByteTy,
FunctionTy,
PointerTy,
StructTy,
@@ -466,9 +465,9 @@ class Vocabulary {
/// String mappings for CanonicalTypeID values
static constexpr StringLiteral CanonicalTypeNames[] = {
- "FloatTy", "VoidTy", "LabelTy", "MetadataTy", "VectorTy",
- "TokenTy", "IntegerTy", "ByteTy", "FunctionTy", "PointerTy",
- "StructTy", "ArrayTy", "UnknownTy"};
+ "FloatTy", "VoidTy", "LabelTy", "MetadataTy",
+ "VectorTy", "TokenTy", "IntegerTy", "FunctionTy",
+ "PointerTy", "StructTy", "ArrayTy", "UnknownTy"};
static_assert(std::size(CanonicalTypeNames) ==
static_cast<unsigned>(CanonicalTypeID::MaxCanonicalType),
"CanonicalTypeNames array size must match MaxCanonicalType");
@@ -496,7 +495,6 @@ class Vocabulary {
CanonicalTypeID::VectorTy, // X86_AMXTyID
CanonicalTypeID::TokenTy, // TokenTyID
CanonicalTypeID::IntegerTy, // IntegerTyID
- CanonicalTypeID::ByteTy, // ByteTyID
CanonicalTypeID::FunctionTy, // FunctionTyID
CanonicalTypeID::PointerTy, // PointerTyID
CanonicalTypeID::StructTy, // StructTyID
diff --git a/llvm/include/llvm/Bitcode/LLVMBitCodes.h b/llvm/include/llvm/Bitcode/LLVMBitCodes.h
index 4ac3029175d0d..bcf596a0d79b2 100644
--- a/llvm/include/llvm/Bitcode/LLVMBitCodes.h
+++ b/llvm/include/llvm/Bitcode/LLVMBitCodes.h
@@ -177,8 +177,6 @@ enum TypeCodes {
TYPE_CODE_OPAQUE_POINTER = 25, // OPAQUE_POINTER: [addrspace]
TYPE_CODE_TARGET_TYPE = 26, // TARGET_TYPE
-
- TYPE_CODE_BYTE = 27, // BYTE: [width]
};
enum OperandBundleTagCode {
@@ -442,8 +440,6 @@ enum ConstantsCodes {
CST_CODE_PTRAUTH = 33, // [ptr, key, disc, addrdisc]
CST_CODE_PTRAUTH2 = 34, // [ptr, key, disc, addrdisc,
// deactivation_symbol]
- CST_CODE_BYTE = 35, // BYTE: [intval]
- CST_CODE_WIDE_BYTE = 36, // WIDE_BYTE: [n x intval]
};
/// CastOpcodes - These are values used in the bitcode files to encode which
diff --git a/llvm/include/llvm/IR/Constants.h b/llvm/include/llvm/IR/Constants.h
index 2b3f4119e50e2..a1f667353b26e 100644
--- a/llvm/include/llvm/IR/Constants.h
+++ b/llvm/include/llvm/IR/Constants.h
@@ -276,144 +276,6 @@ class ConstantInt final : public ConstantData {
}
};
-//===----------------------------------------------------------------------===//
-/// Class for constant bytes.
-class ConstantByte final : public ConstantData {
- friend class Constant;
- friend class ConstantVector;
-
- APInt Val;
-
- ConstantByte(Type *Ty, const APInt &V);
-
- void destroyConstantImpl();
-
- /// Return a ConstantByte with the specified value and an implied Type. The
- /// type is the vector type whose byte element type corresponds to the bit
- /// width of the value.
- static ConstantByte *get(LLVMContext &Context, ElementCount EC,
- const APInt &V);
-
-public:
- ConstantByte(const ConstantByte &) = delete;
-
- /// If Ty is a vector type, return a Constant with a splat of the given
- /// value. Otherwise return a ConstantByte for the given value.
- /// \param ImplicitTrunc Whether to allow implicit truncation of the value.
- LLVM_ABI static Constant *get(Type *Ty, uint64_t V, bool isSigned = false,
- bool ImplicitTrunc = false);
-
- /// Return a ConstantByte with the specified byte value for the specified
- /// type. If the type is wider than 64 bits, the value will be zero-extended
- /// to fit the type, unless IsSigned is true, in which case the value will
- /// be interpreted as a 64-bit signed byte and sign-extended to fit
- /// the type.
- /// \param ImplicitTrunc Whether to allow implicit truncation of the value.
- LLVM_ABI static ConstantByte *get(ByteType *Ty, uint64_t V,
- bool isSigned = false,
- bool ImplicitTrunc = false);
-
- /// Return a ConstantByte with the specified value for the specified type. The
- /// value V will be canonicalized to an unsigned APInt. Accessing it with
- /// either getSExtValue() or getZExtValue() will yield a correctly sized and
- /// signed value for the type Ty.
- /// Get a ConstantByte for a specific signed value.
- /// \param ImplicitTrunc Whether to allow implicit truncation of the value.
- static ConstantByte *getSigned(ByteType *Ty, int64_t V,
- bool ImplicitTrunc = false) {
- return get(Ty, V, /*IsSigned=*/true, ImplicitTrunc);
- }
- static Constant *getSigned(Type *Ty, int64_t V, bool ImplicitTrunc = false) {
- return get(Ty, V, /*IsSigned=*/true, ImplicitTrunc);
- }
-
- /// Return a ConstantByte with the specified value and an implied Type. The
- /// type is the byte type that corresponds to the bit width of the value.
- LLVM_ABI static ConstantByte *get(LLVMContext &Context, const APInt &V);
-
- /// Return a ConstantByte constructed from the string strStart with the given
- /// radix.
- LLVM_ABI static ConstantByte *get(ByteType *Ty, StringRef Str, uint8_t Radix);
-
- /// If Ty is a vector type, return a Constant with a splat of the given
- /// value. Otherwise return a ConstantByte for the given value.
- LLVM_ABI static Constant *get(Type *Ty, const APInt &V);
-
- /// Return the constant as an APInt value reference. This allows clients to
- /// obtain a full-precision copy of the value.
- /// Return the constant's value.
- inline const APInt &getValue() const { return Val; }
-
- /// getBitWidth - Return the scalar bitwidth of this constant.
- unsigned getBitWidth() const { return Val.getBitWidth(); }
-
- /// Return the constant as a 64-bit byte value after it
- /// has been zero extended as appropriate for the type of this constant. Note
- /// that this method can assert if the value does not fit in 64 bits.
- /// Return the zero extended value.
- inline uint64_t getZExtValue() const { return Val.getZExtValue(); }
-
- /// Return the constant as a 64-bit byte value after it has been sign
- /// extended as appropriate for the type of this constant. Note that
- /// this method can assert if the value does not fit in 64 bits.
- /// Return the sign extended value.
- inline int64_t getSExtValue() const { return Val.getSExtValue(); }
-
- /// Variant of the getType() method to always return a ByteType, which
- /// reduces the amount of casting needed in p...
[truncated]
``````````
</details>
https://github.com/llvm/llvm-project/pull/186713
More information about the llvm-commits
mailing list