Skip to content

Commit 8d00fc8

Browse files
macurtis-amdronlieb
authored andcommitted
Re-land x86_mmx IR type removal commits
cherry-pick: dfeb399 [email protected] Thu Jul 25 09:19:22 2024 -0400 Remove the `x86_mmx` IR type. (llvm#98505) b7e4fba [email protected] Sun Jul 28 18:12:47 2024 -0400 Cleanup x86_mmx after removing IR type (llvm#100646) Change-Id: I987eda387fc403ab249f9d48eeb13fd66606343a
1 parent 5030fa5 commit 8d00fc8

File tree

110 files changed

+3936
-3820
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+3936
-3820
lines changed

clang/test/OpenMP/allow-kernelc-io.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ int main(void) {
4848
// CHECK-NOPE-NEXT: [[TMP3:%.*]] = getelementptr inbounds nuw [[VARFN_ARGS_STORE]], ptr addrspace(1) [[VARFN_ARGS_STORE_CASTED]], i32 0, i32 1
4949
// CHECK-NOPE-NEXT: store i32 1, ptr addrspace(1) [[TMP3]], align 4
5050
// CHECK-NOPE-NEXT: [[TMP4:%.*]] = getelementptr inbounds nuw [[VARFN_ARGS_STORE]], ptr addrspace(1) [[VARFN_ARGS_STORE_CASTED]], i32 0, i32 2
51-
// CHECK-NOPE-NEXT: store i32 983041, ptr addrspace(1) [[TMP4]], align 4
51+
// CHECK-NOPE-NEXT: store i32 917505, ptr addrspace(1) [[TMP4]], align 4
5252
// CHECK-NOPE-NEXT: [[TMP5:%.*]] = getelementptr inbounds nuw [[VARFN_ARGS_STORE]], ptr addrspace(1) [[VARFN_ARGS_STORE_CASTED]], i32 0, i32 3
5353
// CHECK-NOPE-NEXT: store i32 11, ptr addrspace(1) [[TMP5]], align 4
5454
// CHECK-NOPE-NEXT: [[TMP6:%.*]] = getelementptr inbounds i8, ptr addrspace(1) [[VARFN_ARGS_STORE_CASTED]], i64 16
@@ -78,7 +78,7 @@ int main(void) {
7878
// CHECK-NEXT: [[TMP3:%.*]] = getelementptr inbounds nuw [[VARFN_ARGS_STORE]], ptr addrspace(1) [[VARFN_ARGS_STORE_CASTED]], i32 0, i32 1
7979
// CHECK-NEXT: store i32 1, ptr addrspace(1) [[TMP3]], align 4
8080
// CHECK-NEXT: [[TMP4:%.*]] = getelementptr inbounds nuw [[VARFN_ARGS_STORE]], ptr addrspace(1) [[VARFN_ARGS_STORE_CASTED]], i32 0, i32 2
81-
// CHECK-NEXT: store i32 983041, ptr addrspace(1) [[TMP4]], align 4
81+
// CHECK-NEXT: store i32 917505, ptr addrspace(1) [[TMP4]], align 4
8282
// CHECK-NEXT: [[TMP5:%.*]] = getelementptr inbounds nuw [[VARFN_ARGS_STORE]], ptr addrspace(1) [[VARFN_ARGS_STORE_CASTED]], i32 0, i32 3
8383
// CHECK-NEXT: store i32 11, ptr addrspace(1) [[TMP5]], align 4
8484
// CHECK-NEXT: [[TMP6:%.*]] = getelementptr inbounds i8, ptr addrspace(1) [[VARFN_ARGS_STORE_CASTED]], i64 16

llvm/bindings/ocaml/llvm/llvm.mli

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -766,10 +766,6 @@ val void_type : llcontext -> lltype
766766
[llvm::Type::LabelTy]. *)
767767
val label_type : llcontext -> lltype
768768

769-
(** [x86_mmx_type c] returns the x86 64-bit MMX register type in the
770-
context [c]. See [llvm::Type::X86_MMXTy]. *)
771-
val x86_mmx_type : llcontext -> lltype
772-
773769
(** [type_by_name m name] returns the specified type from the current module
774770
if it exists.
775771
See the method [llvm::Module::getTypeByName] *)

llvm/bindings/ocaml/llvm/llvm_ocaml.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -686,11 +686,6 @@ value llvm_label_type(value Context) {
686686
return to_val(LLVMLabelTypeInContext(Context_val(Context)));
687687
}
688688

689-
/* llcontext -> lltype */
690-
value llvm_x86_mmx_type(value Context) {
691-
return to_val(LLVMX86MMXTypeInContext(Context_val(Context)));
692-
}
693-
694689
/* llmodule -> string -> lltype option */
695690
value llvm_type_by_name(value M, value Name) {
696691
return ptr_to_option(LLVMGetTypeByName(Module_val(M), String_val(Name)));

llvm/docs/BitCodeFormat.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1227,7 +1227,7 @@ TYPE_CODE_X86_MMX Record
12271227

12281228
``[X86_MMX]``
12291229

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

12321232
TYPE_CODE_STRUCT_ANON Record
12331233
^^^^^^^^^^^^^^^^^^^^^^^^^^^^

llvm/docs/LangRef.rst

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4060,24 +4060,6 @@ or constants of this type.
40604060
x86_amx
40614061

40624062

4063-
X86_mmx Type
4064-
""""""""""""
4065-
4066-
:Overview:
4067-
4068-
The x86_mmx type represents a value held in an MMX register on an x86
4069-
machine. The operations allowed on it are quite limited: parameters and
4070-
return values, load and store, and bitcast. User-specified MMX
4071-
instructions are represented as intrinsic or asm calls with arguments
4072-
and/or results of this type. There are no arrays, vectors or constants
4073-
of this type.
4074-
4075-
:Syntax:
4076-
4077-
::
4078-
4079-
x86_mmx
4080-
40814063

40824064
.. _t_pointer:
40834065

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

4514-
There are no constants of type x86_mmx and x86_amx.
4496+
There are no constants of type x86_amx.
45154497

45164498
.. _complexconstants:
45174499

llvm/docs/ReleaseNotes.rst

Lines changed: 187 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,187 @@
1+
============================
2+
LLVM |release| Release Notes
3+
============================
4+
5+
.. contents::
6+
:local:
7+
8+
.. only:: PreRelease
9+
10+
.. warning::
11+
These are in-progress notes for the upcoming LLVM |version| release.
12+
Release notes for previous releases can be found on
13+
`the Download Page <https://releases.llvm.org/download.html>`_.
14+
15+
16+
Introduction
17+
============
18+
19+
This document contains the release notes for the LLVM Compiler Infrastructure,
20+
release |release|. Here we describe the status of LLVM, including major improvements
21+
from the previous release, improvements in various subprojects of LLVM, and
22+
some of the current users of the code. All LLVM releases may be downloaded
23+
from the `LLVM releases web site <https://llvm.org/releases/>`_.
24+
25+
For more information about LLVM, including information about the latest
26+
release, please check out the `main LLVM web site <https://llvm.org/>`_. If you
27+
have questions or comments, the `Discourse forums
28+
<https://discourse.llvm.org>`_ is a good place to ask
29+
them.
30+
31+
Note that if you are reading this file from a Git checkout or the main
32+
LLVM web page, this document applies to the *next* release, not the current
33+
one. To see the release notes for a specific release, please see the `releases
34+
page <https://llvm.org/releases/>`_.
35+
36+
Non-comprehensive list of changes in this release
37+
=================================================
38+
.. NOTE
39+
For small 1-3 sentence descriptions, just add an entry at the end of
40+
this list. If your description won't fit comfortably in one bullet
41+
point (e.g. maybe you would like to give an example of the
42+
functionality, or simply have a lot to talk about), see the `NOTE` below
43+
for adding a new subsection.
44+
45+
* ...
46+
47+
Update on required toolchains to build LLVM
48+
-------------------------------------------
49+
50+
Changes to the LLVM IR
51+
----------------------
52+
53+
* The ``x86_mmx`` IR type has been removed. It will be translated to
54+
the standard vector type ``<1 x i64>`` in bitcode upgrade.
55+
56+
Changes to LLVM infrastructure
57+
------------------------------
58+
59+
Changes to building LLVM
60+
------------------------
61+
62+
Changes to TableGen
63+
-------------------
64+
65+
Changes to Interprocedural Optimizations
66+
----------------------------------------
67+
68+
Changes to the AArch64 Backend
69+
------------------------------
70+
71+
* `.balign N, 0`, `.p2align N, 0`, `.align N, 0` in code sections will now fill
72+
the required alignment space with a sequence of `0x0` bytes (the requested
73+
fill value) rather than NOPs.
74+
75+
Changes to the AMDGPU Backend
76+
-----------------------------
77+
78+
Changes to the ARM Backend
79+
--------------------------
80+
81+
* `.balign N, 0`, `.p2align N, 0`, `.align N, 0` in code sections will now fill
82+
the required alignment space with a sequence of `0x0` bytes (the requested
83+
fill value) rather than NOPs.
84+
85+
Changes to the AVR Backend
86+
--------------------------
87+
88+
Changes to the DirectX Backend
89+
------------------------------
90+
91+
Changes to the Hexagon Backend
92+
------------------------------
93+
94+
Changes to the LoongArch Backend
95+
--------------------------------
96+
97+
Changes to the MIPS Backend
98+
---------------------------
99+
100+
Changes to the PowerPC Backend
101+
------------------------------
102+
103+
Changes to the RISC-V Backend
104+
-----------------------------
105+
106+
* `.balign N, 0`, `.p2align N, 0`, `.align N, 0` in code sections will now fill
107+
the required alignment space with a sequence of `0x0` bytes (the requested
108+
fill value) rather than NOPs.
109+
110+
Changes to the WebAssembly Backend
111+
----------------------------------
112+
113+
Changes to the Windows Target
114+
-----------------------------
115+
116+
Changes to the X86 Backend
117+
--------------------------
118+
119+
* `.balign N, 0x90`, `.p2align N, 0x90`, and `.align N, 0x90` in code sections
120+
now fill the required alignment space with repeating `0x90` bytes, rather than
121+
using optimised NOP filling. Optimised NOP filling fills the space with NOP
122+
instructions of various widths, not just those that use the `0x90` byte
123+
encoding. To use optimised NOP filling in a code section, leave off the
124+
"fillval" argument, i.e. `.balign N`, `.p2align N` or `.align N` respectively.
125+
126+
* Due to the removal of the ``x86_mmx`` IR type, functions with
127+
``x86_mmx`` arguments or return values will use a different,
128+
incompatible, calling convention ABI. Such functions are not
129+
generally seen in the wild (Clang never generates them!), so this is
130+
not expected to result in real-world compatibility problems.
131+
132+
Changes to the OCaml bindings
133+
-----------------------------
134+
135+
Changes to the Python bindings
136+
------------------------------
137+
138+
Changes to the C API
139+
--------------------
140+
141+
* The following symbols are deleted due to the removal of the ``x86_mmx`` IR type:
142+
143+
* ``LLVMX86_MMXTypeKind``
144+
* ``LLVMX86MMXTypeInContext``
145+
* ``LLVMX86MMXType``
146+
147+
Changes to the CodeGen infrastructure
148+
-------------------------------------
149+
150+
Changes to the Metadata Info
151+
---------------------------------
152+
153+
Changes to the Debug Info
154+
---------------------------------
155+
156+
Changes to the LLVM tools
157+
---------------------------------
158+
159+
Changes to LLDB
160+
---------------------------------
161+
162+
Changes to BOLT
163+
---------------------------------
164+
165+
Changes to Sanitizers
166+
---------------------
167+
168+
Other Changes
169+
-------------
170+
171+
External Open Source Projects Using LLVM 19
172+
===========================================
173+
174+
* A project...
175+
176+
Additional Information
177+
======================
178+
179+
A wide variety of additional information is available on the `LLVM web page
180+
<https://llvm.org/>`_, in particular in the `documentation
181+
<https://llvm.org/docs/>`_ section. The web page also contains versions of the
182+
API documentation which is up-to-date with the Git version of the source
183+
code. You can access versions of these documents specific to this release by
184+
going into the ``llvm/docs/`` directory in the LLVM tree.
185+
186+
If you have any questions or comments about LLVM, please feel free to contact
187+
us via the `Discourse forums <https://discourse.llvm.org>`_.

llvm/include/llvm-c/Core.h

Lines changed: 21 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -146,27 +146,27 @@ typedef enum {
146146
} LLVMOpcode;
147147

148148
typedef enum {
149-
LLVMVoidTypeKind, /**< type with no size */
150-
LLVMHalfTypeKind, /**< 16 bit floating point type */
151-
LLVMFloatTypeKind, /**< 32 bit floating point type */
152-
LLVMDoubleTypeKind, /**< 64 bit floating point type */
153-
LLVMX86_FP80TypeKind, /**< 80 bit floating point type (X87) */
154-
LLVMFP128TypeKind, /**< 128 bit floating point type (112-bit mantissa)*/
155-
LLVMPPC_FP128TypeKind, /**< 128 bit floating point type (two 64-bits) */
156-
LLVMLabelTypeKind, /**< Labels */
157-
LLVMIntegerTypeKind, /**< Arbitrary bit width integers */
158-
LLVMFunctionTypeKind, /**< Functions */
159-
LLVMStructTypeKind, /**< Structures */
160-
LLVMArrayTypeKind, /**< Arrays */
161-
LLVMPointerTypeKind, /**< Pointers */
162-
LLVMVectorTypeKind, /**< Fixed width SIMD vector type */
163-
LLVMMetadataTypeKind, /**< Metadata */
164-
LLVMX86_MMXTypeKind, /**< X86 MMX */
165-
LLVMTokenTypeKind, /**< Tokens */
166-
LLVMScalableVectorTypeKind, /**< Scalable SIMD vector type */
167-
LLVMBFloatTypeKind, /**< 16 bit brain floating point type */
168-
LLVMX86_AMXTypeKind, /**< X86 AMX */
169-
LLVMTargetExtTypeKind, /**< Target extension type */
149+
LLVMVoidTypeKind = 0, /**< type with no size */
150+
LLVMHalfTypeKind = 1, /**< 16 bit floating point type */
151+
LLVMFloatTypeKind = 2, /**< 32 bit floating point type */
152+
LLVMDoubleTypeKind = 3, /**< 64 bit floating point type */
153+
LLVMX86_FP80TypeKind = 4, /**< 80 bit floating point type (X87) */
154+
LLVMFP128TypeKind = 5, /**< 128 bit floating point type (112-bit mantissa)*/
155+
LLVMPPC_FP128TypeKind = 6, /**< 128 bit floating point type (two 64-bits) */
156+
LLVMLabelTypeKind = 7, /**< Labels */
157+
LLVMIntegerTypeKind = 8, /**< Arbitrary bit width integers */
158+
LLVMFunctionTypeKind = 9, /**< Functions */
159+
LLVMStructTypeKind = 10, /**< Structures */
160+
LLVMArrayTypeKind = 11, /**< Arrays */
161+
LLVMPointerTypeKind = 12, /**< Pointers */
162+
LLVMVectorTypeKind = 13, /**< Fixed width SIMD vector type */
163+
LLVMMetadataTypeKind = 14, /**< Metadata */
164+
/* 15 previously used by LLVMX86_MMXTypeKind */
165+
LLVMTokenTypeKind = 16, /**< Tokens */
166+
LLVMScalableVectorTypeKind = 17, /**< Scalable SIMD vector type */
167+
LLVMBFloatTypeKind = 18, /**< 16 bit brain floating point type */
168+
LLVMX86_AMXTypeKind = 19, /**< X86 AMX */
169+
LLVMTargetExtTypeKind = 20, /**< Target extension type */
170170
} LLVMTypeKind;
171171

172172
typedef enum {
@@ -1734,11 +1734,6 @@ LLVMTypeRef LLVMVoidTypeInContext(LLVMContextRef C);
17341734
*/
17351735
LLVMTypeRef LLVMLabelTypeInContext(LLVMContextRef C);
17361736

1737-
/**
1738-
* Create a X86 MMX type in a context.
1739-
*/
1740-
LLVMTypeRef LLVMX86MMXTypeInContext(LLVMContextRef C);
1741-
17421737
/**
17431738
* Create a X86 AMX type in a context.
17441739
*/
@@ -1760,7 +1755,6 @@ LLVMTypeRef LLVMMetadataTypeInContext(LLVMContextRef C);
17601755
*/
17611756
LLVMTypeRef LLVMVoidType(void);
17621757
LLVMTypeRef LLVMLabelType(void);
1763-
LLVMTypeRef LLVMX86MMXType(void);
17641758
LLVMTypeRef LLVMX86AMXType(void);
17651759

17661760
/**

llvm/include/llvm/IR/DataLayout.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,6 @@ inline TypeSize DataLayout::getTypeSizeInBits(Type *Ty) const {
646646
case Type::FloatTyID:
647647
return TypeSize::getFixed(32);
648648
case Type::DoubleTyID:
649-
case Type::X86_MMXTyID:
650649
return TypeSize::getFixed(64);
651650
case Type::PPC_FP128TyID:
652651
case Type::FP128TyID:

llvm/include/llvm/IR/Type.h

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ class Type {
6363
VoidTyID, ///< type with no size
6464
LabelTyID, ///< Labels
6565
MetadataTyID, ///< Metadata
66-
X86_MMXTyID, ///< MMX vectors (64 bits, X86 specific)
6766
X86_AMXTyID, ///< AMX vectors (8192 bits, X86 specific)
6867
TokenTyID, ///< Tokens
6968

@@ -197,9 +196,6 @@ class Type {
197196

198197
const fltSemantics &getFltSemantics() const;
199198

200-
/// Return true if this is X86 MMX.
201-
bool isX86_MMXTy() const { return getTypeID() == X86_MMXTyID; }
202-
203199
/// Return true if this is X86 AMX.
204200
bool isX86_AMXTy() const { return getTypeID() == X86_AMXTyID; }
205201

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

292288
/// Return true if the type is an aggregate type. This means it is valid as
@@ -302,8 +298,7 @@ class Type {
302298
bool isSized(SmallPtrSetImpl<Type*> *Visited = nullptr) const {
303299
// If it's a primitive, it is always sized.
304300
if (getTypeID() == IntegerTyID || isFloatingPointTy() ||
305-
getTypeID() == PointerTyID || getTypeID() == X86_MMXTyID ||
306-
getTypeID() == X86_AMXTyID)
301+
getTypeID() == PointerTyID || getTypeID() == X86_AMXTyID)
307302
return true;
308303
// If it is not something that can have a size (e.g. a function or label),
309304
// it doesn't have a size.
@@ -445,7 +440,6 @@ class Type {
445440
static Type *getX86_FP80Ty(LLVMContext &C);
446441
static Type *getFP128Ty(LLVMContext &C);
447442
static Type *getPPC_FP128Ty(LLVMContext &C);
448-
static Type *getX86_MMXTy(LLVMContext &C);
449443
static Type *getX86_AMXTy(LLVMContext &C);
450444
static Type *getTokenTy(LLVMContext &C);
451445
static IntegerType *getIntNTy(LLVMContext &C, unsigned N);

0 commit comments

Comments
 (0)