Skip to content

Commit

Permalink
Rollback vector shuffle sinking functionality
Browse files Browse the repository at this point in the history
Rollback part of the functionality as it is not fully functional yet
  • Loading branch information
admitric authored and igcbot committed Nov 18, 2024
1 parent e572b3b commit a107ef6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
8 changes: 4 additions & 4 deletions IGC/Compiler/CISACodeGen/CodeSinking.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1991,7 +1991,7 @@ namespace IGC {
if (CurrentCandidateInsts.size() > 0 &&
Id == GenISAIntrinsic::GenISA_LSC2DBlockReadAddrPayload)
{
if (!SinkFromPH && !allUsesAreDominatedByUndoPoint(CurrentCandidateInsts, CurrentCandidateInsts[0]))
if (!SinkFromPH && !allUsesAreDominatedByUndoPoint(CurrentCandidateInsts, CurrentCandidateInsts[0]->getNextNode()))
{
PrintDump(VerbosityLevel::High, "Not all the uses are dominated by the UndoPoint, skipping.\n");
return false;
Expand Down Expand Up @@ -2229,7 +2229,7 @@ namespace IGC {
}

DenseMap<InsertElementInst *, InstSet> DestVecToShuffleInst;
SmallVector<Candidate, 16> ShuffleCandidates;
CandidateVec ShuffleCandidates;
DenseMap<Instruction *, Candidate *> ShuffleInstToCandidate;

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

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

for (Instruction *I : ShuffleInst)
{
ShuffleInstToCandidate[I] = &ShuffleCandidates.back();
ShuffleInstToCandidate[I] = ShuffleCandidates.back().get();
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
; REQUIRES: regkeys, llvm-14-plus
; 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

; The functionality is not functional yet, so we expect the test to fail
; XFAIL: *

define spir_kernel void @foo(ptr addrspace(1) %_arg_A, ptr addrspace(1) %_arg_B, i16 %localIdY) {
; Check that the order of the first loads and SetField calls is not changed after rollback
; CHECK-LABEL: @foo(
Expand Down

0 comments on commit a107ef6

Please sign in to comment.