Skip to content

Commit

Permalink
[X86] Recognize VPXORDZrr as a zero-idiom on Znver4 (llvm#108314)
Browse files Browse the repository at this point in the history
This patch adds information about VPXORDZrr to the znver4 scheduling
model, particularly that it is a zero-idiom.

This fixes a proximal cause of llvm#108157.
  • Loading branch information
boomanaiden154 authored Sep 12, 2024
1 parent a6a547f commit ee40ffd
Show file tree
Hide file tree
Showing 2 changed files with 201 additions and 187 deletions.
14 changes: 14 additions & 0 deletions llvm/lib/Target/X86/X86ScheduleZnver4.td
Original file line number Diff line number Diff line change
Expand Up @@ -1855,6 +1855,14 @@ def Zn4WriteVZeroIdiomLogicX : SchedWriteVariant<[
// NOTE: PXORrr,PANDNrr are not zero-cycle!
def : InstRW<[Zn4WriteVZeroIdiomLogicX], (instrs VPXORrr, VPANDNrr)>;

// TODO: This should be extended to incorporate all of the AVX512 zeroing
// idioms that can be executed by the renamer.
def Zn4WriteVZeroIdiomLogicZ : SchedWriteVariant<[
SchedVar<MCSchedPredicate<ZeroIdiomPredicate>, [Zn4WriteZeroLatency]>,
SchedVar<NoSchedPred, [WriteVecLogicZ]>
]>;
def : InstRW<[Zn4WriteVZeroIdiomLogicZ], (instrs VPXORDZrr)>;

def Zn4WriteVZeroIdiomLogicY : SchedWriteVariant<[
SchedVar<MCSchedPredicate<ZeroIdiomPredicate>, [Zn4WriteZeroLatency]>,
SchedVar<NoSchedPred, [WriteVecLogicY]>
Expand Down Expand Up @@ -1930,6 +1938,12 @@ def : IsZeroIdiomFunction<[
VPSUBUSBYrr, VPSUBUSWYrr,
VPCMPGTBYrr, VPCMPGTWYrr, VPCMPGTDYrr, VPCMPGTQYrr
], ZeroIdiomPredicate>,

// AVX ZMM Zero-idioms.
// TODO: This should be expanded to incorporate all AVX512 zeroing idioms.
DepBreakingClass<[
VPXORDZrr
], ZeroIdiomPredicate>,
]>;

def : IsDepBreakingFunction<[
Expand Down
Loading

0 comments on commit ee40ffd

Please sign in to comment.