Skip to content

Commit

Permalink
Re-land x86_mmx IR type removal commits
Browse files Browse the repository at this point in the history
cherry-pick:
dfeb399 jyknight@google.com Thu Jul 25 09:19:22 2024 -0400 Remove the `x86_mmx` IR type. (llvm#98505)
b7e4fba jyknight@google.com Sun Jul 28 18:12:47 2024 -0400 Cleanup x86_mmx after removing IR type  (llvm#100646)

Change-Id: I987eda387fc403ab249f9d48eeb13fd66606343a
  • Loading branch information
macurtis-amd authored and ronlieb committed Nov 9, 2024
1 parent 5030fa5 commit 8d00fc8
Show file tree
Hide file tree
Showing 110 changed files with 3,936 additions and 3,820 deletions.
4 changes: 2 additions & 2 deletions clang/test/OpenMP/allow-kernelc-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ int main(void) {
// CHECK-NOPE-NEXT: [[TMP3:%.*]] = getelementptr inbounds nuw [[VARFN_ARGS_STORE]], ptr addrspace(1) [[VARFN_ARGS_STORE_CASTED]], i32 0, i32 1
// CHECK-NOPE-NEXT: store i32 1, ptr addrspace(1) [[TMP3]], align 4
// CHECK-NOPE-NEXT: [[TMP4:%.*]] = getelementptr inbounds nuw [[VARFN_ARGS_STORE]], ptr addrspace(1) [[VARFN_ARGS_STORE_CASTED]], i32 0, i32 2
// CHECK-NOPE-NEXT: store i32 983041, ptr addrspace(1) [[TMP4]], align 4
// CHECK-NOPE-NEXT: store i32 917505, ptr addrspace(1) [[TMP4]], align 4
// CHECK-NOPE-NEXT: [[TMP5:%.*]] = getelementptr inbounds nuw [[VARFN_ARGS_STORE]], ptr addrspace(1) [[VARFN_ARGS_STORE_CASTED]], i32 0, i32 3
// CHECK-NOPE-NEXT: store i32 11, ptr addrspace(1) [[TMP5]], align 4
// CHECK-NOPE-NEXT: [[TMP6:%.*]] = getelementptr inbounds i8, ptr addrspace(1) [[VARFN_ARGS_STORE_CASTED]], i64 16
Expand Down Expand Up @@ -78,7 +78,7 @@ int main(void) {
// CHECK-NEXT: [[TMP3:%.*]] = getelementptr inbounds nuw [[VARFN_ARGS_STORE]], ptr addrspace(1) [[VARFN_ARGS_STORE_CASTED]], i32 0, i32 1
// CHECK-NEXT: store i32 1, ptr addrspace(1) [[TMP3]], align 4
// CHECK-NEXT: [[TMP4:%.*]] = getelementptr inbounds nuw [[VARFN_ARGS_STORE]], ptr addrspace(1) [[VARFN_ARGS_STORE_CASTED]], i32 0, i32 2
// CHECK-NEXT: store i32 983041, ptr addrspace(1) [[TMP4]], align 4
// CHECK-NEXT: store i32 917505, ptr addrspace(1) [[TMP4]], align 4
// CHECK-NEXT: [[TMP5:%.*]] = getelementptr inbounds nuw [[VARFN_ARGS_STORE]], ptr addrspace(1) [[VARFN_ARGS_STORE_CASTED]], i32 0, i32 3
// CHECK-NEXT: store i32 11, ptr addrspace(1) [[TMP5]], align 4
// CHECK-NEXT: [[TMP6:%.*]] = getelementptr inbounds i8, ptr addrspace(1) [[VARFN_ARGS_STORE_CASTED]], i64 16
Expand Down
4 changes: 0 additions & 4 deletions llvm/bindings/ocaml/llvm/llvm.mli
Original file line number Diff line number Diff line change
Expand Up @@ -766,10 +766,6 @@ val void_type : llcontext -> lltype
[llvm::Type::LabelTy]. *)
val label_type : llcontext -> lltype

(** [x86_mmx_type c] returns the x86 64-bit MMX register type in the
context [c]. See [llvm::Type::X86_MMXTy]. *)
val x86_mmx_type : llcontext -> lltype

(** [type_by_name m name] returns the specified type from the current module
if it exists.
See the method [llvm::Module::getTypeByName] *)
Expand Down
5 changes: 0 additions & 5 deletions llvm/bindings/ocaml/llvm/llvm_ocaml.c
Original file line number Diff line number Diff line change
Expand Up @@ -686,11 +686,6 @@ value llvm_label_type(value Context) {
return to_val(LLVMLabelTypeInContext(Context_val(Context)));
}

/* llcontext -> lltype */
value llvm_x86_mmx_type(value Context) {
return to_val(LLVMX86MMXTypeInContext(Context_val(Context)));
}

/* llmodule -> string -> lltype option */
value llvm_type_by_name(value M, value Name) {
return ptr_to_option(LLVMGetTypeByName(Module_val(M), String_val(Name)));
Expand Down
2 changes: 1 addition & 1 deletion llvm/docs/BitCodeFormat.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1227,7 +1227,7 @@ TYPE_CODE_X86_MMX Record

``[X86_MMX]``

The ``X86_MMX`` record (code 17) adds an ``x86_mmx`` type to the type table.
The ``X86_MMX`` record (code 17) is deprecated, and imported as a <1 x i64> vector.

TYPE_CODE_STRUCT_ANON Record
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
20 changes: 1 addition & 19 deletions llvm/docs/LangRef.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4060,24 +4060,6 @@ or constants of this type.
x86_amx


X86_mmx Type
""""""""""""

:Overview:

The x86_mmx type represents a value held in an MMX register on an x86
machine. The operations allowed on it are quite limited: parameters and
return values, load and store, and bitcast. User-specified MMX
instructions are represented as intrinsic or asm calls with arguments
and/or results of this type. There are no arrays, vectors or constants
of this type.

:Syntax:

::

x86_mmx


.. _t_pointer:

Expand Down Expand Up @@ -4511,7 +4493,7 @@ represented by ``0xH`` followed by 4 hexadecimal digits. The bfloat 16-bit
format is represented by ``0xR`` followed by 4 hexadecimal digits. All
hexadecimal formats are big-endian (sign bit at the left).

There are no constants of type x86_mmx and x86_amx.
There are no constants of type x86_amx.

.. _complexconstants:

Expand Down
187 changes: 187 additions & 0 deletions llvm/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
============================
LLVM |release| Release Notes
============================

.. contents::
:local:

.. only:: PreRelease

.. warning::
These are in-progress notes for the upcoming LLVM |version| release.
Release notes for previous releases can be found on
`the Download Page <https://releases.llvm.org/download.html>`_.


Introduction
============

This document contains the release notes for the LLVM Compiler Infrastructure,
release |release|. Here we describe the status of LLVM, including major improvements
from the previous release, improvements in various subprojects of LLVM, and
some of the current users of the code. All LLVM releases may be downloaded
from the `LLVM releases web site <https://llvm.org/releases/>`_.

For more information about LLVM, including information about the latest
release, please check out the `main LLVM web site <https://llvm.org/>`_. If you
have questions or comments, the `Discourse forums
<https://discourse.llvm.org>`_ is a good place to ask
them.

Note that if you are reading this file from a Git checkout or the main
LLVM web page, this document applies to the *next* release, not the current
one. To see the release notes for a specific release, please see the `releases
page <https://llvm.org/releases/>`_.

Non-comprehensive list of changes in this release
=================================================
.. NOTE
For small 1-3 sentence descriptions, just add an entry at the end of
this list. If your description won't fit comfortably in one bullet
point (e.g. maybe you would like to give an example of the
functionality, or simply have a lot to talk about), see the `NOTE` below
for adding a new subsection.
* ...

Update on required toolchains to build LLVM
-------------------------------------------

Changes to the LLVM IR
----------------------

* The ``x86_mmx`` IR type has been removed. It will be translated to
the standard vector type ``<1 x i64>`` in bitcode upgrade.

Changes to LLVM infrastructure
------------------------------

Changes to building LLVM
------------------------

Changes to TableGen
-------------------

Changes to Interprocedural Optimizations
----------------------------------------

Changes to the AArch64 Backend
------------------------------

* `.balign N, 0`, `.p2align N, 0`, `.align N, 0` in code sections will now fill
the required alignment space with a sequence of `0x0` bytes (the requested
fill value) rather than NOPs.

Changes to the AMDGPU Backend
-----------------------------

Changes to the ARM Backend
--------------------------

* `.balign N, 0`, `.p2align N, 0`, `.align N, 0` in code sections will now fill
the required alignment space with a sequence of `0x0` bytes (the requested
fill value) rather than NOPs.

Changes to the AVR Backend
--------------------------

Changes to the DirectX Backend
------------------------------

Changes to the Hexagon Backend
------------------------------

Changes to the LoongArch Backend
--------------------------------

Changes to the MIPS Backend
---------------------------

Changes to the PowerPC Backend
------------------------------

Changes to the RISC-V Backend
-----------------------------

* `.balign N, 0`, `.p2align N, 0`, `.align N, 0` in code sections will now fill
the required alignment space with a sequence of `0x0` bytes (the requested
fill value) rather than NOPs.

Changes to the WebAssembly Backend
----------------------------------

Changes to the Windows Target
-----------------------------

Changes to the X86 Backend
--------------------------

* `.balign N, 0x90`, `.p2align N, 0x90`, and `.align N, 0x90` in code sections
now fill the required alignment space with repeating `0x90` bytes, rather than
using optimised NOP filling. Optimised NOP filling fills the space with NOP
instructions of various widths, not just those that use the `0x90` byte
encoding. To use optimised NOP filling in a code section, leave off the
"fillval" argument, i.e. `.balign N`, `.p2align N` or `.align N` respectively.

* Due to the removal of the ``x86_mmx`` IR type, functions with
``x86_mmx`` arguments or return values will use a different,
incompatible, calling convention ABI. Such functions are not
generally seen in the wild (Clang never generates them!), so this is
not expected to result in real-world compatibility problems.

Changes to the OCaml bindings
-----------------------------

Changes to the Python bindings
------------------------------

Changes to the C API
--------------------

* The following symbols are deleted due to the removal of the ``x86_mmx`` IR type:

* ``LLVMX86_MMXTypeKind``
* ``LLVMX86MMXTypeInContext``
* ``LLVMX86MMXType``

Changes to the CodeGen infrastructure
-------------------------------------

Changes to the Metadata Info
---------------------------------

Changes to the Debug Info
---------------------------------

Changes to the LLVM tools
---------------------------------

Changes to LLDB
---------------------------------

Changes to BOLT
---------------------------------

Changes to Sanitizers
---------------------

Other Changes
-------------

External Open Source Projects Using LLVM 19
===========================================

* A project...

Additional Information
======================

A wide variety of additional information is available on the `LLVM web page
<https://llvm.org/>`_, in particular in the `documentation
<https://llvm.org/docs/>`_ section. The web page also contains versions of the
API documentation which is up-to-date with the Git version of the source
code. You can access versions of these documents specific to this release by
going into the ``llvm/docs/`` directory in the LLVM tree.

If you have any questions or comments about LLVM, please feel free to contact
us via the `Discourse forums <https://discourse.llvm.org>`_.
48 changes: 21 additions & 27 deletions llvm/include/llvm-c/Core.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,27 +146,27 @@ typedef enum {
} LLVMOpcode;

typedef enum {
LLVMVoidTypeKind, /**< type with no size */
LLVMHalfTypeKind, /**< 16 bit floating point type */
LLVMFloatTypeKind, /**< 32 bit floating point type */
LLVMDoubleTypeKind, /**< 64 bit floating point type */
LLVMX86_FP80TypeKind, /**< 80 bit floating point type (X87) */
LLVMFP128TypeKind, /**< 128 bit floating point type (112-bit mantissa)*/
LLVMPPC_FP128TypeKind, /**< 128 bit floating point type (two 64-bits) */
LLVMLabelTypeKind, /**< Labels */
LLVMIntegerTypeKind, /**< Arbitrary bit width integers */
LLVMFunctionTypeKind, /**< Functions */
LLVMStructTypeKind, /**< Structures */
LLVMArrayTypeKind, /**< Arrays */
LLVMPointerTypeKind, /**< Pointers */
LLVMVectorTypeKind, /**< Fixed width SIMD vector type */
LLVMMetadataTypeKind, /**< Metadata */
LLVMX86_MMXTypeKind, /**< X86 MMX */
LLVMTokenTypeKind, /**< Tokens */
LLVMScalableVectorTypeKind, /**< Scalable SIMD vector type */
LLVMBFloatTypeKind, /**< 16 bit brain floating point type */
LLVMX86_AMXTypeKind, /**< X86 AMX */
LLVMTargetExtTypeKind, /**< Target extension type */
LLVMVoidTypeKind = 0, /**< type with no size */
LLVMHalfTypeKind = 1, /**< 16 bit floating point type */
LLVMFloatTypeKind = 2, /**< 32 bit floating point type */
LLVMDoubleTypeKind = 3, /**< 64 bit floating point type */
LLVMX86_FP80TypeKind = 4, /**< 80 bit floating point type (X87) */
LLVMFP128TypeKind = 5, /**< 128 bit floating point type (112-bit mantissa)*/
LLVMPPC_FP128TypeKind = 6, /**< 128 bit floating point type (two 64-bits) */
LLVMLabelTypeKind = 7, /**< Labels */
LLVMIntegerTypeKind = 8, /**< Arbitrary bit width integers */
LLVMFunctionTypeKind = 9, /**< Functions */
LLVMStructTypeKind = 10, /**< Structures */
LLVMArrayTypeKind = 11, /**< Arrays */
LLVMPointerTypeKind = 12, /**< Pointers */
LLVMVectorTypeKind = 13, /**< Fixed width SIMD vector type */
LLVMMetadataTypeKind = 14, /**< Metadata */
/* 15 previously used by LLVMX86_MMXTypeKind */
LLVMTokenTypeKind = 16, /**< Tokens */
LLVMScalableVectorTypeKind = 17, /**< Scalable SIMD vector type */
LLVMBFloatTypeKind = 18, /**< 16 bit brain floating point type */
LLVMX86_AMXTypeKind = 19, /**< X86 AMX */
LLVMTargetExtTypeKind = 20, /**< Target extension type */
} LLVMTypeKind;

typedef enum {
Expand Down Expand Up @@ -1734,11 +1734,6 @@ LLVMTypeRef LLVMVoidTypeInContext(LLVMContextRef C);
*/
LLVMTypeRef LLVMLabelTypeInContext(LLVMContextRef C);

/**
* Create a X86 MMX type in a context.
*/
LLVMTypeRef LLVMX86MMXTypeInContext(LLVMContextRef C);

/**
* Create a X86 AMX type in a context.
*/
Expand All @@ -1760,7 +1755,6 @@ LLVMTypeRef LLVMMetadataTypeInContext(LLVMContextRef C);
*/
LLVMTypeRef LLVMVoidType(void);
LLVMTypeRef LLVMLabelType(void);
LLVMTypeRef LLVMX86MMXType(void);
LLVMTypeRef LLVMX86AMXType(void);

/**
Expand Down
1 change: 0 additions & 1 deletion llvm/include/llvm/IR/DataLayout.h
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,6 @@ inline TypeSize DataLayout::getTypeSizeInBits(Type *Ty) const {
case Type::FloatTyID:
return TypeSize::getFixed(32);
case Type::DoubleTyID:
case Type::X86_MMXTyID:
return TypeSize::getFixed(64);
case Type::PPC_FP128TyID:
case Type::FP128TyID:
Expand Down
12 changes: 3 additions & 9 deletions llvm/include/llvm/IR/Type.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ class Type {
VoidTyID, ///< type with no size
LabelTyID, ///< Labels
MetadataTyID, ///< Metadata
X86_MMXTyID, ///< MMX vectors (64 bits, X86 specific)
X86_AMXTyID, ///< AMX vectors (8192 bits, X86 specific)
TokenTyID, ///< Tokens

Expand Down Expand Up @@ -197,9 +196,6 @@ class Type {

const fltSemantics &getFltSemantics() const;

/// Return true if this is X86 MMX.
bool isX86_MMXTy() const { return getTypeID() == X86_MMXTyID; }

/// Return true if this is X86 AMX.
bool isX86_AMXTy() const { return getTypeID() == X86_AMXTyID; }

Expand Down Expand Up @@ -285,8 +281,8 @@ class Type {
/// Return true if the type is a valid type for a register in codegen. This
/// includes all first-class types except struct and array types.
bool isSingleValueType() const {
return isFloatingPointTy() || isX86_MMXTy() || isIntegerTy() ||
isPointerTy() || isVectorTy() || isX86_AMXTy() || isTargetExtTy();
return isFloatingPointTy() || isIntegerTy() || isPointerTy() ||
isVectorTy() || isX86_AMXTy() || isTargetExtTy();
}

/// Return true if the type is an aggregate type. This means it is valid as
Expand All @@ -302,8 +298,7 @@ class Type {
bool isSized(SmallPtrSetImpl<Type*> *Visited = nullptr) const {
// If it's a primitive, it is always sized.
if (getTypeID() == IntegerTyID || isFloatingPointTy() ||
getTypeID() == PointerTyID || getTypeID() == X86_MMXTyID ||
getTypeID() == X86_AMXTyID)
getTypeID() == PointerTyID || getTypeID() == X86_AMXTyID)
return true;
// If it is not something that can have a size (e.g. a function or label),
// it doesn't have a size.
Expand Down Expand Up @@ -445,7 +440,6 @@ class Type {
static Type *getX86_FP80Ty(LLVMContext &C);
static Type *getFP128Ty(LLVMContext &C);
static Type *getPPC_FP128Ty(LLVMContext &C);
static Type *getX86_MMXTy(LLVMContext &C);
static Type *getX86_AMXTy(LLVMContext &C);
static Type *getTokenTy(LLVMContext &C);
static IntegerType *getIntNTy(LLVMContext &C, unsigned N);
Expand Down
Loading

0 comments on commit 8d00fc8

Please sign in to comment.