Skip to content

Commit 2371987

Browse files
admitricfda0
authored andcommitted
Rollback vector shuffle sinking functionality
Rollback part of the functionality as it is not fully functional yet (cherry picked from commit a107ef6)
1 parent 0c8bc85 commit 2371987

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

IGC/Compiler/CISACodeGen/CodeSinking.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -1991,7 +1991,7 @@ namespace IGC {
19911991
if (CurrentCandidateInsts.size() > 0 &&
19921992
Id == GenISAIntrinsic::GenISA_LSC2DBlockReadAddrPayload)
19931993
{
1994-
if (!SinkFromPH && !allUsesAreDominatedByUndoPoint(CurrentCandidateInsts, CurrentCandidateInsts[0]))
1994+
if (!SinkFromPH && !allUsesAreDominatedByUndoPoint(CurrentCandidateInsts, CurrentCandidateInsts[0]->getNextNode()))
19951995
{
19961996
PrintDump(VerbosityLevel::High, "Not all the uses are dominated by the UndoPoint, skipping.\n");
19971997
return false;
@@ -2229,7 +2229,7 @@ namespace IGC {
22292229
}
22302230

22312231
DenseMap<InsertElementInst *, InstSet> DestVecToShuffleInst;
2232-
SmallVector<Candidate, 16> ShuffleCandidates;
2232+
CandidateVec ShuffleCandidates;
22332233
DenseMap<Instruction *, Candidate *> ShuffleInstToCandidate;
22342234

22352235
for (auto &VecIEs : SourceVectors)
@@ -2279,12 +2279,12 @@ namespace IGC {
22792279
PrintDump(VerbosityLevel::Medium, "DestVector used in the loop:\n");
22802280
PrintInstructionDump(VerbosityLevel::Medium, DestVec);
22812281

2282-
ShuffleCandidates.emplace_back(InstrVec{}, TgtBB, SinkFromPH ? LoopSinkWorthiness::Sink : LoopSinkWorthiness::IntraLoopSink, nullptr);
2282+
ShuffleCandidates.push_back(std::make_unique<Candidate>(InstrVec{}, TgtBB, SinkFromPH ? LoopSinkWorthiness::Sink : LoopSinkWorthiness::IntraLoopSink, nullptr));
22832283
Changed = true;
22842284

22852285
for (Instruction *I : ShuffleInst)
22862286
{
2287-
ShuffleInstToCandidate[I] = &ShuffleCandidates.back();
2287+
ShuffleInstToCandidate[I] = ShuffleCandidates.back().get();
22882288
}
22892289
}
22902290
}

IGC/Compiler/tests/CodeSinking/LoopSinking/2d-blockload-vectorschuffle-sch.ll

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
; REQUIRES: regkeys, llvm-14-plus
1010
; RUN: igc_opt --opaque-pointers -platformpvc --regkey LoopSinkMinSave=1 --regkey LoopSinkAvoidSplittingDPAS=0 --regkey LoopSinkEnable2dBlockReads=1 --regkey LoopSinkEnableLoadsRescheduling=1 --regkey ForceLoopSink=1 --regkey CodeLoopSinkingMinSize=10 --regkey CodeSinkingLoadSchedulingInstr=1 --regkey LoopSinkCoarserLoadsRescheduling=0 --regkey LoopSinkEnableVectorShuffle=1 %enable-basic-aa% --igc-code-loop-sinking -S %s 2>&1 | FileCheck %s
1111

12+
; The functionality is not functional yet, so we expect the test to fail
13+
; XFAIL: *
14+
1215
define spir_kernel void @foo(ptr addrspace(1) %_arg_A, ptr addrspace(1) %_arg_B, i16 %localIdY) {
1316
; Check that the order of the first loads and SetField calls is not changed after rollback
1417
; CHECK-LABEL: @foo(

0 commit comments

Comments
 (0)