Skip to content

Commit

Permalink
Fixes compilation problem on GCC 14
Browse files Browse the repository at this point in the history
GCC detected dangerous pattern which required refactor in order to compile.

(cherry picked from commit 03a6d27)
  • Loading branch information
bokrzesi authored and pszymich committed Aug 21, 2024
1 parent 92b3bc7 commit a8f626d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion IGC/Compiler/Optimizer/MCSOptimization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ void MCSOptimization::visitCallInst(llvm::CallInst& I)
for (auto BB : useBlocks)
{
std::vector<LdmsInstrinsic*> ldmsInstsToMove;
std::vector<LdmsInstrinsic*> ldmsInstsToClub;
for (auto inst = BB->begin(); inst != BB->end(); inst++)
{
if (LdmsInstrinsic * ldmsIntr = dyn_cast<LdmsInstrinsic>(inst))
Expand All @@ -203,7 +204,7 @@ void MCSOptimization::visitCallInst(llvm::CallInst& I)

while (!allInstsWillBeMoved)
{
std::vector<LdmsInstrinsic*> ldmsInstsToClub;
ldmsInstsToClub.clear();
//Threshold is more than # of insts that are to be moved. So move all.
if (instClubThreshold >= static_cast<int>(ldmsInstsToMove.size()))
{
Expand Down

0 comments on commit a8f626d

Please sign in to comment.