Skip to content

Commit bf64918

Browse files
committed
[X86][AMX] Prevent shape def being scheduled across ldtilecfg.
Differential Revision: https://reviews.llvm.org/D95582
1 parent 68195b1 commit bf64918

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

llvm/lib/Target/X86/X86InstrInfo.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6788,7 +6788,8 @@ bool X86InstrInfo::isSchedulingBoundary(const MachineInstr &MI,
67886788

67896789
// ENDBR instructions should not be scheduled around.
67906790
unsigned Opcode = MI.getOpcode();
6791-
if (Opcode == X86::ENDBR64 || Opcode == X86::ENDBR32)
6791+
if (Opcode == X86::ENDBR64 || Opcode == X86::ENDBR32 ||
6792+
Opcode == X86::PLDTILECFG)
67926793
return true;
67936794

67946795
return TargetInstrInfo::isSchedulingBoundary(MI, MBB, MF);
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+amx-int8 -mattr=+avx512f -mcpu=skx -verify-machineinstrs | FileCheck %s
2+
3+
define <256 x i32> @test_shape_sched(i16 %m, i16 %n, i16 %k, <256 x i32> %c, <256 x i32> %a, <256 x i32> %b) nounwind {
4+
; Just to make sure shape def is not scheduled across ldtilecfg.
5+
; CHECK: ldtilecfg
6+
; CHECK-NOT: movw
7+
%c1 = bitcast <256 x i32> %c to x86_amx
8+
%a1 = bitcast <256 x i32> %a to x86_amx
9+
%b1 = bitcast <256 x i32> %b to x86_amx
10+
%t = call x86_amx @llvm.x86.tdpbssd.internal(i16 %m, i16 %n, i16 %k, x86_amx %c1, x86_amx %a1, x86_amx %b1)
11+
%res = bitcast x86_amx %t to <256 x i32>
12+
ret <256 x i32> %res
13+
}
14+
15+
16+
declare x86_amx @llvm.x86.tdpbssd.internal(i16, i16, i16, x86_amx, x86_amx, x86_amx)

0 commit comments

Comments
 (0)