Skip to content

Commit da5fd70

Browse files
mikolaj-pirogDebadri Basak
authored andcommitted
[X86] Remove AMX-TRANSPOSE (llvm#165556)
Per Intel Architecture Instruction Set Extensions Programming Reference rev. 59 (https://cdrdv2.intel.com/v1/dl/getContent/671368), Revision History entry for revision -59, AMX-TRANSPOSE was removed
1 parent 066939e commit da5fd70

File tree

82 files changed

+5835
-11141
lines changed

Some content is hidden

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

82 files changed

+5835
-11141
lines changed

clang/include/clang/Basic/BuiltinsX86_64.td

Lines changed: 0 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -239,57 +239,6 @@ let Features = "amx-complex", Attributes = [NoThrow] in {
239239
def tcmmrlfp16ps_internal : X86Builtin<"_Vector<256, int>(unsigned short, unsigned short, unsigned short, _Vector<256, int>, _Vector<256, int>, _Vector<256, int>)">;
240240
}
241241

242-
let Features = "amx-transpose", Attributes = [NoThrow] in {
243-
def t2rpntlvwz0_internal : X86Builtin<"void(unsigned short, unsigned short, unsigned short, _Vector<256, int *>, _Vector<256, int *>, void const *, size_t)">;
244-
}
245-
246-
let Features = "amx-movrs,amx-transpose", Attributes = [NoThrow] in {
247-
def t2rpntlvwz0rs_internal : X86Builtin<"void(unsigned short, unsigned short, unsigned short, _Vector<256, int *>, _Vector<256, int *>, void const *, size_t)">;
248-
}
249-
250-
let Features = "amx-transpose", Attributes = [NoThrow] in {
251-
def t2rpntlvwz0t1_internal : X86Builtin<"void(unsigned short, unsigned short, unsigned short, _Vector<256, int *>, _Vector<256, int *>, void const *, size_t)">;
252-
}
253-
254-
let Features = "amx-movrs,amx-transpose", Attributes = [NoThrow] in {
255-
def t2rpntlvwz0rst1_internal : X86Builtin<"void(unsigned short, unsigned short, unsigned short, _Vector<256, int *>, _Vector<256, int *>, void const *, size_t)">;
256-
}
257-
258-
let Features = "amx-transpose", Attributes = [NoThrow] in {
259-
def t2rpntlvwz1_internal : X86Builtin<"void(unsigned short, unsigned short, unsigned short, _Vector<256, int *>, _Vector<256, int *>, void const *, size_t)">;
260-
}
261-
262-
let Features = "amx-movrs,amx-transpose", Attributes = [NoThrow] in {
263-
def t2rpntlvwz1rs_internal : X86Builtin<"void(unsigned short, unsigned short, unsigned short, _Vector<256, int *>, _Vector<256, int *>, void const *, size_t)">;
264-
}
265-
266-
let Features = "amx-transpose", Attributes = [NoThrow] in {
267-
def t2rpntlvwz1t1_internal : X86Builtin<"void(unsigned short, unsigned short, unsigned short, _Vector<256, int *>, _Vector<256, int *>, void const *, size_t)">;
268-
}
269-
270-
let Features = "amx-movrs,amx-transpose", Attributes = [NoThrow] in {
271-
def t2rpntlvwz1rst1_internal : X86Builtin<"void(unsigned short, unsigned short, unsigned short, _Vector<256, int *>, _Vector<256, int *>, void const *, size_t)">;
272-
}
273-
274-
let Features = "amx-transpose", Attributes = [NoThrow] in {
275-
def ttransposed_internal : X86Builtin<"_Vector<256, int>(unsigned short, unsigned short, _Vector<256, int>)">;
276-
}
277-
278-
let Features = "amx-bf16,amx-transpose", Attributes = [NoThrow] in {
279-
def ttdpbf16ps_internal : X86Builtin<"_Vector<256, int>(unsigned short, unsigned short, unsigned short, _Vector<256, int>, _Vector<256, int>, _Vector<256, int>)">;
280-
}
281-
282-
let Features = "amx-fp16,amx-transpose", Attributes = [NoThrow] in {
283-
def ttdpfp16ps_internal : X86Builtin<"_Vector<256, int>(unsigned short, unsigned short, unsigned short, _Vector<256, int>, _Vector<256, int>, _Vector<256, int>)">;
284-
}
285-
286-
let Features = "amx-complex,amx-transpose", Attributes = [NoThrow] in {
287-
def ttcmmimfp16ps_internal : X86Builtin<"_Vector<256, int>(unsigned short, unsigned short, unsigned short, _Vector<256, int>, _Vector<256, int>, _Vector<256, int>)">;
288-
def ttcmmrlfp16ps_internal : X86Builtin<"_Vector<256, int>(unsigned short, unsigned short, unsigned short, _Vector<256, int>, _Vector<256, int>, _Vector<256, int>)">;
289-
def tconjtcmmimfp16ps_internal : X86Builtin<"_Vector<256, int>(unsigned short, unsigned short, unsigned short, _Vector<256, int>, _Vector<256, int>, _Vector<256, int>)">;
290-
def tconjtfp16_internal : X86Builtin<"_Vector<256, int>(unsigned short, unsigned short, _Vector<256, int>)">;
291-
}
292-
293242
let Features = "amx-avx512,avx10.2", Attributes = [NoThrow] in {
294243
def tcvtrowd2ps_internal : X86Builtin<"_Vector<16, float>(unsigned short, unsigned short, _Vector<256, int>, unsigned int)">;
295244
def tcvtrowps2bf16h_internal : X86Builtin<"_Vector<32, __bf16>(unsigned short, unsigned short, _Vector<256, int>, unsigned int)">;
@@ -303,10 +252,6 @@ let Features = "amx-tf32", Attributes = [NoThrow] in {
303252
def tmmultf32ps_internal : X86Builtin<"_Vector<256, int>(unsigned short, unsigned short, unsigned short, _Vector<256, int>, _Vector<256, int>, _Vector<256, int>)">;
304253
}
305254

306-
let Features = "amx-tf32,amx-transpose", Attributes = [NoThrow] in {
307-
def ttmmultf32ps_internal : X86Builtin<"_Vector<256, int>(unsigned short, unsigned short, unsigned short, _Vector<256, int>, _Vector<256, int>, _Vector<256, int>)">;
308-
}
309-
310255
let Features = "amx-fp8", Attributes = [NoThrow] in {
311256
def tdpbf8ps_internal : X86Builtin<"_Vector<256, int>(unsigned short, unsigned short, unsigned short, _Vector<256, int>, _Vector<256, int>, _Vector<256, int>)">;
312257
def tdpbhf8ps_internal : X86Builtin<"_Vector<256, int>(unsigned short, unsigned short, unsigned short, _Vector<256, int>, _Vector<256, int>, _Vector<256, int>)">;
@@ -321,13 +266,6 @@ let Features = "amx-tile", Attributes = [NoThrow] in {
321266
def tilezero : X86Builtin<"void(unsigned char)">;
322267
}
323268

324-
let Features = "amx-movrs,amx-transpose", Attributes = [NoThrow] in {
325-
def t2rpntlvwz0rs : X86Builtin<"void(_Constant unsigned char, void const *, size_t)">;
326-
def t2rpntlvwz0rst1 : X86Builtin<"void(_Constant unsigned char, void const *, size_t)">;
327-
def t2rpntlvwz1rs : X86Builtin<"void(_Constant unsigned char, void const *, size_t)">;
328-
def t2rpntlvwz1rst1 : X86Builtin<"void(_Constant unsigned char, void const *, size_t)">;
329-
}
330-
331269
let Features = "amx-movrs", Attributes = [NoThrow] in {
332270
def tileloaddrs64 : X86Builtin<"void(_Constant unsigned char, void const *, size_t)">;
333271
def tileloaddrst164 : X86Builtin<"void(_Constant unsigned char, void const *, size_t)">;
@@ -359,29 +297,6 @@ let Features = "amx-complex", Attributes = [NoThrow] in {
359297
def tcmmrlfp16ps : X86Builtin<"void(_Constant unsigned char, _Constant unsigned char, _Constant unsigned char)">;
360298
}
361299

362-
let Features = "amx-transpose", Attributes = [NoThrow] in {
363-
def t2rpntlvwz0 : X86Builtin<"void(_Constant unsigned char, void const *, size_t)">;
364-
def t2rpntlvwz0t1 : X86Builtin<"void(_Constant unsigned char, void const *, size_t)">;
365-
def t2rpntlvwz1 : X86Builtin<"void(_Constant unsigned char, void const *, size_t)">;
366-
def t2rpntlvwz1t1 : X86Builtin<"void(_Constant unsigned char, void const *, size_t)">;
367-
def ttransposed : X86Builtin<"void(_Constant unsigned char, _Constant unsigned char)">;
368-
}
369-
370-
let Features = "amx-bf16,amx-transpose", Attributes = [NoThrow] in {
371-
def ttdpbf16ps : X86Builtin<"void(_Constant unsigned char, _Constant unsigned char, _Constant unsigned char)">;
372-
}
373-
374-
let Features = "amx-fp16,amx-transpose", Attributes = [NoThrow] in {
375-
def ttdpfp16ps : X86Builtin<"void(_Constant unsigned char, _Constant unsigned char, _Constant unsigned char)">;
376-
}
377-
378-
let Features = "amx-complex,amx-transpose", Attributes = [NoThrow] in {
379-
def ttcmmimfp16ps : X86Builtin<"void(_Constant unsigned char, _Constant unsigned char, _Constant unsigned char)">;
380-
def ttcmmrlfp16ps : X86Builtin<"void(_Constant unsigned char, _Constant unsigned char, _Constant unsigned char)">;
381-
def tconjtcmmimfp16ps : X86Builtin<"void(_Constant unsigned char, _Constant unsigned char, _Constant unsigned char)">;
382-
def tconjtfp16 : X86Builtin<"void(_Constant unsigned char, _Constant unsigned char)">;
383-
}
384-
385300
let Features = "amx-avx512,avx10.2", Attributes = [NoThrow] in {
386301
def tcvtrowd2ps : X86Builtin<"_Vector<16, float>(_Constant unsigned char, unsigned int)">;
387302
def tcvtrowps2bf16h : X86Builtin<"_Vector<32, __bf16>(_Constant unsigned char, unsigned int)">;
@@ -406,10 +321,6 @@ let Features = "amx-tf32", Attributes = [NoThrow] in {
406321
def tmmultf32ps : X86Builtin<"void(_Constant unsigned char, _Constant unsigned char, _Constant unsigned char)">;
407322
}
408323

409-
let Features = "amx-tf32,amx-transpose", Attributes = [NoThrow] in {
410-
def ttmmultf32ps : X86Builtin<"void(_Constant unsigned char, _Constant unsigned char, _Constant unsigned char)">;
411-
}
412-
413324
let Features = "prefetchi", Attributes = [NoThrow, Const] in {
414325
def prefetchi : X86Builtin<"void(void const *, unsigned int)">;
415326
}

clang/include/clang/Driver/Options.td

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6695,8 +6695,6 @@ def mamx_tf32 : Flag<["-"], "mamx-tf32">, Group<m_x86_Features_Group>;
66956695
def mno_amx_tf32 : Flag<["-"], "mno-amx-tf32">, Group<m_x86_Features_Group>;
66966696
def mamx_tile : Flag<["-"], "mamx-tile">, Group<m_x86_Features_Group>;
66976697
def mno_amx_tile : Flag<["-"], "mno-amx-tile">, Group<m_x86_Features_Group>;
6698-
def mamx_transpose : Flag<["-"], "mamx-transpose">, Group<m_x86_Features_Group>;
6699-
def mno_amx_transpose : Flag<["-"], "mno-amx-transpose">, Group<m_x86_Features_Group>;
67006698
def mamx_movrs: Flag<["-"], "mamx-movrs">, Group<m_x86_Features_Group>;
67016699
def mno_amx_movrs: Flag<["-"], "mno-amx-movrs">, Group<m_x86_Features_Group>;
67026700
def mcmpccxadd : Flag<["-"], "mcmpccxadd">, Group<m_x86_Features_Group>;

clang/lib/Basic/Targets/X86.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -396,8 +396,6 @@ bool X86TargetInfo::handleTargetFeatures(std::vector<std::string> &Features,
396396
HasAMXFP8 = true;
397397
} else if (Feature == "+amx-movrs") {
398398
HasAMXMOVRS = true;
399-
} else if (Feature == "+amx-transpose") {
400-
HasAMXTRANSPOSE = true;
401399
} else if (Feature == "+amx-avx512") {
402400
HasAMXAVX512 = true;
403401
} else if (Feature == "+amx-tf32") {
@@ -925,8 +923,6 @@ void X86TargetInfo::getTargetDefines(const LangOptions &Opts,
925923
Builder.defineMacro("__AMX_FP8__");
926924
if (HasAMXMOVRS)
927925
Builder.defineMacro("__AMX_MOVRS__");
928-
if (HasAMXTRANSPOSE)
929-
Builder.defineMacro("__AMX_TRANSPOSE__");
930926
if (HasAMXAVX512)
931927
Builder.defineMacro("__AMX_AVX512__");
932928
if (HasAMXTF32)
@@ -1068,7 +1064,6 @@ bool X86TargetInfo::isValidFeatureName(StringRef Name) const {
10681064
.Case("amx-movrs", true)
10691065
.Case("amx-tf32", true)
10701066
.Case("amx-tile", true)
1071-
.Case("amx-transpose", true)
10721067
.Case("avx", true)
10731068
.Case("avx10.1", true)
10741069
.Case("avx10.2", true)
@@ -1189,7 +1184,6 @@ bool X86TargetInfo::hasFeature(StringRef Feature) const {
11891184
.Case("amx-movrs", HasAMXMOVRS)
11901185
.Case("amx-tf32", HasAMXTF32)
11911186
.Case("amx-tile", HasAMXTILE)
1192-
.Case("amx-transpose", HasAMXTRANSPOSE)
11931187
.Case("avx", SSELevel >= AVX)
11941188
.Case("avx10.1", HasAVX10_1)
11951189
.Case("avx10.2", HasAVX10_2)

clang/lib/Basic/Targets/X86.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,6 @@ class LLVM_LIBRARY_VISIBILITY X86TargetInfo : public TargetInfo {
160160
bool HasAMXCOMPLEX = false;
161161
bool HasAMXFP8 = false;
162162
bool HasAMXMOVRS = false;
163-
bool HasAMXTRANSPOSE = false;
164163
bool HasAMXAVX512 = false;
165164
bool HasAMXTF32 = false;
166165
bool HasSERIALIZE = false;

clang/lib/CodeGen/TargetBuiltins/X86.cpp

Lines changed: 0 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -2931,74 +2931,6 @@ Value *CodeGenFunction::EmitX86BuiltinExpr(unsigned BuiltinID,
29312931
// instruction, but it will create a memset that won't be optimized away.
29322932
return Builder.CreateMemSet(Ops[0], Ops[1], Ops[2], Align(1), true);
29332933
}
2934-
// Corresponding to intrisics which will return 2 tiles (tile0_tile1).
2935-
case X86::BI__builtin_ia32_t2rpntlvwz0_internal:
2936-
case X86::BI__builtin_ia32_t2rpntlvwz0rs_internal:
2937-
case X86::BI__builtin_ia32_t2rpntlvwz0t1_internal:
2938-
case X86::BI__builtin_ia32_t2rpntlvwz0rst1_internal:
2939-
case X86::BI__builtin_ia32_t2rpntlvwz1_internal:
2940-
case X86::BI__builtin_ia32_t2rpntlvwz1rs_internal:
2941-
case X86::BI__builtin_ia32_t2rpntlvwz1t1_internal:
2942-
case X86::BI__builtin_ia32_t2rpntlvwz1rst1_internal: {
2943-
Intrinsic::ID IID;
2944-
switch (BuiltinID) {
2945-
default:
2946-
llvm_unreachable("Unsupported intrinsic!");
2947-
case X86::BI__builtin_ia32_t2rpntlvwz0_internal:
2948-
IID = Intrinsic::x86_t2rpntlvwz0_internal;
2949-
break;
2950-
case X86::BI__builtin_ia32_t2rpntlvwz0rs_internal:
2951-
IID = Intrinsic::x86_t2rpntlvwz0rs_internal;
2952-
break;
2953-
case X86::BI__builtin_ia32_t2rpntlvwz0t1_internal:
2954-
IID = Intrinsic::x86_t2rpntlvwz0t1_internal;
2955-
break;
2956-
case X86::BI__builtin_ia32_t2rpntlvwz0rst1_internal:
2957-
IID = Intrinsic::x86_t2rpntlvwz0rst1_internal;
2958-
break;
2959-
case X86::BI__builtin_ia32_t2rpntlvwz1_internal:
2960-
IID = Intrinsic::x86_t2rpntlvwz1_internal;
2961-
break;
2962-
case X86::BI__builtin_ia32_t2rpntlvwz1rs_internal:
2963-
IID = Intrinsic::x86_t2rpntlvwz1rs_internal;
2964-
break;
2965-
case X86::BI__builtin_ia32_t2rpntlvwz1t1_internal:
2966-
IID = Intrinsic::x86_t2rpntlvwz1t1_internal;
2967-
break;
2968-
case X86::BI__builtin_ia32_t2rpntlvwz1rst1_internal:
2969-
IID = Intrinsic::x86_t2rpntlvwz1rst1_internal;
2970-
break;
2971-
}
2972-
2973-
// Ops = (Row0, Col0, Col1, DstPtr0, DstPtr1, SrcPtr, Stride)
2974-
Value *Call = Builder.CreateCall(CGM.getIntrinsic(IID),
2975-
{Ops[0], Ops[1], Ops[2], Ops[5], Ops[6]});
2976-
2977-
auto *PtrTy = E->getArg(3)->getType()->getAs<PointerType>();
2978-
assert(PtrTy && "arg3 must be of pointer type");
2979-
QualType PtreeTy = PtrTy->getPointeeType();
2980-
llvm::Type *TyPtee = ConvertType(PtreeTy);
2981-
2982-
// Bitcast amx type (x86_amx) to vector type (256 x i32)
2983-
// Then store tile0 into DstPtr0
2984-
Value *T0 = Builder.CreateExtractValue(Call, 0);
2985-
Value *VecT0 = Builder.CreateIntrinsic(Intrinsic::x86_cast_tile_to_vector,
2986-
{TyPtee}, {T0});
2987-
Builder.CreateDefaultAlignedStore(VecT0, Ops[3]);
2988-
2989-
// Then store tile1 into DstPtr1
2990-
Value *T1 = Builder.CreateExtractValue(Call, 1);
2991-
Value *VecT1 = Builder.CreateIntrinsic(Intrinsic::x86_cast_tile_to_vector,
2992-
{TyPtee}, {T1});
2993-
Value *Store = Builder.CreateDefaultAlignedStore(VecT1, Ops[4]);
2994-
2995-
// Note: Here we escape directly use x86_tilestored64_internal to store
2996-
// the results due to it can't make sure the Mem written scope. This may
2997-
// cause shapes reloads after first amx intrinsic, which current amx reg-
2998-
// ister allocation has no ability to handle it.
2999-
3000-
return Store;
3001-
}
30022934
case X86::BI__ud2:
30032935
// llvm.trap makes a ud2a instruction on x86.
30042936
return EmitTrapCall(Intrinsic::trap);

clang/lib/Headers/CMakeLists.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -162,18 +162,12 @@ set(x86_files
162162
adxintrin.h
163163
ammintrin.h
164164
amxavx512intrin.h
165-
amxbf16transposeintrin.h
166165
amxcomplexintrin.h
167-
amxcomplextransposeintrin.h
168166
amxfp16intrin.h
169-
amxfp16transposeintrin.h
170167
amxfp8intrin.h
171168
amxintrin.h
172169
amxmovrsintrin.h
173-
amxmovrstransposeintrin.h
174170
amxtf32intrin.h
175-
amxtf32transposeintrin.h
176-
amxtransposeintrin.h
177171
avx10_2_512bf16intrin.h
178172
avx10_2_512convertintrin.h
179173
avx10_2_512minmaxintrin.h

clang/lib/Headers/amxbf16transposeintrin.h

Lines changed: 0 additions & 94 deletions
This file was deleted.

0 commit comments

Comments
 (0)