Skip to content

Commit 1955faf

Browse files
agrabezhigcbot
authored andcommitted
Restrict IMAD slicing to newer platforms
The MadLoopSlice and AdvCodeMotion passes applied integer MAD slicing too broadly, causing regressions on some platforms. Narrow the platform guard so IMAD slicing only fires on platforms that benefit from the optimization.
1 parent c607644 commit 1955faf

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

IGC/Compiler/CISACodeGen/AdvCodeMotion.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -730,8 +730,8 @@ static bool isIMAD(const Instruction *I) {
730730
static bool isCandidateMAD(const Instruction *I, const CodeGenContext *CGC) {
731731
if (isDMAD(I))
732732
return true;
733-
// Keep behavior consistent with MadLoopSlice: only touch IMAD on PVC+.
734-
return (CGC && CGC->platform.isProductChildOf(IGFX_PVC) && isIMAD(I));
733+
// Keep behavior consistent with MadLoopSlice: only touch IMAD on XE3P+.
734+
return (CGC && CGC->platform.isCoreChildOf(IGFX_XE3P_CORE) && isIMAD(I));
735735
}
736736

737737
static bool clusterByEquivalenceClasses(ArrayRef<Instruction *> Order, EquivalenceClasses<Instruction *> &ECs,
@@ -900,7 +900,7 @@ bool MadLoopSlice::sliceBlock(BasicBlock *BB) const {
900900
Run.clear();
901901
};
902902

903-
// Slice contiguous runs of MAD-like ops (DMAD or PVC+ IMAD) inside an acyclic BB.
903+
// Slice contiguous runs of MAD-like ops (DMAD or XE3P+ IMAD) inside an acyclic BB.
904904
// This is less restrictive than MadLoopSlice (which requires an all-MAD loop body)
905905
// and matches real kernels that have setup code before/after the MAD region.
906906
for (Instruction &I : *BB) {

IGC/Compiler/tests/MadLoopSlice/imad.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99

1010
; REQUIRES: llvm-14-plus
11-
; RUN: igc_opt --platformpvc --opaque-pointers -igc-madloopslice -S < %s | FileCheck %s
11+
; RUN: igc_opt --platformCri --opaque-pointers -igc-madloopslice -S < %s | FileCheck %s
1212
; ------------------------------------------------
1313
; MadLoopSlice (block slicing)
1414
; ------------------------------------------------

0 commit comments

Comments
 (0)