Skip to content

Commit 0e7c6ac

Browse files
aratajewigcbot
authored andcommitted
Revert workaround in memopt for common kernels
This change reverts the following commits: - f236e7a - 6ffb0c5
1 parent 4ef912e commit 0e7c6ac

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

IGC/Compiler/CISACodeGen/MemOpt.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,6 @@ namespace {
8383
bool AllowNegativeSymPtrsForLoad = false;
8484
bool AllowVector8LoadStore = false;
8585

86-
unsigned Limit = IGC_GET_FLAG_VALUE(MemOptWindowSize);
87-
8886
// Map of profit vector lengths per scalar type. Each entry specifies the
8987
// profit vector length of a given scalar type.
9088
// NOTE: Prepare the profit vector lengths in the *DESCENDING* order.
@@ -523,8 +521,6 @@ bool MemOpt::runOnFunction(Function& F) {
523521
CGC = getAnalysis<CodeGenContextWrapper>().getCodeGenContext();
524522
TLI = &getAnalysis<TargetLibraryInfoWrapperPass>().getTLI();
525523

526-
527-
528524
if (ProfitVectorLengths.empty())
529525
buildProfitVectorLengths(F);
530526

@@ -641,6 +637,7 @@ bool MemOpt::removeRedBlockRead(GenIntrinsicInst* LeadingBlockRead,
641637
TrivialMemRefListTy& ToOpt, unsigned& sg_size)
642638
{
643639
MemRefListTy::iterator MI = aMI;
640+
const unsigned Limit = IGC_GET_FLAG_VALUE(MemOptWindowSize);
644641
const unsigned windowEnd = Limit + MI->second;
645642
auto ME = MemRefs.end();
646643

@@ -1212,6 +1209,7 @@ bool MemOpt::mergeLoad(LoadInst* LeadingLoad,
12121209
// List of instructions need dependency check.
12131210
SmallVector<Instruction*, 8> CheckList;
12141211

1212+
const unsigned Limit = IGC_GET_FLAG_VALUE(MemOptWindowSize);
12151213
// Given the Start position of the Window is MI->second,
12161214
// the End postion of the Window is "limit + Windows' start".
12171215
const unsigned windowEnd = Limit + MI->second;
@@ -1565,6 +1563,7 @@ bool MemOpt::mergeStore(StoreInst* LeadingStore,
15651563
// List of instructions need dependency check.
15661564
SmallVector<Instruction*, 8> CheckList;
15671565

1566+
const unsigned Limit = IGC_GET_FLAG_VALUE(MemOptWindowSize);
15681567
// Given the Start position of the Window is MI->second,
15691568
// the End postion of the Window is "limit + Windows' start".
15701569
const unsigned windowEnd = Limit + MI->second;

IGC/Compiler/CISACodeGen/ShaderCodeGen.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,8 @@ void AddAnalysisPasses(CodeGenContext& ctx, IGCPassManager& mpm)
369369

370370
mpm.add(new DpasScan());
371371

372+
mpm.add(new MatchCommonKernelPatterns());
373+
372374
// let CleanPHINode be right before Layout
373375
mpm.add(createCleanPHINodePass());
374376
if(IGC_IS_FLAG_SET(DumpRegPressureEstimate)) mpm.add(new IGCRegisterPressurePrinter("final"));
@@ -725,7 +727,6 @@ void AddLegalizationPasses(CodeGenContext& ctx, IGCPassManager& mpm, PSSignature
725727
}
726728
// Should help MemOpt pass to merge more loads
727729
mpm.add(createSinkCommonOffsetFromGEPPass());
728-
mpm.add(new MatchCommonKernelPatterns());
729730

730731
// Run MemOpt
731732
if (!isOptDisabled &&

0 commit comments

Comments
 (0)