Skip to content

Commit ee40ffd

Browse files
[X86] Recognize VPXORDZrr as a zero-idiom on Znver4 (#108314)
This patch adds information about VPXORDZrr to the znver4 scheduling model, particularly that it is a zero-idiom. This fixes a proximal cause of #108157.
1 parent a6a547f commit ee40ffd

File tree

2 files changed

+201
-187
lines changed

2 files changed

+201
-187
lines changed

llvm/lib/Target/X86/X86ScheduleZnver4.td

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1855,6 +1855,14 @@ def Zn4WriteVZeroIdiomLogicX : SchedWriteVariant<[
18551855
// NOTE: PXORrr,PANDNrr are not zero-cycle!
18561856
def : InstRW<[Zn4WriteVZeroIdiomLogicX], (instrs VPXORrr, VPANDNrr)>;
18571857

1858+
// TODO: This should be extended to incorporate all of the AVX512 zeroing
1859+
// idioms that can be executed by the renamer.
1860+
def Zn4WriteVZeroIdiomLogicZ : SchedWriteVariant<[
1861+
SchedVar<MCSchedPredicate<ZeroIdiomPredicate>, [Zn4WriteZeroLatency]>,
1862+
SchedVar<NoSchedPred, [WriteVecLogicZ]>
1863+
]>;
1864+
def : InstRW<[Zn4WriteVZeroIdiomLogicZ], (instrs VPXORDZrr)>;
1865+
18581866
def Zn4WriteVZeroIdiomLogicY : SchedWriteVariant<[
18591867
SchedVar<MCSchedPredicate<ZeroIdiomPredicate>, [Zn4WriteZeroLatency]>,
18601868
SchedVar<NoSchedPred, [WriteVecLogicY]>
@@ -1930,6 +1938,12 @@ def : IsZeroIdiomFunction<[
19301938
VPSUBUSBYrr, VPSUBUSWYrr,
19311939
VPCMPGTBYrr, VPCMPGTWYrr, VPCMPGTDYrr, VPCMPGTQYrr
19321940
], ZeroIdiomPredicate>,
1941+
1942+
// AVX ZMM Zero-idioms.
1943+
// TODO: This should be expanded to incorporate all AVX512 zeroing idioms.
1944+
DepBreakingClass<[
1945+
VPXORDZrr
1946+
], ZeroIdiomPredicate>,
19331947
]>;
19341948

19351949
def : IsDepBreakingFunction<[

0 commit comments

Comments
 (0)