diff --git a/IGC/Compiler/CISACodeGen/CodeSinking.cpp b/IGC/Compiler/CISACodeGen/CodeSinking.cpp index 140e00078bc8..c3345b788ad4 100644 --- a/IGC/Compiler/CISACodeGen/CodeSinking.cpp +++ b/IGC/Compiler/CISACodeGen/CodeSinking.cpp @@ -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; @@ -2229,7 +2229,7 @@ namespace IGC { } DenseMap DestVecToShuffleInst; - SmallVector ShuffleCandidates; + CandidateVec ShuffleCandidates; DenseMap ShuffleInstToCandidate; for (auto &VecIEs : SourceVectors) @@ -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(InstrVec{}, TgtBB, SinkFromPH ? LoopSinkWorthiness::Sink : LoopSinkWorthiness::IntraLoopSink, nullptr)); Changed = true; for (Instruction *I : ShuffleInst) { - ShuffleInstToCandidate[I] = &ShuffleCandidates.back(); + ShuffleInstToCandidate[I] = ShuffleCandidates.back().get(); } } } diff --git a/IGC/Compiler/tests/CodeSinking/LoopSinking/2d-blockload-vectorschuffle-sch.ll b/IGC/Compiler/tests/CodeSinking/LoopSinking/2d-blockload-vectorschuffle-sch.ll index c0ab9cc0424a..7f203178373b 100644 --- a/IGC/Compiler/tests/CodeSinking/LoopSinking/2d-blockload-vectorschuffle-sch.ll +++ b/IGC/Compiler/tests/CodeSinking/LoopSinking/2d-blockload-vectorschuffle-sch.ll @@ -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(